Why context management is most of the skill
Claude Code
This page covers tools outside your selection. You can still read it. Find matching guides
Anthropic says most of their own best practices descend from one constraint. Knowing what each action costs turns that from advice into arithmetic.
Anthropic states the organising fact about Claude Code in one sentence: "Most best practices are based on one constraint: Claude's context window fills up fast, and performance degrades as it fills."
Almost every piece of advice about the tool descends from that. Plan mode, subagents, /clear, a short CLAUDE.md, scoped investigations — they are all the same move. Understand the constraint and you can derive the practice instead of memorising it.
You start a session already loaded
Anthropic publishes a walkthrough of what fills a session, with token costs. Before you type anything:
| Loaded at startup | Tokens |
|---|---|
| System prompt | 4,200 |
| Project CLAUDE.md | 1,800 |
| Auto memory (MEMORY.md) | 680 |
| Skill descriptions | 450 |
~/.claude/CLAUDE.md | 320 |
| Environment info | 280 |
| MCP tool names (deferred) | 120 |
Roughly 7,850 tokens spent before your first word. Most of it you never see, and one line of it is yours to control.
Note which entry is the largest after the system prompt. A bloated project CLAUDE.md is a cost you pay on every session forever, which is the concrete reason Anthropic tells you to prune it: "Bloated CLAUDE.md files cause Claude to ignore your actual instructions!"
What the work itself costs
From the same walkthrough, a routine debugging sequence:
- Reading one source file: 1,100–2,400 tokens each
- A
grepacross the repo: 600 - A test run's output: 1,200
- Each edit, plus the hook that formats it: 100–600
Four file reads and a test run is roughly 8,000 tokens, about what your entire startup cost. That is the arithmetic behind "scope the investigation": an unscoped "look at how authentication works" can read thirty files, and thirty files is most of a working session spent before any thinking happens.
The three levers, in order of bluntness
/clear between unrelated tasks. Resets the window entirely. The cheapest and most underused control, and the fix for the kitchen-sink session where one task's context is still loaded during another's.
/compact, with instructions. Summarises and continues. /compact Focus on the API changes keeps what matters when you know what matters. Automatic compaction fires near the limit and does the same thing without your steer.
Subagents, for anything exploratory. Delegate the reading, keep the answer.
Anthropic adds one that is easy to miss: /btw asks a side question whose answer never enters conversation history, so you can check a detail without growing the window.
Watching it rather than guessing
Run /context to see what is loaded and confirm your CLAUDE.md was actually picked up. A status line can show usage continuously.
Watching it once changes how you work, because the costs are unintuitive until they are numbers. Most people are surprised by how much a single large file read takes and by how little a subagent returns.
Try this
Start a session and run /context before doing anything. Note the number. Then ask for something deliberately unscoped — "explain how this project is structured" — and run /context again.
The difference is what one vague question costs. That figure is the one worth carrying around.
What goes wrong
Treating the window as free until it errors. Degradation starts long before the limit. By the time compaction fires, quality has been sliding for a while.
A CLAUDE.md that grew. It is re-read every session and competes with your actual instructions. Anthropic's test for each line: would removing this cause Claude to make mistakes?
Investigating in the main thread. Reading thirty files to answer one question spends the context you needed for the work the question was for.
Correcting instead of clearing. Failed attempts stay in the window and get re-sent every turn. Past two corrections on the same point, start fresh.
How to check it worked
Compare /context at the point where a session starts feeling vague against what it read to get there. If most of the window is file reads from an exploration that has finished, the material is spent and clearing costs you nothing you still need. If it is mostly the work itself, the window is doing its job and the problem is somewhere else.
Sources
- Best practices for Claude Code — Anthropic Tier 1 2026-09-04
- Explore the context window — Claude Code Docs Tier 1 2026-09-04
Something wrong with this page?
Say what you expected and what you got. That is usually the shortest route to a correction, and it goes on the public issue tracker so the fix is visible.