ai for designers

/rewind Command

The `/rewind` command in Claude Code is your personal undo button for an AI session. Think of it as a version control system specifically for your ongoing conversation and code state. When you invoke `/rewind`, Claude Code presents you with a list of previous checkpoints, allowing you to roll back the entire session to an earlier, stable point. This includes not just the conversation history, but also any code modifications Claude has made or that you have introduced within the session. It effectively restores the conversation and code to how they were at that chosen checkpoint. This command also goes by the aliases `/checkpoint` and `/undo`, making its purpose clear: to recover from missteps, explore alternative paths, or simply revert to a known good state. You can choose to restore the conversation, the code, or both, and even specify a particular message to summarize from, giving you fine-grained control over your recovery.

`/rewind` is not `/clear`. While both commands alter your active session, `/clear` is about starting a completely fresh, empty conversation window, effectively abandoning the current thread to begin a new one. `/rewind`, by contrast, keeps you within the same session but transports you back in time to an earlier moment within that session's history. It is also distinct from `/compact`. `/compact` is a forward-looking action, summarizing the existing conversation to free up tokens and continue the current thread from a condensed baseline. `/rewind` is a backward-looking action, reverting to a prior state. Furthermore, `/rewind` does not permanently delete any history; it merely changes the active head of your session's timeline. The states you rewind past are still part of the session's history, accessible if you choose to rewind further. It is not a magic fix for fundamentally flawed project goals or poor initial problem framing; it is a tactical recovery tool for process errors, not conceptual ones. You cannot `/rewind` to an an entirely different past session; for that, you would use `/resume`.

Imagine you are a lead developer, say, Dr. Anya Sharma, working at "Quantum Leap Labs" in late 2023. Your task is to integrate a new quantum encryption library into an existing C++ codebase. You're using Claude Code to help with the complex API mappings. You instruct Claude to "refactor the `EncryptionService` to use `QuantumCipher::encrypt`." After several turns, Claude makes a series of changes, but you realize it has introduced a subtle memory leak in a critical path, and the unit tests are failing intermittently. You've gone too far down a problematic path. Instead of manually undoing lines of code or starting the entire integration from scratch with `/clear`, you type `/rewind`. Claude presents a list of recent session states: "Initial API mapping," "After `QuantumCipher` import," "Before `EncryptionService` refactor." You select "Before `EncryptionService` refactor." Instantly, your conversation history reverts to that point, and the code in your active files is restored to its state before Claude made the problematic refactoring attempts. You can then try a different approach, perhaps by first asking Claude to "generate a detailed plan for `EncryptionService` refactoring, focusing on memory safety" before allowing it to touch the code. This saves hours of debugging and manual rollback. Another scenario: a UX designer, Ben Carter at "Synergy Solutions" in 2024, is prototyping a new user flow. He asks Claude Code to "generate a React component for a multi-step form." After a few iterations, Claude produces a component that is overly complex and uses an outdated state management pattern. Ben realizes he should have specified "use React Hooks and keep it modular." He types `/rewind`, selects the checkpoint "After initial form component request," and then re-prompts Claude with clearer, more modern requirements.

You should reach for `/rewind` whenever your current AI interaction has veered off course. This is your go-to command when Claude hallucinates, misinterprets your instructions, or when you realize your own prompt led to an undesirable outcome. If you've accidentally deleted or modified code within Claude Code and need to quickly restore a previous version, `/rewind` is faster than manual recovery. It is invaluable for exploring alternative solutions: you can rewind, try a different approach, and if it doesn't pan out, rewind again to your original decision point without losing progress. It is also a powerful tool for recovering from an auto-compact that inadvertently summarized away a critical detail you suddenly need. For instance, if Claude Code's automatic compaction removed specific error logs that you now need to debug, `/rewind` can get them back. However, `/rewind` is not for every situation. Do not use it when you are finished with a task and want to begin an entirely new, unrelated one; that is the domain of `/clear`. Similarly, if your goal is to condense the current conversation to free up tokens and continue *forward* from a summarized state, then `/compact` is the correct choice. `/rewind` is a recovery mechanism, not a token management strategy. It also should not be seen as a substitute for careful, precise prompting. While it provides a safety net, relying on it constantly to fix poorly thought-out instructions will slow down your workflow. Finally, if you need to bring back an entirely different, previously completed session, the `/resume` command is what you are looking for, as `/rewind` operates within the bounds of your current session's history.

`/rewind` is your AI session's time machine, letting you instantly undo mistakes and explore alternate realities without ever losing your way.

Related terms

Keep exploring