Claude Code on Amazon Bedrock does not send invokes to ANTHROPIC_BASE_URL. The client talks to bedrock-runtime with SigV4. I wanted the JSON, the EU on-demand dollars, and a hold/edit step, so I built claude-sniff: one Python process, mitmproxy on 127.0.0.1:9090, UI on 8765.
I am the author. MIT. Python 3.12, uv.
What you actually run
uv sync
uv run python main.py --aws-profile your-profile
Then, in the same shell as Claude Code:
export HTTP_PROXY=http://127.0.0.1:9090
export HTTPS_PROXY=http://127.0.0.1:9090
claude
Proxy and Intercept start off. Usage still reads ~/.claude/projects. Turn Proxy on only when you want decrypt; then export the mitmproxy CA and restart claude. Intercept holds Bedrock invoke / invoke-with-response-stream that carry x-claude-code-session-id. Untouched JSON is resumed as-is. Edited JSON is re-signed. Drop never calls Bedrock.
Why not a reverse proxy
I tried the Anthropic-API pattern first. It never fired. The interesting part of the code is not “run mitmproxy”; it is sniffing event streams, mapping three model families for EU list prices, and re-signing after an edit without copying static AWS keys into the repo. Inference-profile ids are account-scoped — you pass them in env; the repo ships none.
Logs live in logs/ (gitignored). JSONL strips Authorization and x-amz-security-token. Bodies stay as-is, so treat that directory as toxic.
If you only want cost, leave Proxy off. If you want to rewrite a system prompt for one request, turn Intercept on, edit the head, Forward.

Top comments (0)