What Actually Fills a Context Window
An accounting of where your tokens go, so you can cut the right ones
The window is not "your question"
People picture a context window as holding the conversation. In an agentic session the conversation is usually the smallest part of it.
A representative turn, thirty turns into a coding session:
| Component | Tokens | Share |
|---|---|---|
| System prompt | 2,500 | 4% |
| Tool definitions | 4,000 | 6% |
CLAUDE.md and project context | 5,000 | 8% |
| Skill descriptions (all installed) | 1,500 | 2% |
| Files read this session | 28,000 | 44% |
| Tool output (searches, test runs, diffs) | 18,000 | 28% |
| The actual conversation | 5,000 | 8% |
| Total | 64,000 |
Two thirds is file contents and tool output. That is where the leverage is.
The compounding property
Every one of those tokens is re-sent on the next turn, and the next. A file you read on turn 4 is still being billed on turn 40.
one 6,000-token file read early in a 40-turn session = 6,000 × 36 remaining turns = 216,000 input tokens
At $2/M that is $0.43 for one file, most of which you stopped needing thirty turns ago. With caching it is a tenth of that, which is exactly why caching matters so much here.
Cutting the right things
Tool output is the best target. Search results, full test output, directory listings. Almost all of it is scanned once and never needed again.
- Ask for filtered output:
npm test 2>&1 | tail -30rather than the whole run - Use
rg -lto list files before reading any of them - Move exploratory searching into a subagent so the noise never enters the main window
File reads are the second target. Read the function, not the file.
Bad: read src/services/billing.ts (1,400 lines) Good: read src/services/billing.ts:200-260
CLAUDE.md is charged on every request, including trivial ones. A 400-line one is ~5,000 tokens on "what does this function do?". Keep it to what is true for every task; push the rest into skills, which cost a description line until they fire.
Ignore files stop waste at the source. .claudeignore for build output, lock files, vendored code, and generated assets. See Ignore Files for AI.
Bigger windows do not remove the problem
A 1M-token window is permission to include more, not an instruction to. Two things stay true regardless of size:
- You still pay per token. A full window on a frontier model is expensive per turn, and it is re-sent every turn.
- Attention is finite. Signal buried in 800,000 tokens of noise gets less weight than the same signal in 40,000. More context can produce worse answers.
See also: Context Management & Compaction · Compaction or a Fresh Session? · Prompt Caching Economics