
Sniffing Claude Code's API Calls: What Your IDE Is Really Sending
Every time you press Enter in Claude Code, something interesting happens behind the scenes. Your full conversation — system prompt, message history, tool definitions, everything — gets packaged into an API call and sent to Anthropic's servers. But you never get to see those calls. Claude Code logs a JSONL transcript of what it did (tool calls, responses, thinking blocks), but not the raw API traffic that made it happen. The system prompt, HTTP headers, request parameters, latency per call, and one entirely hidden API call — all invisible. So we built a way to see everything. The Trick: One Environment Variable Claude Code officially supports ANTHROPIC_BASE_URL — an environment variable that redirects API traffic to a custom endpoint. It's meant for enterprise proxies, but it works perfectly for local interception: Claude Code ──plain HTTP──▶ Sniffer (localhost:7735) ──HTTPS──▶ api.anthropic.com │ ▼ ~/.claude/api-sniffer/*.jsonl Start the sniffer in one terminal, launch Claude Code in a
Continue reading on Dev.to
Opens in a new tab




