FRDownload

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?

CommandWhat it doesWhen
/clearStarts over with an empty conversation, at no costBetween unrelated tasks
/compact [instructions]Summarizes the conversation to free up context; it’s a large requestMidway through a long task, with instructions on what to keep
/contextShows what’s taking up the windowBefore deciding

Saving your limits

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.

Read next

Sources