Skip to main content
commandsSource-backedReview first Safety Privacy

Restore Code and Chat in Claude Code with /rewind

Use Claude Code's built-in checkpointing: run /rewind or press Esc twice to restore code, conversation, or both to an earlier point in a session, and summarize parts of the chat.

by JSONbored·added 2025-10-25·
HarnessClaude Code
Invocation:/rewind
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://code.claude.com/docs/en/checkpointing, https://github.com/JSONbored/awesome-claude/blob/main/content/commands/checkpoint-manager.mdx
Safety notes
Restore actions are destructive to working-tree state: Restore code and Restore code and conversation revert file edits made through Claude's tools, discarding uncommitted changes since the selected prompt. Confirm you have committed anything you want to keep before restoring., Checkpoints do not undo bash command side effects (deleted/moved/copied files, directories created by the shell) or database/external changes. After a rewind you may need to clean those up manually., Checkpoints are session-level recovery, not a backup. They are auto-deleted with their session after 30 days by default (cleanupPeriodDays). Use Git for anything you need to keep.
Privacy notes
Checkpoints and the summarize feature store your code state and conversation history locally as part of the session transcript, including messages that were replaced by a summary. These persist across resumed sessions until cleaned up (default 30 days).
Author
JSONbored
Claim status
unclaimed
Last verified
2025-10-25

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Copy & paste

Copy-ready — paste the snippet to get started.

Install command

Not provided

Config snippet

Not provided

Copy snippet

Provided

Prerequisites

None

Platforms

1 listed

Difficulty

100/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Safety & privacy surface

Safety & privacy surface

3 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens.

2 areas
  • SafetyLocal filesRestore actions are destructive to working-tree state: Restore code and Restore code and conversation revert file edits made through Claude's tools, discarding uncommitted changes since the selected prompt. Confirm you have committed anything you want to keep before restoring.
  • SafetyLocal filesCheckpoints do not undo bash command side effects (deleted/moved/copied files, directories created by the shell) or database/external changes. After a rewind you may need to clean those up manually.
  • SafetyCredentials & tokensCheckpoints are session-level recovery, not a backup. They are auto-deleted with their session after 30 days by default (cleanupPeriodDays). Use Git for anything you need to keep.
  • PrivacyCredentials & tokensCheckpoints and the summarize feature store your code state and conversation history locally as part of the session transcript, including messages that were replaced by a summary. These persist across resumed sessions until cleaned up (default 30 days).

Safety notes

  • Restore actions are destructive to working-tree state: Restore code and Restore code and conversation revert file edits made through Claude's tools, discarding uncommitted changes since the selected prompt. Confirm you have committed anything you want to keep before restoring.
  • Checkpoints do not undo bash command side effects (deleted/moved/copied files, directories created by the shell) or database/external changes. After a rewind you may need to clean those up manually.
  • Checkpoints are session-level recovery, not a backup. They are auto-deleted with their session after 30 days by default (cleanupPeriodDays). Use Git for anything you need to keep.

Privacy notes

  • Checkpoints and the summarize feature store your code state and conversation history locally as part of the session transcript, including messages that were replaced by a summary. These persist across resumed sessions until cleaned up (default 30 days).

Schema details

Install type
copy
Reading time
8 min
Difficulty score
100
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://code.claude.com/docs/en/checkpointinghttps://code.claude.com/docs/en/interactive-modehttps://code.claude.com/docs/en/commands
Runtime and command metadata
Command syntax
/rewind
Full copyable content
/rewind

About this resource

Claude Code has built-in checkpointing: it automatically captures the state of your code before Claude's edits, so you can rewind to a previous state if a task goes off track. You open this with the built-in /rewind command, or by pressing Esc twice while the prompt input is empty.

This is a built-in Claude Code feature, not a separate plugin. Checkpointing is automatic, and you interact with it entirely through the /rewind menu (or by pressing Esc twice).

