Claude Code clear vs compact: read the fill line of one session
By Christophe Paka · Facts checked on 23 October 2026
An hour into a session, Claude ignores a rule you gave it at the start. It edits the wrong file version. You start to think the model got dumber. Readers ask the same thing again and again: when do you use /clear, and when /compact?
Long sessions do not fail at once; they sag. Quality drops while cost climbs, because everything is resent on every turn. The Claude Code clear vs compact choice is how you manage that sag. The figure below draws the fill and the quality of one session, so you can see what each command does.

How to read this figure
Read the axes. Time runs left to right: start (CLAUDE.md loads), explore and edit, auto compaction, late session. Up is context used. The context window is everything Claude can see this turn, and the purple area is how full it is.
Follow the purple fill up. The fill starts low, with your project notes file, CLAUDE.md. It grows with every read and result, and climbs faster through explore and edit. It nearly reaches the dashed line at the top: the context limit, where auto compaction triggers.
Watch the dashed quality line. Response quality starts high on the left and drifts down as the fill rises. The model must weigh stale file versions and dead ends along with what matters.
Find the drop at auto compaction. A vertical dashed line marks it. Compaction summarizes the conversation to free space, so the fill drops sharply. Quality lifts a little. But the label says lossy: what the summary dropped stays lost. Then the fill climbs again.
Read the /clear note at the top right. It says /clear at any point resets the fill to the baseline, and costs nothing. The chart does not draw that drop; the note stands for it. A clear session starts again from the low line on the left.
Key takeaways
- Type /clear when the next task is unrelated; rename the session first if you may want it back.
- Use /compact with a focus at a natural break, such as /compact focus on the totals feature.
- Move any rule that must survive into CLAUDE.md, because a summary can drop chat instructions.
Worked example: clear, compact or keep going
The book picks between the commands by what comes next.
- The next task is unrelated: type /clear. A fresh window costs nothing, and old clutter cannot mislead the new task.
- Same task, but the window is crowded: type /compact with a focus. You keep what you name, and one full read now saves many later.
- Same task, and you are mid flow: keep going. The cache is warm, so each turn rereads at a lower rate.
- You corrected the same mistake twice: type /clear, then write a better first prompt.
Result: One task per session. Clear when a task is done, and compact only when one task runs long enough to crowd the window.
Questions readers ask
When do you use /clear vs /compact in your daily workflow?
Use /clear between unrelated tasks: it starts a fresh session at no cost, and the old one stays saved. Use /compact when one task runs long and the window is crowded. To write its summary, Claude reads the whole conversation once more, so it is cheap while the cache is warm and full price after a break.
At what threshold should I compact?
Do not wait for auto compaction near the limit. Compact by hand at a natural break, not in the middle of a step. Run /context first: it shows what fills the window, by category. The book's Claude Code guide covers the setting in its cost chapter.
Does Claude Code get dumber in long sessions?
Check the window before you blame the model. A crowded window spreads attention, and a compacted one may have lost instructions you gave only in the chat. One reader counted what was left after 60 compactions in one extreme session: 0 of 12 older decisions.
Sources: Explore the context window (Anthropic docs); Best practices (Anthropic docs); Manage costs (Anthropic docs).
This figure is from Claude Code Made Crystal Clear, chapter 2.
The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.
Get the book


