Skip to content

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.

Use /clear between unrelated tasks.

Terminal window
/clear

This starts a fresh context. It is often better than dragging a previous task’s assumptions into a new one.

Use /compact during long-running work when you want to preserve the important parts and reduce noise.

Terminal window
/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.

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.

If you have corrected the same issue more than twice, clear or rewind. Start again with a sharper prompt that includes what you learned.