How checkpoints work

  • Automatic capture: every prompt you send creates a new checkpoint of your code before Claude's file edits.
  • Persists across sessions: checkpoints are available again in resumed conversations, not just the current run.
  • Automatic cleanup: checkpoints are cleaned up along with their sessions after 30 days by default. This retention is governed by the standard session cleanupPeriodDays setting, not a separate checkpoint config file.

Checkpoints are created automatically as you work — checkpointing is tied to your prompts rather than to a manual create step or a configurable interval.

Opening the rewind menu

/rewind

Or, with an empty prompt input, press Esc twice.

If the prompt input contains text, pressing Esc twice clears the text instead of opening the menu. The cleared text is saved to your input history, so press Up to recall it after you finish in the rewind menu.

The menu lists each prompt you sent during the session. Select a point, then choose an action.

Rewind menu actions

For the selected message you can choose:

  • Restore code and conversation — revert both code and conversation to that point.
  • Restore conversation — rewind to that message while keeping current code.
  • Restore code — revert file changes while keeping the conversation.
  • Summarize from here — replace the selected message and everything after it with an AI-generated summary (keeps earlier context in full detail).
  • Summarize up to here — replace the messages before the selected message with a summary, keeping the selected message and later ones intact.
  • Never mind — return to the message list without changes.

After restoring the conversation or choosing Summarize from here, the original prompt from the selected message is restored into the input field so you can re-send or edit it.

Restore vs. summarize

The restore options change state on disk and in history: they undo code changes, conversation history, or both.

The summarize options do not change files on disk — they compress one side of the conversation into a summary to free up context window space. The original messages are preserved in the session transcript, so Claude can still reference them. You can type optional instructions to guide what the summary focuses on. This is like /compact, but targeted to one side of the selected message rather than the whole conversation.

If you instead want to branch off and try a different approach while keeping the original session intact, use session forking (claude --continue --fork-session) rather than rewind.

When to use it

  • Exploring alternatives: try a different implementation approach without losing your starting point, then restore code if it doesn't pan out.
  • Recovering from mistakes: a refactor introduced a bug across several files — open /rewind, pick the prompt before the refactor, and choose Restore code.
  • Iterating on a feature: experiment with variations knowing you can revert to a working state.
  • Freeing context space: in a long debugging session, use Summarize from here to compress a verbose side-discussion while keeping your initial instructions in full detail.

Example: undo a bad refactor, keep the discussion

You: Refactor the payment service to use async/await
Claude: (edits several files)

You: The payment flow is broken now.
You: /rewind
   -> select the prompt before the refactor
   -> choose "Restore code"

Your files revert to the pre-refactor state while the conversation (including what went wrong) stays intact, so Claude can try a different approach with that context.

Limitations

Checkpointing is a session-level safety net, not full version control. Be aware of what it does not track:

  • Bash command changes are not tracked. Files modified by shell commands Claude runs (for example rm file.txt, mv old.txt new.txt, cp source.txt dest.txt) cannot be undone through rewind. Only direct edits made through Claude's file-editing tools are tracked.
  • External changes are not tracked. Manual edits you make outside Claude Code, and edits from other concurrent sessions, are normally not captured — unless they happen to touch the same files as the current session.
  • It is not a replacement for Git. Keep using version control for commits, branches, and long-term history. Think of checkpoints as "local undo" and Git as "permanent history."

See also

Source citations

Add this badge to your README

