Skip to content

/compact and /clear — context-window discipline

← Tips Context discipline

/compact and /clear — context-window discipline

Don't carry irrelevant history. Use `/compact` to summarise the conversation when staying on-task, `/clear` to wipe and start fresh when switching tasks.

both

Every session has a finite . Once it’s full, Claude starts forgetting the earliest parts. Two commands keep your session healthy:

  • /compact — Claude summarises the conversation so far and continues with the condensed version. Use this when you’re still on the same task but the session has grown long. You keep the relevant context; you lose the noise.

  • /clear — wipes the conversation entirely and starts fresh. Use this when you’re switching to an unrelated task. Carrying old context into a new task makes Claude’s answers worse, not better, because it tries to relate the new task to whatever it remembers.

Rough rule: if you’re about to type “ignore everything we discussed before…”, you should have used /clear instead.

Next tip →

Correct with 'No, what I meant was…'

When Claude misunderstood, lead the correction with 'No, what I meant was…' — it's shorter than re-explaining everything and Claude takes the cue cleanly.