Skip to navigation

Claude Code Rewind Limits: What Checkpoints Do Not Restore

In short: Claude Code checkpoints track its file edits, not every shell side effect. Know what /rewind can recover before relying on it.

Published 17 min read
On this page

Direct answer

/rewind can restore tracked Claude Code file edits, but it is not a universal undo button. Official checkpointing does not fully cover Bash-only changes, subagent edits, external modifications, symlinks or mid-turn messages. A shell command that deletes a database, sends a request or changes a remote service needs a separate recovery plan.

Before risky work, commit or back up the state that matters, inventory external side effects and test recovery in a disposable project. Official docs state checkpoint retention of 30 days or 100 snapshots. Loss: even inside that window, the tool that made a change determines whether a checkpoint can reverse it.

Evidence map separating Claude edits, Bash commands, subagent edits and external state to show the boundary of checkpoint recovery
Editorial evidence map based on official Claude Code and Agent SDK checkpoint documentation. Coverage follows the change mechanism, not the importance of the file.

What a checkpoint actually records

A file checkpoint is a saved state for files that the product observes through supported edit tools, which means its usefulness depends on both the tool that made the change and the file type involved. It lets a developer return the worktree to an earlier point without manually reconstructing every edit from chat, but it does not wrap the whole session in a transaction or reverse external effects.

Official: Claude Code checkpointing docs say the product tracks its file edits, with retention of 30 days or 100 snapshots. The Agent SDK reference is more specific about tools: file checkpointing tracks Write, Edit and NotebookEdit modifications. This distinction matters when a change arrives through another route.

Change route Official checkpoint coverage Safe assumption
Claude Code Write or Edit Tracked as a file edit A checkpoint may restore the file if it is still available
SDK Write, Edit or NotebookEdit Tracked by SDK file checkpointing Recovery follows the documented SDK semantics
Bash command that changes a file Not fully tracked Use Git, a backup or filesystem recovery
Subagent edit Excluded from full checkpoint coverage Review the diff and keep an independent copy
External editor or process Not fully tracked The external tool owns its recovery history
Symlink or other non-regular file Excluded from SDK file checkpointing Do not rely on a regular-file checkpoint
Mid-turn message Not fully tracked Record the intended state outside the turn

The official session management guidance also describes continue, rewind, /compact and /clear. Those commands solve different problems. Continuing keeps relevant context, rewinding jumps back, compaction replaces history with a summary and clearing starts a new session with a distilled brief.

A compacted conversation is not a filesystem snapshot, because a summary can preserve the broad task while dropping the exact constraint that made a particular edit safe or unsafe during a long task under pressure. The Claude Code compaction context-retention test explains why important details can be lost when history becomes a summary. Conversely, a file checkpoint does not guarantee that every decision behind an edit survives in the conversation, so recovery should verify both the restored bytes and the current task contract before any new work resumes safely.

Recovery workflow separating a Claude edit, Bash command, subagent edit and external state before choosing a restore mechanism
Mechanism diagram based on official checkpoint coverage. It shows which recovery question to ask first and does not promise that every edit can be undone.

What checkpoints do not restore

The most expensive mistake is treating a local file feature as transaction rollback for the whole session. An agent turn can touch several systems. A checkpoint may cover one regular file while leaving a package installation, remote request or database change untouched.

Bash side effects

Bash is a general execution tool, so a single approved command can edit a tracked file, create an ignored file, install a package, remove a directory, call an API or alter a database. A command can also chain several of those effects, which makes the final visible file state a poor guide to everything that changed. The checkpoint boundary does not wrap those effects in a transaction.

Official: Claude Code docs warn that Bash-only changes are not fully tracked. The SDK reference excludes Bash commands from file checkpointing. If a command removes a file, do not assume /rewind will bring it back simply because the command happened during a Claude Code session.

The Claude Code gitignored-file deletion risks guide shows a concrete sequence where tracked ignore-rule removal exposes local paths to cleanup. A rewind might restore a supported Claude edit, yet the deleted untracked file may still be gone. Git state and checkpoint state are related but not interchangeable.

Database work needs stronger separation. The Claude Code database migration safety guide recommends distinct planning, generation, review and production apply phases. Community: issue #27063 reports an agent running a forced schema push against production. The report is not a universal bug, but it demonstrates why a database cannot depend on a file-edit checkpoint.

Subagent edits

