The context window: Claude Code's fuel gauge
Why long sessions get worse, and the commands that fix it.
Almost every Claude Code tip comes back to one fact from Anthropic's best-practices guide: the fills up fast, and performance gets worse as it fills. Every message, every file Claude reads and every command output takes space.
All current Claude models can hold about one million . That is huge, but Claude Code fills it fast: one big log file or a long command output can take more space than your whole conversation. Size does not change the rule: the fuller the window, the worse the focus.
Plenty of room. Claude has your full attention.
The commands that manage it
| Command | What it does |
|---|---|
/context | Shows what is using your context space. |
/clear | Starts fresh. Use it between unrelated tasks. |
/compact [focus] | Summarizes the conversation to free space, e.g. /compact focus on the API changes. |
Esc | Stops Claude mid-action without losing the context. |
Esc Esc or /rewind | Opens the rewind menu to restore an earlier point in the conversation and files. |
/btw question | Asks a side question that does not enter the conversation history. |
claude --continue / --resume | Picks up an earlier session. |
Two failure patterns to avoid
- The kitchen-sink session. One task, then an unrelated one, then back. Fix:
/clearbetween tasks. - Correcting over and over. After two failed corrections, the context is full of dead ends. Fix:
/clearand write a better first using what you learned.
Signs your context is too full
- Claude forgets a rule you gave it earlier.
- It repeats a fix that already failed.
- Answers get longer but less precise.
A clean restart in three moves
- Ask: “Summarize what we learned, what works, and what is still broken, in 10 lines.”
- Copy the summary, then run
/clear. - Paste the summary as your first message, with the next task.
Check yourself
Tip: use ← and → to move between lessons.