Rewind
Rewind is a must utilise mechanic introduced in Claude Code v2.0.0 that allows you to roll back both Claude's context as well as the code state to previous states, effectively undoing recent interactions and file changes.
When activated, you can select a point in your conversation history to return to, letting you explore different approaches or recover from mistakes without losing your entire session.
You activate it by pressing escape twice or through the /rewind Slash Command. The interface shows your conversation history with file diffs, letting you pick which state to revert to.
Before /rewind, I would be cautious to ensure I utilised version control to commit at milestones or before asking Claude to do a task where he is prone to error. With /rewind I still commit at milestones, but now I can utilise /rewind to rollback small erroneous actions and maintain a more refined context.
Additionally, when advising non-technical users who are somewhat intimidated by the task of learning to use version control, I now have a more digestible panacea.
Prior to Rewind
Before rewind existed, mistakes felt permanent within Claude's context. While you could use version control to rollback the code, you could not remove the erroneous instruction from Claude's context. Your options were limited:
- Start a new session and lose all the task context.
- Try to manually undo changes and explain what went wrong.
- Work from a
plan.mdfile, clear the context, then re-read the plan and continue from where you left off.
This made experimentation unnecessarily risky. You would hesitate before trying bold approaches because a wrong turn could result in a lot of wasted tokens. The recent weekly limits make this issue even worse. I personally felt the lack of a /rewind mechanism created a psychological barrier to exploration.
With Rewind
The /rewind mechanic takes the development experience to the next level by making most decisions seamlessly reversible, especially when coupled with a version control system (e.g., Git). When an approach doesn't work out or Claude misunderstands your intent, you simply rewind to before the issue occurred and try again.
The confidence this brings cannot be overstated. I now regularly:
- Explore unfamiliar libraries without fear of breaking my working environment.
- Let Claude experiment boldly knowing we can always step back if something goes wrong.
- Recover from miscommunications instantly instead of spending time explaining corrections.
The rewind interface is elegant. Each conversation turn shows what happened, making it easy to identify exactly where things went sideways.
How Rewind Works
When /rewind is activated (double escape or /rewind command), Claude Code displays the interface with the prompt: Restore the code and/or conversation to the point before…
Your conversation history appears as a list of turns, with each turn showing:
- Your message - What you asked Claude to do (truncated for readability).
- File changes - Git-style diff notation showing modifications (e.g.,
sidebars.js +1 -0).
You select a conversation turn to restore to the point before that turn. Claude Code then:
- Restores code state - Any file edits, writes, or deletions Claude made after that point are undone
- Restores conversation context - The conversation history is trimmed to your selected point
- Preserves earlier state - Everything before your selected point remains intact
This dual restoration creates a clean slate from your chosen point forward, letting you take a different path while keeping all the valuable context and work that came before.
Best Practices and Limitations
When to Rewind:
- After a misunderstanding escalates through multiple turns.
- When an implementation approach proves unworkable.
- After accidental destructive changes.
Rewind Limitations:
- Cannot undo external changes - Commands run via bash that affect systems outside your project (like git push, npm publish, database changes) cannot be reverted.
- File system state - Rewind reverts Claude Code's file operations, but manual changes you made outside Claude Code remain.
- Network operations - API calls, database queries, and other external operations cannot be undone.
- Time-based operations - If your code interacted with time-sensitive services, rewinding won't reset external state.
For high-stakes operations, use Plan Mode first to review what will happen, then proceed knowing you can rewind if needed. This creates multiple layers of safety.
This mechanic can be utilised as a means of curing poisoned contexts whilst you are experimenting with Claude Code.
See Also: Plan Mode|Poison Context Awareness