A subagent can perform useful independent work, yet its edits sit outside full checkpoint coverage in the supplied official docs. A reviewer should not assume that rewinding the parent session restores files changed by a delegated agent.

Official: best practices recommend subagents for independent review because they have not seen the reasoning behind the code. Such independence is valuable for finding defects. It also means the parent session should not treat the subagent’s file changes as if they were ordinary edits made by the parent.

Keep a diff boundary around delegated work. Record the files the subagent was allowed to change, inspect the resulting patch and save any state that must be recoverable. The Claude Code code-review bottleneck guide explains why independent review capacity should be measured rather than assumed.

External state and external editors

An external editor, formatter, synchronization tool or another developer can change the worktree without producing a Claude checkpoint. The same applies to a remote deployment, issue tracker or hosted database.

Official: external modifications are not fully tracked. Before recovery, identify the system of record. A hosted database may offer point-in-time recovery. An editor may keep local history. A deployment platform may retain a previous release. None of those guarantees comes from /rewind.

The Claude Code outage status and failover guide is useful when the external state is a service rather than a file. Recovery begins with observed state and provider evidence, not with the last reassuring chat message.

Comparison of Claude edits, Bash commands and subagent edits, showing that supported file edits have broader checkpoint coverage than shell or delegated changes
Comparison based on official Claude Code and Agent SDK checkpoint documentation. It does not measure restoration success and does not cover external services.

Rewind, Git and backups answer different questions

Git records committed history and index state, while a checkpoint records selected file edits observed through supported tools. A backup captures a broader system at a particular time, which may include external state that neither Git nor a Claude file checkpoint can restore and that may live outside both the repository and the agent host. Choosing the wrong recovery source can turn a small mistake into a larger one, especially when the restore itself overwrites evidence that another system could still recover later during the same incident when time is limited.

Recovery source Best question it answers Main limitation
Claude file checkpoint What did this supported file look like before the edit? Does not cover every tool or external system
Git commit What tracked state did the repository record? Uncommitted and untracked work may be absent
Git stash Where did I save tracked work temporarily? Usually does not include ignored or untracked files
Editor history What did this editor buffer contain earlier? Scope and retention vary by editor
Filesystem snapshot What did this volume contain at snapshot time? Requires a snapshot that predates the loss
Database backup What database state can be restored? Needs its own restore test and recovery procedure
Handoff packet What was the task trying to do? Describes intent, not lost bytes

The Claude Code proof-of-work packet is a good place to record the recovery source. Ask for the checkpoint or commit identifier, affected paths, exact restore command and post-restore check. A statement that the file is back is weaker than a diff and a test.

Context portability helps teammates continue after a rewind. The Claude Code context-portable migration guide covers carrying decisions across sessions. Pair that packet with the Claude Code session handoff and team context format so the next person knows which edits were intentional and which were abandoned.

Do not put secrets into a recovery packet. The Claude Code settings-file secret exposure guide explains how local configuration can leak through saved rules and shared files. A sanitized path list and diff are enough for most recovery reviews.

A safe checkpoint coverage test

Run this test in a disposable repository with no production credentials, network hooks or valuable local files. It is a proposed experiment, not a benchmark result from this article.

Create a baseline commit containing four small text files: claude-edit.txt, bash-only.txt, subagent-edit.txt and external-edit.txt. Then ask Claude Code to modify only the first file with its file-edit tool. Use a separate, harmless shell action to create a new bash-created.txt. Ask a subagent to modify its assigned file, and use an external editor for the last one.

Before rewinding, record the visible state:

git status --short
git diff
git ls-files --others --exclude-standard

Those commands inventory tracked changes and ordinary untracked files. They do not replace an external backup, and they do not show every ignored path. Add an ignored-file inventory if the test includes ignored state.

Now invoke /rewind and return to the point before the edits. Inspect each file and the Git status again. Compare the observed result with the official coverage table rather than assuming all four files should match the baseline.

Expected boundary: the supported Claude file edit is the strongest candidate for checkpoint recovery. Bash-only creation, subagent modification and external modification are not covered by the same guarantee. If the product behaves differently in your version, record the version, exact tools and steps. One successful test does not establish universal coverage.

Why a passing local test can mislead

A test that modifies one file through one supported tool answers a narrow question. It says nothing about a later turn that deletes a directory through Bash, delegates an edit or changes a remote service. Expand the test only when the extra state is disposable and the expected result is written down first.

