|Ben @ Grepture

Route Claude Code Through Grepture — Observability, Cost Tracking, and PII Protection for Your Team

You can now route all Claude Code traffic through Grepture. See every request, track token costs per developer, and protect sensitive data — with a 2-minute setup.

Claude Code is powerful. It's also a black box.

Claude Code is one of the best AI coding tools out there. Point it at a codebase, describe what you want, and it reads files, writes code, runs tests, and iterates — all from the terminal.

But here's the thing: every prompt your team sends and every response Claude generates flows directly to Anthropic. You have no visibility into what's being sent, what it costs, or whether sensitive data is leaking out in the process. Multiply that across a team of developers, and you've got a real blind spot.

We built a fix for this. Starting today, you can route all Claude Code traffic through Grepture.

What this gives you

See every request

Every Claude Code interaction — prompts, tool calls, responses — gets logged in your Grepture dashboard. Search by content, filter by developer, trace multi-turn coding sessions from start to finish. When something goes wrong or a prompt produces unexpected results, you can see exactly what happened.

Know what it costs

Claude Code burns tokens fast. A single refactoring session can rack up thousands of input and output tokens across dozens of requests. With Grepture in the path, you get per-request cost attribution: which model was used, how many tokens, and what it cost. Roll that up by developer, by day, by project. No more waiting for the monthly Anthropic bill to find out where the budget went.

Protect sensitive data

Developers paste code, config files, error logs, and database output into Claude Code prompts. That context often contains API keys, customer data, internal URLs, and credentials. Grepture's detection rules scan every outbound request and catch sensitive data before it reaches Anthropic — the same rules that protect your production API traffic.

Setup takes 2 minutes

No SDK to install. No code changes. Just three environment variables in your Claude Code config.

Add this to ~/.claude/settings.json (global) or .claude/settings.json (per-project):

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://proxy.grepture.com/claude",
    "ANTHROPIC_API_KEY": "sk-ant-your-key-here",
    "ANTHROPIC_CUSTOM_HEADERS": "x-grepture-api-key: grp_your-key-here"
  }
}

That's it. Every Claude Code request now flows through Grepture. Open your dashboard to see the traffic.

How it works under the hood

Claude Code supports a ANTHROPIC_BASE_URL environment variable that redirects all API calls to a custom endpoint. We added a /claude prefix to the Grepture proxy that accepts these requests, authenticates them with your Grepture API key, applies your detection rules, and forwards them to https://api.anthropic.com/v1/messages with your Anthropic key.

The proxy strips the /claude prefix before forwarding, so Anthropic receives a standard API request. On the way back, the response flows through Grepture — logged, measured, and (if you have PII rules enabled) scrubbed of any sensitive data that made it into the response.

Latency impact is minimal. The proxy adds under 10ms to each request — negligible compared to the model inference time.

Team setup

For teams, put the config in a shared .claude/settings.json in your repository. Each developer uses their own Anthropic API key, but the ANTHROPIC_BASE_URL and Grepture API key can be shared. This gives you one dashboard view of all Claude Code usage across your organization.

Some things you can do with this:

  • Budget tracking — see total Claude Code spend per developer, per week
  • Prompt auditing — review what's being sent to the model across your team
  • Data protection — enforce the same PII and secret scanning rules you use in production
  • Debugging — when a developer says "Claude Code did something weird," you can pull up the exact conversation

What's next

This is our first integration beyond SDK-based traffic. Claude Code was the natural starting point — it's widely used, it supports base URL configuration, and the observability gap is real.

We're looking at other AI coding tools next. If you're using Cursor, Copilot, or other tools and want the same visibility, let us know.

Get started

  1. Create a Grepture account (free plan includes 1,000 requests/month)
  2. Add the three env vars to your Claude Code config
  3. Open the dashboard and watch your traffic flow in

Full setup guide in our docs.