Clear, Compact, and Rewind
Context is the resource you manage in Claude Code.
Use session tools deliberately instead of letting every question, correction, and failed attempt stay in the same working memory.
/clear
Section titled “/clear”Use /clear between unrelated tasks.
/clearThis starts a fresh context. It is often better than dragging a previous task’s assumptions into a new one.
/compact
Section titled “/compact”Use /compact during long-running work when you want to preserve the important parts and reduce noise.
/compact Focus on modified files, decisions made, failing tests, and next steps.Add compaction preferences to CLAUDE.md if you want the same information preserved every time.
/rewind
Section titled “/rewind”Use /rewind or double Esc when a session goes down the wrong path.
Rewind can restore conversation, code, or both from a previous checkpoint. It is not a replacement for git, but it is useful while exploring.
Practical rule
Section titled “Practical rule”If you have corrected the same issue more than twice, clear or rewind. Start again with a sharper prompt that includes what you learned.