Compare bytes and Git state, not just whether a file opens. A restored file can exist with the wrong contents, while a clean status can hide an ignored file that never returned. Record both the visible diff and a separate inventory of local-only paths.

Version and configuration details belong in the result. A different client surface may expose different restore choices, and a changed permission setup can alter which tools run. Without that context, a successful test becomes folklore rather than evidence another developer can repeat.

Avoid network hooks and production credentials during the drill. The goal is to observe checkpoint behavior, not to discover whether an accidental request reached a real system, and a disposable fixture should stay disposable even when the test goes wrong.

Mobile review is another boundary. The Claude Code mobile Remote Control limits guide explains that the local process keeps running while a phone interacts with it. A phone approval does not create a checkpoint for a remote service, and it does not replace a full review of a risky diff.

The Claude Code offline-mode boundaries matter for test design. Cached transcripts and local files are not offline frontier inference. Do not build a recovery plan around a network-free model capability the supplied sources do not document.

A remote approval also leaves execution on the local machine, so recovery evidence should distinguish the approved action from the command that actually ran and from any external effect the checkpoint never observed.

A recovery checklist before the next risky turn

Recovery starts before the destructive action. The cheapest backup is often the state you deliberately save before asking an agent to change something important.

Phase Action Evidence to keep
Define Name files and external systems in scope Short task contract
Preserve Commit, stash or back up valuable state Commit, stash or backup identifier
Bound Restrict tools, paths and network access Effective permission configuration
Inventory List expected side effects Paths, services and accounts
Execute Allow only the reviewed action Exact command or tool input
Observe Check file and external state Diff, logs and read-back
Recover Choose the source that matches the change Restore record and verification
Learn Update the guardrail Rule diff and repeat test

Start with scope. Official best practices recommend prompts that name files, describe symptoms and define success. A recovery plan without a task contract cannot tell whether the restored state is the intended state.

Next, separate reversible edits from irreversible effects. Editing a regular source file may be recoverable through a checkpoint. Sending an email, deleting a database row or publishing a package needs prevention because an undo may not exist. State that limitation before execution, not after the tool returns.

Permission controls belong in the same plan. The Claude Code agent harness security boundary explains why model choice does not determine tool authority. Narrow permissions reduce the number of effects that need recovery.

Repository instructions can also push a session toward risky actions. The Claude Code repository prompt injection guide covers untrusted project text. Untrusted tool results are covered by the Claude Code MCP trust boundaries guide. Both can propose changes that the host must still authorize.

The Claude Code secrets in logs and transcripts guide matters during evidence collection. Sanitize logs and recovery notes. A backup that contains an exposed credential may preserve the incident as well as the data.

Run an external-state recovery drill

A file drill cannot prove that a service will recover. Use a disposable local database or a mock service with no production credentials, create a known baseline and make a harmless change through a shell action. Then restore from the backup that the service actually provides.

The point is not to test /rewind again. The point is to prove that the external recovery procedure works without it. Record the backup identifier, restore command, observed data and any configuration that had to change.

Drill state Recovery source Verification
Disposable local database Database-specific backup Query the expected rows after restore
Mock service configuration Saved configuration copy Start the service and compare settings
Disposable release artifact Previous stored artifact Run the artifact in an isolated directory
Local generated file Reproducible build or saved copy Rebuild and compare the expected output

Keep the drill small enough to finish. A recovery plan that requires unavailable production access is not a tested plan, and a complicated drill often hides the simple question of whether the backup can actually be read.

After recovery, remove disposable credentials and artifacts according to project policy. The Claude Code secrets in logs and transcripts guide applies to drill output too, especially when a command line or error message includes environment values.

Recovery checklist for Claude edits, Bash commands, subagent edits and external state before relying on rewind
Editorial checklist derived from official checkpoint exclusions and recovery practice. Saving state before execution remains necessary for changes the checkpoint does not cover.

The retention window is not a recovery guarantee

Official docs state retention of 30 days or 100 snapshots. Use those exact boundaries. Do not invent a longer period, and do not turn the window into a promise that a particular file can still be restored.

Snapshot count, elapsed time and change mechanism are separate constraints, so a checkpoint that still appears in the interface does not prove that every file from the same turn can be restored for a given task. A recent Bash-only deletion can be outside checkpoint coverage, while an older supported edit may fall outside retention and a subagent change may remain excluded even though the parent session has available checkpoints in the same session.

