Most of my Claude Code input tokens weren’t my code
I logged the raw requests from one Claude Code session on a real repo to see where the input tokens actually go. I expected the files the agent read to dominate.
Input was about 123k tokens:
~74% tool definitions
~21% conversation, including a 40 KB file the agent read
~5% system prompt
So most of it was the list of tools the agent can call, sent again on every request. The file I was worried about was a small slice.
It’s one session on one setup, so take it with a grain of salt. My guess is it scales with how many MCP servers you have connected, since each one adds its own tool definitions.
If you want to check yours without any extra tooling, " /context " inside Claude Code shows a rough breakdown, including how much the MCP tools take up.
Curious what others see. Do tool definitions eat most of your context too, or is it mostly code and conversation for you? And has anyone tried trimming MCP servers per project to bring it down?

Replies
The agent ran out of context reading the test fixtures and silently cut half the assertions. A hard crash is easy to debug, but showing a green summary when it gave up halfway through breaks trust.
@konstantin_tikhaev Yeah, that’s the worst kind. A crash at least tells you something went wrong. Did it say anywhere that it skipped them, or did you catch it later?
Claude Code has a setting for this: ENABLE_TOOL_SEARCH=auto defers MCP tool definitions and loads them on demand, instead of sending every one on each request. Worth rerunning your test with it on. My harness does the same by default: the core tools stay loaded and the rest sit behind one entry the agent can list and call.
@wwenioaguiar Didn’t know about that setting, thanks. I’ll rerun the same session with it on and see how the split changes.
Same picture here before I changed anything. I have a lot connected: the Play Console server alone exposes a couple hundred tools, plus Gmail, Drive, Atlassian and the browser. With tool search on, they now show up as names only and get loaded when a task actually needs them, so most sessions never pay for the Play Console list at all. The other big chunk for me was my own project notes. My CLAUDE.md kept growing, so I cut it down to the rules that apply to every change and moved the rest into one file per area, with a table at the top saying which file to read before touching what. The agent pulls in the store notes only when it works on the store. Also worth remembering that a repeated prefix like tool definitions is cached, so it hurts the context window more than the bill.
@gbasovv A couple hundred tools from one server explains a lot. The one-file-per-area setup for CLAUDE.md is a good idea, I might try that. Fair point on caching too, it’s more of a context problem than a cost one.
I ran into this from the memory side. I had Gmail, Calendar, Drive, Zoom, LINE and a couple of internal servers all connected as MCP, and each one was taking about 560MB per session.
Since early October they're not connected anymore. A small command starts the server only when the agent actually needs it, so their tool definitions don't sit in the context either.
@hisashispace Hadn’t thought about the memory side at all. How does it decide when to start a server? Do you call it by name?