claude: compact context
• 94 words • 1 min • updated
These days, Claude Code warns you when you’re running out of context:
Context left until auto-compact: 5%
How Auto-Compact Works
When your conversation approaches the context window limit, Claude Code automatically:
- Analyzes the conversation to identify key information worth preserving
- Creates a concise summary of previous interactions, decisions, and code changes
- Compacts the conversation by replacing old messages with the summary
- Continues seamlessly with the preserved context
It’s possible to run /compact manually to compact the context sooner1.
-
Let the machine do the garbage collection though! Why would you bother to do so manually? ↩︎