Unknown: the supplied sources do not give a universal restoration success rate, nor do they establish how every project configuration affects checkpoint availability. Test the behavior in the actual product version and keep the result as local evidence.

The SDK documentation adds another distinction: rewind restores disk content while preserving conversation history. This is an SDK semantic, not permission to assume every Claude Code surface presents identical choices. Read the restore prompt in your client and verify the resulting files.

Local storage settings are not a substitute for backups either. The official settings reference exposes transcript retention controls, but transcript cleanup and file-checkpoint retention are different mechanisms. The Claude Code privacy and retention rules provide broader context.

A custom endpoint does not expand checkpoint coverage. The Claude Code custom API base URL guide explains connection configuration, while checkpoint behavior remains a host and tool question. Measure recovery where the files actually live.

Honest loss and the practical verdict

The win is real: supported file edits can be reversed without reconstructing them by hand. This shortens recovery for ordinary coding mistakes and makes experimentation cheaper.

The loss is equally real: a checkpoint is only as broad as the tool that records it. It does not make a session transactional, restore a deleted database or guarantee recovery for a subagent, shell command or external process. The 30-day or 100-snapshot boundary also means delayed recovery cannot be assumed.

The practical verdict is to use /rewind as one recovery layer. Put commits, backups and external-system recovery beside it. After a restore, verify the diff and the external state before continuing. The Claude Code cost per verified change guide is a useful reminder that recovered work still needs acceptance.

Record what the rewind abandoned

Conversation history can preserve reasoning that no longer matches the restored files. A handoff should say which point is current, which edits were intentionally abandoned and which side effects remain unresolved. Otherwise the next session may treat an old plan as permission to recreate the discarded work.

The Claude Code session handoff and team context format provides a place for those decisions. Add the checkpoint or commit identifier, restored paths, outstanding Bash effects and the next verification command. Keep secrets and raw logs out of the packet.

Scope matters during recovery. An agent may use the rewind as an opportunity to clean up unrelated code, which turns a restore into a new change. The Claude Code overengineering and diff scope guide explains how to keep the restored state separate from new improvements.

Provenance matters as well. The Claude Code AI attribution and provenance guide helps record what changed and who reviewed it. After a rewind, note whether a recovered edit still belongs to the current task or came from an abandoned branch of the conversation.

Verdict map for Claude edits, Bash commands and subagent edits, concluding that checkpoints do not cover every session side effect
Editorial verdict from official checkpoint documentation. The retention window does not remove exclusions for Bash, subagents and external state.

Future updates should compare the official coverage table with a versioned local test. Record any changed behavior rather than silently assuming that a new release restored a missing capability.

Practical alternative: One AI API Key with an OpenAI-format agent

A separate agent can help reproduce a small recovery test or summarize a sanitized handoff, but it is not a checkpoint service. The 46 live free model IDs work through OpenAI-format agents such as OpenCode, Cline or Cursor. The quickstart covers endpoint setup, and the pricing page explains prepaid billing and the $10 signup credit without a card.

Free IDs share 100 requests and 5,000,000 tokens per day per account. Use that allowance for disposable fixtures and review summaries, not for sending production logs or secrets. Keep the authoritative backup in Git, a snapshot system or the database’s recovery service.

The documented Claude Code route remains unavailable: all four Claude IDs were marked unavailable on 2026-11-27. Free IDs are OpenAI-format only and should not be placed in Claude Code. The coding-agent compatibility guide identifies supported client patterns before you configure a key.

FAQ

Does /rewind restore files deleted through Bash?

Do not rely on it. Official docs say Bash-only changes are not fully tracked, and SDK file checkpointing excludes Bash commands. Recover through Git, editor history, a filesystem snapshot or another system that actually recorded the file.

Are subagent edits checkpointed?

The supplied official docs exclude subagent edits from full checkpoint coverage. Review delegated changes as a separate diff and preserve any state that must be recoverable before the subagent runs.

How long do checkpoints last?

Official Claude Code docs state retention of 30 days or 100 snapshots. This is a retention boundary, not a guarantee that every kind of change can be restored within it.

Is /compact the same as rewind?

No. Compaction replaces conversation history with a summary. Rewind returns to an earlier point and can restore supported file edits. A summarized conversation is not a backup of the worktree.

Can rewind undo a database migration?

No database rollback guarantee comes from file checkpointing. Use migration-specific backups, a tested restore procedure and a human-controlled production apply step.

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →