{
  "id": 5574851,
  "title": "I could not point Claude Code at localhost, so I MITM Bedrock on loopback",
  "url": "https://urgent.news/2026/09/04/i-could-not-point-claude-code-at-localhost-so-i-mitm-bedrock-on",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-04T14:36:21.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/riccardo_cataldi_871c2360/i-could-not-point-claude-code-at-localhost-so-i-mitm-bedrock-on-loopback-5e1"
  },
  "original_language": "en",
  "account": "Claude Code, an Amazon Bedrock client, prefers not to send invokes to the ANTHROPIC_BASE_URL. To gain access to JSON data, EU on-demand costs, and a hold/edit step, the author created claude-sniff, a Python process that employs mitmproxy on the loopback address, 127.0.0.1:9090, with a UI accessible on port 8765. The repository contains Python 3.12, uv, and an MIT license.\n\nTo execute the program, run the command \"uv sync uv run python main.py --aws-profile your-profile\" within the same shell as Claude Code. Following that, set the HTTP_PROXY and HTTPS_PROXY environment variables to point to 127.0.0.1:9090. This allows the claude Proxy and Intercept to begin functioning.\n\nUsers can activate Proxy and Intercept as needed. If decryption is desired, export the mitmproxy CA and restart Claude Code. The mitmproxy intercepts Bedrock's invoke and invoke-with-response-stream calls, which contain the x-claude-code-session-id. The original JSON is forwarded unaltered, while edited JSON is re-signed before being sent. No modifications are made to the Bedrock calls.\n\nThe author's primary focus was not merely on running mitmproxy; they aimed to sniff event streams, map three model families for EU list prices, and re-sign JSON after editing without incorporating static AWS keys into the repository. Each inference profile is account-specific, requiring manual input via the env. The repository does not include any static AWS keys. Logs are stored in the \"logs/\" directory, and git ignores this folder. The JSONL files strip out Authorization and x-amz-security-token headers, leaving only the bodies, which remain unchanged. Cost-tracking can be achieved by leaving Proxy off. If system prompts need to be rewritten for a single request, turn on Intercept, edit the head, and then Forward. The repository can be accessed at https://github.com/RiccardoCataldi/claude_sniff.",
  "summary": "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…",
  "key_points": [
    "Claude Code client modified to MITM Bedrock on loopback",
    "Python script 'claude-sniff' uses mitmproxy for interception",
    "Proxy and Intercept activated to sniff Bedrock invoke calls"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}