Understanding Checkpoints and Rewind Functionality in Claude Code: A Complete Guide

Claude Code provides an automatic checkpoint system that snapshots your entire development session—messages, file edits, tool usage, and context—every time you send a prompt, allowing you to safely backtrack or restore specific states using the Esc+Esc shortcut or /rewind command.

The checkpoint and rewind functionality in Claude Code is documented in the luongnv89/claude-howto repository, specifically within the 08-checkpoints/README.md file. This system enables fearless experimentation by continuously preserving your work state, ensuring you can always return to a previous configuration if an approach fails or you need to compare alternative solutions.

How Checkpoints Work in Claude Code

Claude Code implements an automatic checkpoint system that operates transparently in the background, requiring no manual intervention to save your progress.

Automatic Snapshot Creation

Every time you submit a prompt to Claude Code, the system automatically creates a new checkpoint. According to the source documentation in 08-checkpoints/README.md (lines 60‑61), this ensures that your complete session state is preserved at each interaction point. You do not need to remember to save manually—the checkpoint is generated immediately upon sending your message.

Checkpoint Persistence and Lifecycle

Checkpoints are designed for cross-session durability. As noted in the repository (lines 62‑63), these snapshots survive even if you close and reopen Claude Code. However, they are not permanent storage: the system automatically purges checkpoints after 30 days. This retention policy balances convenience with storage efficiency, keeping recent history accessible while preventing indefinite accumulation of session data.

What Gets Captured in a Checkpoint

Each checkpoint stores a comprehensive snapshot of your development environment. As detailed in the Overview section of 08-checkpoints/README.md (lines 12‑16), the captured data includes:

  • All exchanged messages between you and Claude
  • All file modifications made up to that point in the session
  • Tool‑usage history, including searches, command executions, and other tool invocations
  • Session context, encompassing variables, settings, and environmental state

This complete capture ensures that rewinding restores not just your code, but the entire conversational and operational context that led to that state.

Accessing and Rewinding Checkpoints

Claude Code provides two primary methods for accessing the checkpoint browser and initiating rewind operations.

Keyboard Shortcuts and Commands

You can open the checkpoint browser using either:

  1. Keyboard shortcut: Press Esc followed immediately by Esc again (documented in lines 32‑34 of 08-checkpoints/README.md)
  2. Slash command: Type /rewind or its alias /checkpoint in the chat input (lines 35‑44)

Both methods launch the interactive checkpoint browser, displaying a chronological list of available snapshots with timestamps and context summaries.

The Five Rewind Menu Options

When you select a checkpoint from the browser, Claude Code presents the Rewind menu with five distinct restoration actions (lines 48‑54):

  1. Restore code & conversation – Reverts both your file system changes and chat history to the selected point, effectively transporting you back to that exact moment in the session.

  2. Restore conversation – Rolls back the message history while preserving all current file modifications. This is useful when you want to discuss a different approach without losing implemented code changes.

  3. Restore code – Reverts file changes to the checkpoint state while maintaining your current conversation flow. Ideal for undoing specific edits while keeping the context of your recent discussion.

  4. Summarize from here – Compresses all messages after the selected checkpoint into an AI‑generated summary, preserving the original transcript in a condensed form. You can provide an optional focus prompt, such as "Summarize the discussion about caching strategies."

  5. Never mind – Cancels the rewind operation and returns you to the current session state without making any changes.

Practical Workflow Patterns

The checkpoint system supports several advanced development workflows that leverage the ability to branch and compare different approaches safely.

Branch-Point Exploration

This pattern allows you to explore multiple solution paths from a common starting point. As illustrated in the Branching Strategy section (lines 66‑73), the workflow proceeds as follows:

  1. Establish a stable starting state (Checkpoint A)
  2. Develop Approach 1, creating Checkpoint B
  3. Rewind to Checkpoint A
  4. Develop Approach 2, creating Checkpoint C
  5. Compare outcomes by examining Checkpoint B versus Checkpoint C

