Originally published on hexisteme notes.

I run a small fleet of coding agents, and one number had been bothering me for weeks: spawning a general-purpose sub-agent cost roughly 70,000 tokens before it did anything. I knew the rough shape of where that went — system prompt, built-in tool schemas, some kind of project configuration, and whatever the MCP layer was contributing — but I didn't have the breakdown, and "roughly 70k, mostly overhead" isn't something you can act on. You can't decide whether to trim the config injection or the tool catalog if you don't know which one is bigger.

So I built an instrument. A tiny local HTTP proxy that sits between my machine and the vendor's API, forwards every request unmodified, and writes the request and response bodies to disk before passing them through. Deliberately, it never writes headers to disk — request and response bodies are the only thing it records. I pointed my coding-agent CLI at it using the documented base-URL environment override, the one meant for routing through a gateway, and ran a batch of headless sessions through it to capture exactly what got sent.

The first captures looked like a different bug

The captures came back showing roughly 240,000 tokens per sub-agent spawn — a general-purpose spawn at 246,525 tokens, a restricted-tool explorer spawn at 212,736. That's more than three times what I expected. My first instinct was to go check real, un-proxied session transcripts for the same spawn types, and those showed something completely different: 70,733 tokens for a general-purpose spawn, 40,810 for an explorer spawn. Same spawn types, same tool configuration, off by roughly 3x in both cases.