Every MCP server adds its tool names, descriptions and schemas to every request, used or not, and CLAUDE.md loads the same way. That fixed overhead takes window space and is re-sent every turn. Run /context to size it, disconnect servers you do not use, scope the rest per project and keep CLAUDE.md to rules the agent needs.
Where Claude Code's fixed token overhead comes from
Before your first message the request already holds all of this, and every request re-sends it. The last three are yours, and they only grow.
| Source | What gets sent | Who controls it |
|---|---|---|
| System prompt | Claude Code's own instructions | Anthropic |
| Built-in tools | Read, Edit, Bash, Grep and others | Anthropic |
| MCP servers | Every tool's name, description and JSON schema | You |
| CLAUDE.md files | User, project and imported files | You |
| Custom agents and skills | Short descriptions so Claude knows they exist | You |
Measure MCP and CLAUDE.md tokens with /context
- 1Fresh session, then /context
Everything except messages is fixed overhead: system prompt, system tools, MCP tools, memory files.
- 2Run /mcp
A server with dozens of long-described tools is usually the biggest single item.
- 3Read the MCP tools line
A large share before any work is room you lose later, and it brings auto-compact closer.
Why tool definition tokens matter more than they look
Caching makes a fixed block cheaper, not free, and cached tokens still count toward plan limits. See prompt caching vs context compression.
- Paid on every turn, hundreds of times a session.
- Less room for real work. Every definition token is one not available for files and history.
- More ways to choose wrong. A hundred tools is a hundred chances to pick the wrong one.
- Changing them mid-session is a cache miss. They sit near the top of the prefix.
How to cut MCP server overhead
- 1Disconnect what you do not use
Go through
/mcp. Unused for a week means not loaded on every request. - 2Scope servers per project
claude mcp add --scope projectkeeps a server in the repo’s.mcp.json, not everywhere. - 3Prefer a CLI when one exists
If the agent can run
gh,kubectlorpsql, the MCP server adds definitions, not capability. - 4Pick lean servers
Enable a subset of tools where you can. Fewer, shorter descriptions cost less.
- 5Set up before you start
Decide on servers before a long session to avoid the cache miss.
How to keep CLAUDE.md lean
CLAUDE.md is for rules that must hold every turn, which is why it is expensive. The same applies to AGENTS.md in Codex.
| Keep | Cut |
|---|---|
| Build, test and lint commands | Descriptions of the architecture the code already shows |
| Conventions the agent gets wrong without being told | General advice like "write clean code" |
| Hard constraints: files never to touch | History of past incidents and decisions |
| Where to find things in a large repo | Long examples better kept in a doc the agent can open |
- Directory rules go in a CLAUDE.md in that directory, loaded only when Claude works there.
@imports still load the file, so they organize but do not save tokens.- Reference material belongs in a file read on demand or a skill, which loads in full only when used. More in context engineering for coding agents.
A five-minute overhead audit
- 1Take a baseline
Fresh session,
/context. Note MCP tools and memory files. - 2List servers
/mcp. Disable any you did not use on this project last week. - 3Read CLAUDE.md as the agent would
If a line would not change its behavior, delete it or move it to a file it can open.
- 4Re-measure
Another fresh session,
/context. The difference is room back on every turn. - 5Share it
Commit
.mcp.jsonand CLAUDE.md, and repeat when someone adds a server.
What compression can and cannot do about it
Fixed overhead is your job to trim. condense saves on the part that grows; a real 938-turn session came in 72.3% under baseline in the anatomy of a token bill.
| Part of the request | Who handles it |
|---|---|
| System prompt and your messages | Never rewritten by condense |
| MCP definitions and CLAUDE.md | You, with the audit above |
| Tool results, file reads, finished agent loops | condense compresses them |
Trim first, then run dense claude so the session stays small as it grows. dense info shows context sent against forwarded.
Frequently asked questions
How many tokens do MCP servers use in Claude Code?
It depends on how many tools a server has and how long their descriptions and schemas are. /context shows the MCP tools total for your setup.
Do MCP tools use tokens if I never call them?
Yes, the definitions are in every request. Recent Claude Code versions can defer some until needed, so check /context.
How long should CLAUDE.md be?
As short as it can be while still changing behavior. Keep commands, conventions and hard constraints; cut what the code already shows.
Does prompt caching make MCP and CLAUDE.md overhead free?
No. Cached tokens are cheaper but still billed, still count toward plan limits and still take window space.
Does AGENTS.md have the same overhead in Codex?
Yes. Codex loads it at session start, so keep it short and put directory-specific guidance next to the code.