Context ClaudeCursor Foundations

What Actually Fills a Context Window

An accounting of where your tokens go, so you can cut the right ones

13 of 66

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:

ComponentTokensShare
System prompt2,5004%
Tool definitions4,0006%
CLAUDE.md and project context5,0008%
Skill descriptions (all installed)1,5002%
Files read this session28,00044%
Tool output (searches, test runs, diffs)18,00028%
The actual conversation5,0008%
Total64,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 -30 rather than the whole run
  • Use rg -l to 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:

  1. You still pay per token. A full window on a frontier model is expensive per turn, and it is re-sent every turn.
  2. 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

Working out which model to run this on? See The Codex. Packaging it as a reusable skill? See The Armory.