Compact vs Clear
When to summarize and when to reset the context
PDF editions · Guide v3.44.1 · Updated
The two commands
/compact | /clear | |
|---|---|---|
| History | Replaced by a summary | Reset in the current conversation |
| Session thread | Maintained | Broken |
| Context effect | History replaced by a summary; amount varies | Conversation history reset |
| When to use | Mid-task | Topic change |
/compact compresses without cutting the thread, /clear starts from scratch. Neither is universally better, the choice depends on the situation.
Context decisions
Use /context to inspect usage. Compact when useful history has become bulky; clear when changing topics or when a fresh conversation is more useful. No single occupancy percentage predicts response quality. Save decisions, acceptance criteria and unfinished work before either operation.
When to use /compact
Ideal situations:
- Task in progress with useful historical context
- Long session on the same module or feature
- You need to remember decisions made
/compactClaude replaces conversation history with a summary. The space recovered and the details preserved vary; check /context and keep critical state in files.
When to use /clear
Ideal situations:
- Complete change of topic or project
- Context polluted by many errors and failed attempts
- Session going badly, generating inconsistencies
/clearThe conversation starts fresh; applicable instructions are loaded again. Saved sessions remain resumable. Start with a focused prompt and the necessary context files.
”Summarize from Here”: The third option
Via /rewind (or Esc + Esc), you can select a specific point in the history and choose “Summarize from here”. Claude summarizes only from that point, keeping prior context intact.
Esc + Esc → select a checkpoint → "Summarize from here"More precise than global /compact, useful when only the end of the session is verbose.
Quick comparison
| Situation | Command |
|---|---|
| Bulky history, same task | /compact |
| New topics after a dense session | /clear |
| Verbose end of session to clean up | Rewind → Summarize |
| Useful history worth summarizing | /compact |
| Repeated confusion, fresh start needed | /clear |
What /compact does NOT preserve
The summary generated by /compact is a synthesis. It may simplify technical nuances or implicit decisions. After a compact, verify that critical elements are still accessible before continuing a complex implementation.
Enter your email to read the full card and get the complete PDF bundle.
All content is free and open-source. We just ask for your email.