Three commands, three recovery shapes: /clear starts an empty-context conversation, /compact lossy-summarizes the whole conversation in place, /rewind jumps to a specific past message and lets you pick what to restore. The remembered conversation is still accessible via --resume after /clear, so “wipe” is the day-to-day effect, not the permanent one.
Side-by-side
| What it does | What survives | When to reach for it | |
|---|---|---|---|
/clear | Starts a new empty-context conversation; the previous one is retrievable via --resume | CLAUDE.md, auto memory, working directory, all files; nothing from the live conversation | Session is wandering; cheaper to re-prime than to debug |
/compact [instructions] | Replaces the whole conversation with an AI-generated summary | Summary of everything; context budget freed | Conversation has good info but is bloating context; you want to keep working |
/rewind (Restore code) | Reverts file changes from a chosen point onward; conversation untouched | Conversation history; Bash side-effects are not checkpointed and stay applied | Edit went wrong; you want Claude to know what was tried and rejected |
/rewind (Restore conversation) | Rewinds messages from a chosen point onward; code untouched | Files as they are; the chosen message’s original prompt returns to input | Conversation took a wrong turn after correct edits; want to redirect |
/rewind (Restore code + conversation) | Both, from the chosen point onward | The state captured at the selected checkpoint, not turn zero unless that is what you picked | Big swing went wrong; you want a clean retry from a specific point |
/rewind (Summarize from here) | Compresses messages from chosen point onward into a summary; the chosen prompt returns to input | Earlier messages in full; later messages compressed | Specific stretch is bloating context; the rest of the conversation is fine |
Decision tree by symptom
“Claude made an edit I do not want.”
/rewind → Restore code. Or, if Claude also went down a bad reasoning path before the edit, Restore code + conversation. The original prompt comes back to your input field so you can edit and retry.
“Conversation is fine but the latest 20 messages are bloating context.”
/rewind → Summarize from here, picking the message where things started getting long. Earlier context stays intact; only the noisy stretch compresses.
“Context is full, every turn is sluggish, but the whole conversation has good signal.”
/compact (with optional instructions: /compact Focus on code samples and the current plan). Summarizes everything; conversation continues from the summary.
“Auto-compact thrashed and I am still here.”
Run /compact to force a deeper summary, then move further reads into a subagent so noisy work stays out of parent context. If still thrashing, /clear and re-prime from a tighter prompt.
“I have been correcting the same misread for ten turns and Claude is not getting it.”
/clear. The context is now full of failed approaches; the model is anchored on them. Start fresh and bake your learning into the new prompt.
“I want to go back to the start of this task and try a different approach.”
/rewind → Restore code + conversation, picking the message that opened the task. You get the same starting state and can take a different route from there.
How they differ in one paragraph
/rewind is targeted: pick a message, choose code-only / conversation-only / both / summarize-from-there. Files restore from checkpoints captured before each edit. /compact is whole-session: summarize everything since session start; no targeting, no per-component choice. /clear is destructive: empty the conversation entirely; no recovery, no summary kept. The most recoverable to least recoverable order is /rewind → /compact → /clear.
Footguns
/rewind does not undo Bash side-effects. Checkpointing tracks Edit/Write/MultiEdit. A Bash(rm -rf node_modules) is not in the rewind log; the directory stays gone whether you rewind or not. The same for Bash(git push), Bash(npm publish), anything network or destructive. /rewind is local undo for in-session file edits; git is the only undo for everything else.
/compact is lossy. The summary keeps what the summarizer chose to keep. A specific instruction Claude followed earlier (“do not touch src/storage/”) may not survive the summary if it does not feel salient to the summarizer. Pass explicit instructions to /compact to bias what is preserved: /compact Focus on the auth module plan and the in-scope file list, drop earlier exploration. Without instructions, you are at the summarizer’s mercy.
/rewind Summarize from here is targeted; /compact is whole-session. New users use them interchangeably. The right shape: if early context (the original task brief, the architecture overview, the rules) is what matters, summarize from a later point so it stays uncompressed. Use /compact when even the early context is worth losing detail on.
/clear keeps CLAUDE.md, auto memory, and your working directory. It does not reset the project. New users sometimes worry that /clear will wipe their files; it will not. The conversation is what dies. The next session reads CLAUDE.md again and you start fresh with the same project.
External file edits do not register as checkpoints. If you edited a file in your own editor while Claude was running, that edit is not in the checkpoint log. Rewinding past that point keeps your manual edit but rewinds Claude’s edits; the result is a hybrid state that may not match what you remember. Commit your manual edits to git before relying on /rewind for recovery.
When NOT to use this
- Auto-compact has not even fired yet. Premature
/compactwastes a turn and may degrade context Claude was using. Watch/contextfirst; only compress when budget is over 70% and you still need to keep going. - You can
git stashinstead. For “I made a manual mistake in my editor”,git stashis faster than/rewind. Reserve/rewindfor changes Claude made. - The conversation is over. If the work is shipped and you are done,
/exitis the right command (it leaves the CLI; the conversation is preserved and reachable via--resume)./clearstarts a fresh empty-context conversation in the same session and is the wrong tool for “I am done for the day”. - You want exactly-once side-effects. A
/rewindfollowed by re-running the prompt may produce slightly different output. If the prior run already pushed to GitHub or charged a customer, rewinding the conversation does not undo that; the world moved on. Use/rewindfor in-progress work, not for retroactively rolling back deployments.