This technique prevents the "dead end" problem where exploring one solution permanently alters your codebase before you can evaluate alternatives.

Safe Refactoring with Automatic Backups

For high-risk code modifications, checkpoints provide a safety net superior to traditional undo operations (lines 79‑88):

  1. Current state is automatically checkpointed when you submit your refactoring request
  2. Execute the refactoring and run tests
  3. If tests fail or behavior regresses, use Restore code & conversation to return to the pre-refactoring state
  4. Attempt a different refactoring strategy without manual file restoration

This pattern eliminates the risk of refactoring experiments corrupting your working directory.

A/B Testing Alternative Solutions

You can use checkpoints to conduct structured comparisons between different implementation strategies (lines 138‑150):

  1. Create a checkpoint labeled "Start"
  2. Implement and test Design A, creating Checkpoint B
  3. Rewind to "Start"
  4. Implement and test Design B
  5. Evaluate both outcomes side-by-side using the checkpoint browser

This method provides empirical evidence for architectural decisions by preserving both alternatives in their complete contexts.

Configuration and Limitations

While checkpoints operate automatically by default, you can customize their behavior and should understand their boundaries relative to version control systems.

Disabling Automatic Checkpoints

Automatic checkpoint creation can be toggled via user settings. According to the configuration example in 08-checkpoints/README.md (lines 12‑16), set the autoCheckpoint parameter to false in your settings JSON:

{
  "autoCheckpoint": false
}

The default value is true, ensuring maximum safety for most users.

Limitations and Git Integration

Checkpoints have specific limitations that dictate when to use Git instead. As documented in the Limitations section (lines 24‑26), filesystem commands executed outside Claude Code—such as manual rm, mv, or external editor operations—are not tracked by the checkpoint system.

Additionally, the documentation emphasizes (lines 48‑58) that checkpoints serve as short‑term safety nets, not replacements for version control. For permanent history and collaborative workflows, you should commit stable checkpoints to Git:


# After restoring a checkpoint you wish to preserve

git add .
git commit -m "Preserve checkpoint: implemented caching layer"

Summary

  • Automatic creation: Claude Code generates a checkpoint every time you send a prompt, capturing messages, file edits, tool history, and session context.
  • Access methods: Use Esc+Esc or the /rewind (alias /checkpoint) command to open the checkpoint browser.
  • Restoration options: Choose between restoring code only, conversation only, both, or summarizing from a specific point.
  • Retention: Checkpoints persist across sessions for 30 days before automatic purging.
  • Configuration: Toggle autoCheckpoint in settings to disable automatic creation if desired.
  • Best practice: Treat checkpoints as temporary safety nets; integrate with Git for permanent version history, and note that external filesystem commands are not tracked.

Frequently Asked Questions

How do I open the checkpoint browser in Claude Code?

You can open the checkpoint browser using two methods: press the Esc key twice in succession (Esc+Esc), or type /rewind (or its alias /checkpoint) in the chat input field. Both methods are documented in 08-checkpoints/README.md (lines 32‑44) and will display the interactive checkpoint selection interface.

What is the difference between restoring code and restoring conversation?

Restore code reverts all file modifications to the state captured in the selected checkpoint while preserving your current chat messages and context. Restore conversation rolls back the message history to the checkpoint moment but leaves your current file system untouched. Restore code & conversation performs both operations simultaneously, effectively transporting you back to that exact historical moment (lines 48‑54).

How long are checkpoints stored in Claude Code?

Checkpoints are retained for 30 days from their creation date. They survive across application restarts and system reboots, but are automatically purged by the system after the 30‑day retention period expires (lines 62‑63). This makes them suitable for short‑term experimentation and recovery, but unsuitable for long‑term archival.

Can I disable automatic checkpoints?

Yes, you can disable automatic checkpoint creation by setting "autoCheckpoint": false in your Claude Code user settings JSON, as shown in the configuration example (lines 12‑16). When disabled, you must rely on manual version control practices or the undo functionality within your editor, losing the ability to rewind to arbitrary points in your conversation history.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →