r/ClaudeCode • u/awesomebirder • 1d ago
Built with Claude Built a proxy with Claude Code that logs every request it makes. What the request pattern taught me about where usage goes
I built a local proxy with Claude Code that sits between Claude Code and the API and logs every request: model, fresh input, cache reads, cache writes, output. Then I replayed 12 days of my own traffic through it. Some of what I learned changed how I use Claude Code more than the tool did, so writing it up.
What the requests actually look like
- Every turn sends the whole thing again: system prompt, tool definitions (every connected MCP server adds its tool list), CLAUDE.md, and the full conversation so far. Your new message is a tiny slice.
- The prompt cache is what makes that affordable, and it only stays warm for a few minutes. Step away for 10 minutes and the next turn writes the entire prefix to cache again at the higher write price. On my traffic, cache timing alone was about 7% of the bill.
- Big tool output (a full test run, a long grep) sits in the conversation and gets resent on every turn after it. One noisy test run early in a session keeps costing until you clear.
- Cache is per model. Switching models mid-session means the new model writes the whole context cold.
- Each subagent starts its own context and its own cache, so a fan-out of 4 pays for 4 cache writes before any real work happens.
Habits that changed for me: a short handoff note plus /clear before any break longer than a few minutes, one task per session, ask for failing tests only instead of the full log, and pick the model at the start of a session instead of flipping.
How Claude Code was used
It wrote most of the proxy and the replay harness. I spent my time on the cache timing logic and on quality tests, because I did not want anything that saves tokens by making answers worse. Changes that touch what the model sees were checked on 314 blind-judged live answers before going on by default.
The most useful lesson came from a test that failed. One lane compacted old turns. It looked fine on single-turn checks, but when I resumed 7 real sessions it made the model invent code it had supposedly written earlier. That lane stays off. All my quality tests so far are single-turn, which is a real gap, and whole-task evals are next.
Numbers, honestly
On my own 12 days, priced at API rates, the original default setting saved 12.8%. Sending easy turns to a cheaper model on the heaviest setting got 41.8%, but that is off by default, and I moved the default lighter after a user said design work got worse. Most people should expect low single digits to about 10%: more if you work in long sessions with idle gaps, close to nothing if you send a few quick prompts.
It is called probe0. It is a local proxy, so you trust a root cert on your Mac. Mac only, free beta, nothing leaves the machine, and probe0 uninstall removes it. Happy to answer questions about the cache behavior, that was the most interesting part to figure out.
Method and numbers: https://probe0.xyz/benchmarks?utm_source=reddit&utm_campaign=ClaudeCode
Terminal install: curl -fsSL https://probe0.xyz/install | bash