Show that Restore Code and Chat in Claude Code with /rewind is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/commands/checkpoint-manager.svg)](https://heyclau.de/entry/commands/checkpoint-manager)

How it compares

Restore Code and Chat in Claude Code with /rewind side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

2 trust signals differ across this comparison (Source provenance, Submitter).

Field

Use Claude Code's built-in checkpointing: run /rewind or press Esc twice to restore code, conversation, or both to an earlier point in a session, and summarize parts of the chat.

Open dossier

Expert Claude Code checkpoint recovery capability pack for auditing automatic edit tracking, choosing restore versus summarize actions in /rewind, and recovering from bad turns without losing git history.

Open dossier

A release-manager workflow collection for shipping versions safely: draft release notes from Conventional Commits, govern commits, triage red CI, checkpoint risky changes, and generate changelog artifacts before tagging.

Open dossier

A practical walkthrough of Claude Code checkpointing: how automatic checkpoints capture code before each edit, how to rewind and summarize with /rewind, the difference between restore and summarize, and the limitations you must know before a risky refactor.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceDiffersSource-backedSubmission linkedSource submissionSubmission linkedSource submissionSource-backed
SubmitterDifferskiannidevkiannidevJPette1783
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Brand
Categorycommandsskillscollectionsguides
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorJSONboredkiannidevkiannidevJPette1783
Added2025-10-252026-06-132026-06-162026-06-05
Platforms
Claude Code
Claude CodeCodexWindsurfGeminiCursorCLI
Claude Code
Claude Code
Source repo
Safety notesRestore actions are destructive to working-tree state: Restore code and Restore code and conversation revert file edits made through Claude's tools, discarding uncommitted changes since the selected prompt. Confirm you have committed anything you want to keep before restoring. Checkpoints do not undo bash command side effects (deleted/moved/copied files, directories created by the shell) or database/external changes. After a rewind you may need to clean those up manually. Checkpoints are session-level recovery, not a backup. They are auto-deleted with their session after 30 days by default (cleanupPeriodDays). Use Git for anything you need to keep.This skill recommends checkpoint actions; it must not run `/rewind` restore or summarize without explicit user approval. Restore code and conversation reverts both files and chat history to a prior prompt; confirm the target checkpoint before acting. Restore code alone keeps conversation but reverts file edits; restore conversation alone keeps current files but rewinds chat. Summarize compresses conversation segments without changing files on disk; it is not a substitute for git revert when bash commands modified files. Checkpointing does not track files changed by bash commands such as `rm`, `mv`, or `cp`; use git or manual recovery for those paths.Release automation proposes notes and bumps—humans must approve tags and publishes. CI triage reads workflow logs; treat log content as untrusted input. Review each linked entry's safety notes before enabling hooks or skills.Checkpoints only track files edited through Claude's file-editing tools; changes made by bash commands (rm, mv, cp) are NOT tracked and cannot be undone via rewind. External or concurrent-session edits are generally not captured unless they touch the same files; do not rely on checkpoints for those. Checkpoints are session-level local undo, not version control; commit to Git before and after risky work for permanent history.
Privacy notesCheckpoints and the summarize feature store your code state and conversation history locally as part of the session transcript, including messages that were replaced by a summary. These persist across resumed sessions until cleaned up (default 30 days).The /rewind menu lists every user prompt in the session, which may expose internal task names, credentials pasted in prompts, or customer context. Restored prompts reappear in the input field and may contain sensitive instructions that should be redacted before sharing screens. Session transcripts persist with checkpoints for up to 30 days by default; treat resumed sessions as containing prior sensitive content. Public support notes should describe the recovery lane and checkpoint choice, not full prompt text or complete file diffs.Release notes commands include commit messages in model context—scrub sensitive subjects. Workflow completion hooks may echo branch names and paths in notifications.Checkpoints and session state are stored locally and cleaned up with the session after 30 days by default. Restoring or summarizing changes session state locally; it does not transmit anything beyond the normal model requests. Summaries are AI-generated from your conversation; the original messages remain in the local transcript.
Prerequisites— none listed
  • An active or resumable Claude Code session where checkpoint recovery is needed.
  • Permission to run `/rewind` or use double-Esc when the prompt input is empty.
  • Awareness of whether problematic changes came from Claude file tools, bash commands, or manual edits outside the session.
  • Git or other version control available when permanent history or collaboration rollback is required.
  • Git repository with tags and GitHub Actions visible to authenticated gh CLI.
  • Claude Code with hooks enabled for workflow completion reporting.
  • Team agreement on Conventional Commits and SemVer bump rules.
  • Claude Code installed and a session where Claude makes edits with its file-editing tools.
  • A working understanding that checkpoints complement, not replace, Git.
  • Optional: configured cleanupPeriodDays if you want to change the 30-day retention.
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.