Claude Code context full: /compact or /clear?
The longer the conversation, the more each turn costs. Here’s how Claude Code handles its context window, and when to compact or start over.
Window size
According to the documentation, Fable 5.1 and 5, Sonnet 5.5 and 5, and Opus 4.7 and later run natively with a one-million-token window. Opus 4.6 and Sonnet 4.6 stay at 200,000 unless you add the [1m] suffix.
The /context command shows how full the window is as a colored grid: the fastest way to see what’s filling it.
Automatic compaction
On one-million-token models, Claude Code compacts before the window is full, at about 967,000 tokens by default; on others, at the context limit. Set the threshold with /autocompact, for example /autocompact 500k.
After compaction, CLAUDE.md, memory and MCP tools reload, and the five most recently modified files are re-read.
/compact or /clear?
| Command | What it does | When |
|---|---|---|
| /clear | Starts over with an empty conversation, at no cost | Between unrelated tasks |
| /compact [instructions] | Summarizes the conversation to free up context; it’s a large request | Midway through a long task, with instructions on what to keep |
| /context | Shows what’s taking up the window | Before deciding |
Saving your limits
- Clear the context between tasks: it’s the first tip in the documentation on costs.
- Hand verbose work to a subagent: it only returns its result.
- Disable unused MCP servers, and keep CLAUDE.md short.
Frequently asked questions
Does automatic compaction lose information?
It summarizes the conversation, so details can drop out. CLAUDE.md instructions and the latest modified files reload.
Does a long context use up my limits faster?
Yes: every turn sends the context back to the model. Hence the documentation’s advice to clear the context between tasks.