§5.1 · Code
/clear vs /compact — pick the right reset
Two commands, two different jobs. Knowing when to use which.
Long Claude Code sessions get expensive linearly. Every turn re-sends the entire conversation as input. By turn 40, you might be paying for 40,000+ input tokens every keystroke just to keep history around.
/clear and /compact are the two ways out. They do different things.
/clear — start fresh
Wipes the conversation history entirely. Claude has no memory of the prior turns; only the persistent CLAUDE.md + any new files it reads. Use it when:
- You've finished a discrete task and the next one is unrelated.
- The conversation drifted off the original goal and the history is now noise.
- You're paying >$0.10 per turn just to keep talking.
The downside: any context Claude had on what you were trying to do is gone.
/compact — summarize and continue
Hands the conversation history to Claude with one instruction: write a tight summary of what's relevant for continuing. Then replaces the history with that summary. You keep continuity at a fraction of the cost. Use it when:
- You're in the middle of a multi-step task and want to keep going.
- You've made decisions in this session that the next turns need to know about.
- The conversation has bloated past 30k tokens but you're not done.
The downside: the summary is lossy. Claude might lose a constraint that wasn't obviously important to preserve. Re-state critical invariants in your next prompt.
When to fire which
| Situation | Use |
|---|---|
| Task finished, new task | /clear |
| Same task, getting expensive | /compact |
| Same task, just got confused | /clear + re-prime |
| Working on three things in parallel | /clear and run them in separate sessions |
The cost trigger
A reasonable rule of thumb: if your last 5 turns each cost more than $0.05 and your task isn't visibly progressing, it's /clear time. The Session Cost Tracker (live via the CLI hook) shows this number in real time.
The /clear-/compact Coach module turns this into a per-session recommendation.