Files
claude-howto/08-checkpoints
Luong NGUYEN b5548c6b9f docs: sync to Claude Code v2.1.322 (#247)
Type: docs

Syncs the tutorial, its translations and root docs to **Claude Code 2.1.322** (previous sync: v2.1.316, #230). The audit covered every changelog entry for 2.1.317, 2.1.318, 2.1.319, 2.1.321 and 2.1.322, plus the official docs pages for each affected feature. npm `latest` is 2.1.322.

49 files changed (46 in the sync commit, plus `fa/` and `ko/03-skills` in review round 1 and `ko/claude_concepts_guide.md` in round 3). P0 0 · P1 15 · P2 6 (deferred) · P3 30 + 1 blocked · P4 3.

## P1: outdated claims (mirrored to translations)

- **Fable 5.2 (v2.1.321).** The `10-cli` model table gains a Fable 5.2 row (1M context, default effort `medium`), and Fable 5.1 becomes the previous model.
  - The Fable alias note now says `fable` resolves to Fable 5.2 (Fable 5 in Claude apps gateway sessions).
  - `best` now resolves to the same model as `opus`.
  - A saved `claude-fable-5-1` pick moves to `fable` on Pro/Max/Ultra, and on Team/Enterprise when the organization's settings allow.
  - Pricing: $8/$40 per Mtok, with $0.20 per Mtok cache reads.
  - The FAQ and QUICK_REFERENCE model lists name Fable 5.2.
- **Fast mode on Fable 5.2 (v2.1.321, $16/$80):** added to `/fast` in `01-slash-commands`, CATALOG, the `10-cli` fast-mode note and the `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE` row.
- **`ultrathink`** now lists Fable 5.2 in `09`, `10-cli` and `claude_concepts_guide`.
- **Scheduled tasks (`09`)**:
  - Recurring tasks expire after 7 days, not 3.
  - Tasks are restored on `--resume`/`--continue`, except expired tasks, past-due one-shots and a self-paced `/loop`.
  - Recurring jitter is "up to half the gap, at most 30 min" (`*/5` isn't delayed).
  - One-shots scheduled for `:00`/`:30` run up to 90 s early.
- **Subagent and teammate effort (v2.1.317):** on a different model they use that model's saved effort or its default, not the session's (`04-subagents`, `10-cli`).
- **`switchModelsOnFlag` (v2.1.318):** subagents never pause. With "Ask each time", a flagged subagent request fails instead of switching models.
- **Background commands:** the default limit is 10 minutes in a `-p` run whose prompt is passed as text (the fix is in v2.1.321).
- **Mods Claude writes (v2.1.321):** in `auto`/`bypassPermissions` they turn on without asking. They don't load in `dontAsk` or in `-p` outside those modes.

## P3: additions (English only)

- **`01-slash-commands`:**
  - `/model` "More models" row (v2.1.319/321).
  - `/context` sends Claude only the table.
  - `/ide` no longer installs the extension from an IDE terminal (v2.1.318).
  - `/tasks` "Earlier in this session".
  - `/claude-api latency-optimize`, also added in `03-skills`, CATALOG and the concepts guide.
- **`03-skills`:** two new limits on nested-skill loading: under the Bash sandbox (v2.1.319), and `.claude/skills` inside `~/.claude/plugins` (v2.1.321). The skills docs page doesn't list these exceptions yet; the source is the changelog.
- **`04-subagents`:** background subagents move a shell command to the background after 3 min, and `SendMessage` reaches a busy background agent sooner.
- **`06-hooks`:**
  - Agent SDK `onFailure: "block"` / `on_failure="block"`.
  - An `mcp_tool` hook refuses the call when it can't read the answer (>16 MiB).
  - `defer` works only with a single tool call; `tool_deferred_unavailable` and `CLAUDE_CODE_DROP_UNAVAILABLE_DEFERRED_TOOL`.
  - PostToolUse runs after a `Ctrl+Enter` interrupt (10 s).
- **`07-plugins`:**
  - `$.model.fork` `effort` and `prompt.submit` in the user turn.
  - `${CLAUDE_PLUGIN_ROOT}` in `subagentStatusLine`.
  - Plugin updates install new dependencies.
  - Managed `extraKnownMarketplaces` take-over rules.
- **`08-checkpoints`:** `/rewind` after `/branch` (fixed in v2.1.319).
- **`09-advanced-features`:**
  - `/tasks` row.
  - Background command notifications show only the start and end of a command over 1,000 characters.
  - `claude remote-control --settings <file>`, and sessions keep their folder.
  - OTel `anthropic.plan`, `anthropic.seat_type`, `anthropic.provider`, `anthropic.custom_base_url`.
  - Three v2.1.319 trust-hardening items.
  - Auto-mode `-p` exits 1 when no safety check was available.
  - Monitor WebSocket watches follow Bash rules.
- **`10-cli`:**
  - Fast mode on Google Cloud's Agent Platform: Fable 5.2 only, regions `global`/`us`/`eu`, v2.1.322.
  - `claude auth status` `loginExpiresAt`.
  - `claude -p` `credential_expires_at` and the 10-day stderr warning.
  - Bash permission hardening: `which` with flags, `timeout` wrappers, exact ask vs. broader deny, `cp`/`mv` by path.
  - Agent view `--agent` dispatch default.
  - `MCP_PROTOCOL_NEGOTIATION` 7-day skip.
  - New rows for `CLAUDE_CODE_DISABLE_FEATURE_FLAGS`, `CLAUDE_CODE_DISABLE_NESTED_SESSION_ID` and `permissions.denyInsteadOfPrompting`.

## P4: cosmetic

- Root `README.md`: the version badge, "latest" line and "Current version" line now say v2.1.322 / November 2026.
- `10-cli`: the resume hint repeats launch flags (v2.1.317).
- `08-checkpoints`: directory symlinks are no longer followed by rewind (v2.1.319).

Every file the sync commit changed has a refreshed footer: November 12, 2026 and 2.1.322, with localized labels and dates in translations. `fa/03-skills` and `ko/03-skills` got only the S1 `effort` row fix in round 1, and their footers were left as they were (2.1.316 and 2.1.310), because the rest of those files was not synced to 2.1.322. For the same reason, `ko/claude_concepts_guide.md` got only the round-3 Fable rows and keeps its 2.1.310 footer.

## Translation coverage

- **vi, ko, fa:** carry every P1 change whose text exists in that locale.
- **ja, uk:** carry the P1 changes to the sections they have: `ultrathink`, scheduled tasks, the `effort` row and QUICK_REFERENCE; the README FAQ in ja and uk.
- **zh:** condensed. Only the stale model lists were fixed (README FAQ, QUICK_REFERENCE). zh has no model table, fast-mode note, scheduled-tasks section or `effort` row.
- **`vi/README.md`:** has no FAQ, so Task 2.9 had nothing to change there.
- **ko is partly stale from before this run.** Its module footers were still at 2.1.310, and some 2.1.316 content is missing, such as the `CLAUDE_CODE_SUBAGENT_EFFORT` sentence and `env` row. This PR adds the 2.1.322 P1 changes but does not backfill 2.1.316.
- **Locale README stamps:** the ko and fa READMEs still show v2.1.310 in their badge and "latest" lines. Each locale tracks its own sync state, so they were left as they are.
- **P3 additions are English only.**

## Review round 1 fixes (`docs: address review of v2.1.322 sync`)

Each change was checked again against model-config, env-vars, skills or the raw changelog before it was written.

- **S1:** the `03-skills` `effort` row and the `01` `/effort` row now list Fable 5.2, and give it a `medium` default. The `/effort` row also gives `high` for Fable 5.1 and Fable 5 (model-config: "Fable 5.2, Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`… Other models in the effort levels table default to `high`"). Also changed in fa and ko.
- **S2:** `09` `remote-control --settings`: "If the file changes, no new session starts until you restart `claude remote-control`" (CL 2.1.321). English only.
- **S3:** the `10-cli` `claude agents` note now names the five flags from CL 2.1.321. English only.
- **S4:** the `03-skills` nested-skill exceptions are now attributed to the changelog in the text: "The changelog adds two exceptions that the skills docs don't list yet". English only.
- **S5:** the `CLAUDE_CODE_DISABLE_FEATURE_FLAGS` row now says that with the variable set, Remote Control and the other features that need feature-flag fetching are unavailable (env-vars). English only.
- **S7:** wrong effort claims removed from sentences this PR rewrote:
  - `ja/09` and `uk/09` now translate the English effort-level, `xhigh` and default lists.
  - In `ja/10-cli` and `uk/10-cli`, the false "`max` is exclusive to Opus 4.x" clause is dropped. The English sentence has no such clause.
- **N1:** "from v2.1.257 until v2.1.321" in `10-cli`, fa, ko and vi.
- **N2:** the `/context` row now says the 10-row limit applies to the table Claude reads. No locale has this row text.
- **N4:** the Fable models were added to the `09` effort-level, `xhigh` and default lists in en, fa, ko and vi (ja and uk via S7). In `claude_concepts_guide`, Fable 5.2, 5.1 and 5 rows were added to the model/effort table, and the Fable models to its `xhigh`/`max` note, in en and fa.
- **N5:** the `CLAUDE_CODE_SUBAGENT_EFFORT` row now says only what CL 2.1.317 says: a subagent on a different model from the main conversation uses that model's saved effort level or its default, instead of the session's. The old wording said such a subagent "never inherits". How the variable ranks against that rule isn't stated by any source. Also changed in fa and vi; ko has no row.
- **N8:** "where Fable is available" was restored to the pre-v2.1.321 `best` behaviour, in en, fa, ko and vi.

## Review round 2 fixes (`docs: add Fable models to the effort-level bullet in 09`)

- Added the Fable models to the `09` "Opus 5 / Opus 4.8" effort bullet (en, fa, ko, vi): Fable 5.2 defaults to `medium`, Fable 5.1 and Fable 5 to `high`, and all of them support `xhigh` and `max`.
- Added the Fable models to the en `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row.

## Review round 3 fixes (`docs: align model and effort lists with model-config (v2.1.322 sync)`)

The model and effort lists changed in this round now match model-config.md (effort table, default-effort rule and 1M list, re-fetched before editing). The lists still behind are under Follow-ups.

- **en (R2-S1):** the Fable models were added to the remaining `09` effort lists (the "Effort level" heading line and three `CLAUDE_CODE_EFFORT_LEVEL` code comments) and to the `10-cli` "Effort Levels" paragraph and its code comment. The paragraph now gives Fable 5.2 a `medium` default, matching the model table above it.
- **fa, ko, vi (R2-S1, R2-S2):** mirrored the same lines, and brought the `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row in line with en. `ko/claude_concepts_guide.md` gains the Fable 5.2, 5.1 and 5 rows, and its `xhigh`/`max` note names the Fable models, as in en and fa.
- **ja, uk (R2-S2, R2-S3):** removed the false "`xhigh` is Opus 4.7-only" and "`max` is Opus 4.7/4.6-only" claims from `09` and `10-cli`. The support and `xhigh` lists now match model-config, and the model lists in the `CLAUDE_CODE_EFFORT_LEVEL` row are translated from en.
- **ja, uk `04-subagents` (R2-S4):** the `effort` row and the frontmatter comment now list `xhigh`.
- **Haiku 4.5 context (R2-N2, factual part only):** `uk/10-cli` listed Haiku 4.5 at 1M tokens. It's now 200K, matching en `10-cli` and model-config's 1M list, which doesn't include Haiku 4.5. The same cell in `ja/10-cli` was fixed too.
- Merged `main` (#246, scripts only).

## Learner skills

No changes landed. Three edits are pending because writes to `.claude/skills/**` were refused by the permission system in this run:
- `lesson-quiz` `question-bank.md` Lesson 09 Q5 explanation: add Fable 5.2 to the `ultrathink` model list (P1).
- `self-assessment` `topic-recommendations.md` and its `SKILL.md` mirror, Advanced Features focus line: same change (P1).
- Lesson 04 Q10 explanation: optional `/tasks` "Earlier in this session" note (P3).

No correct answer letter changes, and all 100 `Review` pointers still resolve.

Exact text for the follow-up (from the round-1 review, §6):

1. `.claude/skills/lesson-quiz/references/question-bank.md:718` (Lesson 09 Q5, Explanation):
   - old: ``Since v2.1.311, typed in the interactive terminal on Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.1 through Anthropic's API, it also runs that turn at `xhigh` effort,``
   - new: ``Since v2.1.311, typed in the interactive terminal on Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2 (v2.1.321+), or Fable 5.1 through Anthropic's API, it also runs that turn at `xhigh` effort,``
2. `.claude/skills/self-assessment/SKILL.md:351` **and** `.claude/skills/self-assessment/references/topic-recommendations.md:73` (identical lines):
   - old: ``and the `ultrathink` keyword, which runs that turn at `xhigh` effort on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 (v2.1.311+)``
   - new: ``and the `ultrathink` keyword, which runs that turn at `xhigh` effort on Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, and Fable 5.1 (v2.1.311+; Fable 5.2 needs v2.1.321+)``
3. Version bumps: `lesson-quiz/SKILL.md` `version: 1.6.4` → `1.6.5`; `self-assessment/SKILL.md` `version: 2.5.7` → `2.5.8`.
4. Footer stamps: `question-bank.md` and `topic-recommendations.md`, 2.1.316 → 2.1.322. Optionally add `https://code.claude.com/docs/en/model-config#use-ultrathink-for-one-off-deep-reasoning` to Sources; it is already listed in both.
5. Optional (P3): Lesson 04 Q10 explanation, a note on the `/tasks` "Earlier in this session" row. It changes no letter.

## Needs maintainer decision (P2, not applied)

1. **Self-paced `/loop` ending.**
   - Repo: says nothing about how a no-interval `/loop` ends.
   - Docs: "If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later".
   - Changelog 2.1.319: self-paced `/loop` now ends "instead of scheduling a fallback wakeup; set `CLAUDE_CODE_LOOP_KEEPALIVE=1` to keep the old behavior".
   - https://code.claude.com/docs/en/scheduled-tasks#stop-a-loop
2. **Auto mode with telemetry or feature flags off.**
   - Repo (`10-cli` `CLAUDE_CODE_AUTO_MODE_SERVER` row, `09`): "Set to `0` to use Claude Code's own auto-mode classifier requests instead of server-side review".
   - Docs: when the review is dropped, "Claude Code falls back to its own classifier requests".
   - Changelog 2.1.319: calls the server can't check "are asked about or denied, with no fallback to the built-in classifier".
   - https://code.claude.com/docs/en/permission-modes#server-side-classifier-review
3. **MCP tasks.**
   - Repo (`05-mcp`): public beta since v2.1.304, needs feature-flag fetching (not Bedrock, Vertex, Foundry or telemetry off).
   - Docs: same.
   - Changelog 2.1.319: terminal support moves tasks to the background, works without feature-flag fetching, and adds `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` and `CLAUDE_CODE_DISABLE_MCP_TASKS`. The second variable is only in the changelog.
   - https://code.claude.com/docs/en/mcp#mcp-tasks-that-run-on-the-server
4. **`deniedMcpServers` URL entries.**
   - Repo (`05-mcp`): "`serverUrl` | A remote server URL, exact or with `*` wildcards".
   - Changelog 2.1.318: URL entries also block Anthropic-provided servers and cloud-session connectors.
   - Docs: "a `serverUrl` pattern written for the connector's own URL doesn't match it".
   - https://code.claude.com/docs/en/mcp#how-connectors-reach-claude-code
5. **`CLAUDE_CODE_PLUGIN_DIR_WATCH`.**
   - Repo (`07-plugins`): has only a generic hot-reload note.
   - Changelog 2.1.321: headless sessions now reload `.claude/skills` mods, and `=0` turns this off.
   - Docs: reloading covers `--plugin-dir` mods, is on in interactive sessions, and "Set to `1` to turn it on in non-interactive sessions".
   - https://code.claude.com/docs/en/env-vars#variables
6. **Mods' own tool calls.**
   - Repo (`07-plugins`): says nothing about prompting.
   - Changelog 2.1.321: `$.tool.call` and `$.mcp.call` "raise no permission prompt, even under your own ask rules".
   - Docs: "`$.mcp.call` | Calls a tool on a connected MCP server, under the session's permission rules".
   - https://code.claude.com/docs/en/plugins/mods/admin#review-what-a-mod-can-do

## Follow-ups (separate PRs)

- **Stamps only (review N3 + N6):** add Fable 5.2 to the "Compatible Models" footers (88 lines; root files still list Fable 5.1 as newest, and module files lack Opus 5.5, Sonnet 5.5 and Haiku 5.5). Align the locale README badges and "latest" lines: ja 2.1.119, zh and uk 2.1.112, ko and fa 2.1.310.
- **ko catch-up sync (review N7):** backfill 2.1.316 in ko: the Opus 4.8 fast-mode deprecation, the `CLAUDE_CODE_SUBAGENT_EFFORT` sentence and row, and the v2.1.311 `ultrathink` model list.
- **Learner skills (review S6):** apply the exact text under "Learner skills" above once `.claude/skills/**` is writable.
- **"Effort Levels (…)" headings (review R2-N1):** `10-cli` and its locale copies name only some models in the heading. They were left unchanged because renaming them changes the anchors.
- **Opus 4.6 row (R2-N4):** `claude_concepts_guide.md` (and fa, ko) has no Opus 4.6 row, but the note below the table mentions it. The Sonnet 4.6 row's "1M tokens" also needs the `[1m]`-variant qualifier.
- **`high`-default lists (R2-N5):** the `01` `/effort` row and the `10-cli` `CLAUDE_CODE_EFFORT_LEVEL` row (and their locale copies) leave Opus 4.6 and Sonnet 4.6 out of the `high` default.
- **ja/uk/zh/vi effort catch-up (R2-N6):** the `/effort` rows in `ja/01`, `uk/01`, `zh/01` and `vi/01` still say `max` needs Opus 4.7 or Opus 4.6. `ja/claude_concepts_guide.md:3061` has an Opus 4.7-era table.
- **uk/ja `10-cli` model tables (rest of R2-N2):** `uk/10-cli` `--effort` lacks `xhigh`, its model table is Opus 4.6-era (and Opus 4.6 / Sonnet 4.6 reach 1M only through `[1m]`), and it says "Opus 4.6 підтримує…". The `ja/10-cli` model table is Opus 4.7-era.
- **`06-hooks` context-limit comment:** the `CONTEXT_LIMIT` comment's 1M list leaves out the Fable models and Opus 4.7, and lists Sonnet 4.6, which reaches 1M only through `[1m]` (also in fa, ko and vi). This predates the PR.
- **ja/uk stale model lists:** `ja/09:228` and `uk/09:220` ("all models (Opus 4.7/4.6, Sonnet 4.6, Haiku 4.5)"), and `ja/10-cli:717-719` (the "Opus 4.7" heading and paragraph, the counterpart of en `10-cli:853`). In ja and uk, the 2.1.322 stamp covers the sections those files have; these older lists are tracked here.

## Validation

`pre-commit run --all-files` passes: markdown-lint, cross-references, link-check (247 URLs) and markdown-rendering in all five hooked languages, plus the Python checks. The Mermaid hooks were skipped with `SKIP=mermaid,vietnamese-mermaid,japanese-mermaid,korean-mermaid,persian-mermaid` because their `language: node` environment fails to install under pre-commit 4.7.0. `python scripts/check_mermaid.py --strict` was run directly instead: Pele rendered all 416 blocks. The pre-edit baseline was also all green. For the round-1 fixes, `pre-commit run --files` on the 20 changed files passes, with the same Mermaid SKIP; the `language: node` install error was reproduced. `check_mermaid.py --strict` (416 blocks) and `check_cross_references.py` (675 files) also pass. For round 3, pre-commit on the 15 changed files passes, with the same Mermaid SKIP. `check_cross_references.py` (676 files after the merge), `check_mermaid.py --strict` (416 blocks) and `pytest scripts/tests/` (234 passed, after merging #246) also pass.

## Sources

- https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md (2.1.317–2.1.322) and https://code.claude.com/docs/en/changelog
- https://www.npmjs.com/package/@anthropic-ai/claude-code
- https://code.claude.com/docs/en/model-config
- https://code.claude.com/docs/en/fast-mode
- https://code.claude.com/docs/en/scheduled-tasks
- https://code.claude.com/docs/en/remote-control
- https://code.claude.com/docs/en/errors
- https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting
- https://code.claude.com/docs/en/env-vars
- https://code.claude.com/docs/en/hooks
- https://code.claude.com/docs/en/agent-sdk/hooks
- https://code.claude.com/docs/en/tools-reference
- https://code.claude.com/docs/en/plugins/mods/create
- https://code.claude.com/docs/en/plugins/org
- https://code.claude.com/docs/en/skills
- https://code.claude.com/docs/en/commands
- https://code.claude.com/docs/en/vs-code
- https://code.claude.com/docs/en/agent-view
- https://code.claude.com/docs/en/mcp
- https://code.claude.com/docs/en/permissions
- https://code.claude.com/docs/en/permission-modes
- https://code.claude.com/docs/en/cli-reference
2026-11-12 13:02:46 +01:00
..

Claude How To

Checkpoints and Rewind

Checkpoints allow you to save conversation state and rewind to previous points in your Claude Code session. This is invaluable for exploring different approaches, recovering from mistakes, or comparing alternative solutions.

Overview

Checkpoints allow you to save conversation state and rewind to previous points, enabling safe experimentation and exploration of multiple approaches. They are snapshots of your conversation state, including:

  • All messages exchanged
  • File modifications made
  • Tool usage history
  • Session context

Checkpoints are invaluable when exploring different approaches, recovering from mistakes, or comparing alternative solutions.

Key Concepts

Concept Description
Checkpoint Snapshot of conversation state including messages, files, and context
Rewind Return to a previous checkpoint, discarding subsequent changes
Branch Point Checkpoint from which multiple approaches are explored

Accessing Checkpoints

You can access and manage checkpoints in two primary ways:

Using Keyboard Shortcut

Press Esc twice (Esc + Esc) to open the checkpoint interface and browse saved checkpoints.

Using Slash Command

Use the /rewind command (aliases: /checkpoint, /undo) for quick access:

# Open rewind interface
/rewind

# Or use the alias
/checkpoint

Rewind Options

When you rewind, you are presented with a menu of up to six options:

  1. Restore code and conversation -- Revert both files and messages to that checkpoint
  2. Restore conversation -- Rewind messages only, keep your current code as-is
  3. Restore code -- Revert file changes only, keep the full conversation history
  4. Summarize from here -- Compress the conversation from this point forward into an AI-generated summary, freeing context window space. Messages before the selected point stay intact. No files on disk are changed. The original messages are preserved in the session transcript. You can optionally provide instructions to focus the summary on specific topics.
  5. Summarize up to here -- The backward counterpart: compress everything before the selected point into an AI-generated summary, keeping the messages from this point forward intact. Together with "Summarize from here" this gives you bidirectional, targeted compaction of your context window. No files on disk are changed, and the original messages are preserved in the session transcript.
  6. Never mind -- Cancel and return to the current state

The two code restore options appear only when the selected checkpoint has file changes to revert, and the two Summarize options are hidden when DISABLE_COMPACT is set (v2.1.311+).

Note

: 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. Choosing Summarize up to here leaves you at the end of the conversation with the input empty.

Tip

: Send Claude a prompt before you exit after a rewind. Claude Code saves the rewound conversation together with that prompt, so if you exit first, the rewound messages can come back. To remove them again, run /rewind, select the same prompt, and choose Restore conversation. Restored files stay as the rewind left them.

/clear is no longer a hard boundary (v2.1.191+): /rewind can resume from a checkpoint taken before you ran /clear. Clearing the conversation no longer permanently discards the state that preceded it — you can rewind back across the clear if you need that earlier code or context again.

Automatic Checkpoints

Claude Code automatically creates checkpoints for you:

  • Every user prompt - A new checkpoint is created with each user input
  • Persistent - Checkpoints are saved with the conversation, so /rewind still works after you resume a session
  • Auto-cleaned - Checkpoints are automatically cleaned up after 30 days

This means you can always rewind to any previous point in your conversation, from a few minutes ago to days before.

Use Cases

Scenario Workflow
Exploring Approaches Save → Try A → Save → Rewind → Try B → Compare
Safe Refactoring Save → Refactor → Test → If fail: Rewind
A/B Testing Save → Design A → Save → Rewind → Design B → Compare
Mistake Recovery Notice issue → Rewind to last good state

Using Checkpoints

Viewing and Rewinding

Press Esc twice or use /rewind to open the checkpoint browser. You'll see a list of all available checkpoints with timestamps. Select any checkpoint to rewind to that state.

Checkpoint Details

Each checkpoint shows:

  • Timestamp of when it was created
  • Files that were modified
  • Number of messages in the conversation
  • Tools that were used

Practical Examples

Example 1: Exploring Different Approaches

User: Let's add a caching layer to the API

Claude: I'll add Redis caching to your API endpoints...
[Makes changes at checkpoint A]

User: Actually, let's try in-memory caching instead

Claude: I'll rewind to explore a different approach...
[User presses Esc+Esc and rewinds to checkpoint A]
[Implements in-memory caching at checkpoint B]

User: Now I can compare both approaches

Example 2: Recovering from Mistakes

User: Refactor the authentication module to use JWT

Claude: I'll refactor the authentication module...
[Makes extensive changes]

User: Wait, that broke the OAuth integration. Let's go back.

Claude: I'll help you rewind to before the refactoring...
[User presses Esc+Esc and selects the checkpoint before the refactor]

User: Let's try a more conservative approach this time

Example 3: Safe Experimentation

User: Let's try rewriting this in a functional style
[Creates checkpoint before experiment]

Claude: [Makes experimental changes]

User: The tests are failing. Let's rewind.
[User presses Esc+Esc and rewinds to the checkpoint]

Claude: I've rewound the changes. Let's try a different approach.

Example 4: Branching Approaches

User: I want to compare two database designs
[Takes note of checkpoint - call it "Start"]

Claude: I'll create the first design...
[Implements Schema A]

User: Now let me go back and try the second approach
[User presses Esc+Esc and rewinds to "Start"]

Claude: Now I'll implement Schema B...
[Implements Schema B]

User: Great! Now I have both schemas to choose from

Checkpoint Retention

Claude Code automatically manages your checkpoints:

  • Checkpoints are created automatically with every user prompt
  • Old checkpoints are retained for up to 30 days
  • Checkpoints are cleaned up automatically to prevent unlimited storage growth

Workflow Patterns

Branching Strategy for Exploration

When exploring multiple approaches:

1. Start with initial implementation → Checkpoint A
2. Try Approach 1 → Checkpoint B
3. Rewind to Checkpoint A
4. Try Approach 2 → Checkpoint C
5. Compare results from B and C
6. Choose best approach and continue

Safe Refactoring Pattern

When making significant changes:

1. Current state → Checkpoint (auto)
2. Start refactoring
3. Run tests
4. If tests pass → Continue working
5. If tests fail → Rewind and try different approach

Best Practices

Since checkpoints are created automatically, you can focus on your work without worrying about manually saving state. However, keep these practices in mind:

Using Checkpoints Effectively

✅ Do:

  • Review available checkpoints before rewinding
  • Use rewind when you want to explore different directions
  • Keep checkpoints to compare different approaches
  • Understand what each rewind option does (restore code and conversation, restore conversation, restore code, or summarize)

❌ Don't:

  • Rely on checkpoints alone for code preservation
  • Expect checkpoints to track external file system changes
  • Use checkpoints as a substitute for git commits

Configuration

Checkpoints are a built-in default behavior in Claude Code and do not require any configuration to enable. Every user prompt automatically creates a checkpoint.

Two settings govern checkpoint behavior — whether snapshots are taken at all, and how long they are kept:

{
  "fileCheckpointingEnabled": true,
  "cleanupPeriodDays": 30
}
Setting Default Effect
fileCheckpointingEnabled true Snapshot files before each edit so /rewind can restore them. Requires v2.1.119+. Surfaces in /config as Rewind code (checkpoints). Env equivalent: CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING
cleanupPeriodDays 30 Number of days to retain session history and checkpoints

Claude Code keeps snapshots for the 100 most recent checkpoints; older ones are dropped even inside the retention window.

v2.1.117 update: cleanupPeriodDays now governs retention for many on-disk caches, not just checkpoints (a selection below; session transcripts, file-history/, plans/, debug/, paste-cache/ and more are covered too):

  • Session checkpoints
  • ~/.claude/tasks/ — persistent task lists
  • ~/.claude/shell-snapshots/ — captured shell-environment snapshots
  • ~/.claude/backups/ — earlier versions of ~/.claude.json (the five newest are kept)

A single setting now prunes these directories uniformly after the same number of days.

Limitations

Checkpoints have the following limitations:

  • Bash-only file changes NOT tracked - Once Claude has edited a file with its file editing tools, /rewind also undoes changes that Bash commands make to that file afterward; a file that only Bash commands changed isn't tracked. Since v2.1.309, sed -i is treated like any other Bash edit
  • External changes NOT tracked - Changes made outside Claude Code (in your editor, terminal, another session, etc.) are normally not captured, unless they touch files Claude edited in this session — then a code restore can overwrite them (the /rewind warning says so since v2.1.311)
  • Not a replacement for version control - Use git for permanent, auditable changes to your codebase
  • Subagent edits NOT restored - A subagent's edits to files Claude hadn't already edited in your conversation are untracked, so /rewind leaves them as they are (revert them with git); the exception is a foreground context: fork skill, whose edits are restored like the main session's

v2.1.216 update: /rewind no longer restores or deletes files through symlinks or hard links at tracked paths. If a tracked path resolves through a symlink or hard link, rewind skips it rather than following the link (directory symlinks are no longer followed since v2.1.319), and it reports how many paths it skipped for this reason.

Troubleshooting

Missing Checkpoints

Problem: Expected checkpoint not found

Solution:

  • Check if checkpoints were cleared
  • Check disk space
  • Ensure cleanupPeriodDays is set high enough (default: 30 days)

Rewind Failed

Problem: Cannot rewind to checkpoint

Solution:

  • Ensure no uncommitted changes conflict
  • Check if checkpoint is corrupted
  • Try rewinding to a different checkpoint
  • No files were restored when restoring code to a checkpoint from before /branch: fixed in v2.1.319, so update Claude Code

Integration with Git

Checkpoints complement (but don't replace) git:

Feature Git Checkpoints
Scope File system Conversation + files
Persistence Permanent Session-based
Granularity Commits Any point
Speed Slower Instant
Sharing Yes Limited

Use both together:

  1. Use checkpoints for rapid experimentation
  2. Use git commits for finalized changes
  3. Create checkpoint before git operations
  4. Commit successful checkpoint states to git

Quick Start Guide

Basic Workflow

  1. Work normally - Claude Code creates checkpoints automatically
  2. Want to go back? - Press Esc twice or use /rewind
  3. Choose checkpoint - Select from the list to rewind
  4. Select what to restore - Choose from restore code and conversation, restore conversation, restore code, summarize from here, summarize up to here, or cancel
  5. Continue working - You're back at that point

Keyboard Shortcuts

  • Esc + Esc - Open checkpoint browser
  • /rewind - Alternative way to access checkpoints
  • /checkpoint, /undo - Aliases for /rewind

Knowing When to Rewind: Context Monitoring

Checkpoints let you go back — but how do you know when you should? As your conversation grows, Claude's context window fills up and model quality silently degrades. You might be shipping code from a half-blind model without realizing it.

cc-context-stats solves this by adding real-time context zones to your Claude Code status bar. It tracks where you are in the context window — from Plan (green, safe to plan and code) through Code (yellow, avoid starting new plans) to Dump (orange, finish up and rewind). When you see the zone shift, you know it's time to checkpoint and start fresh instead of pushing through with degraded output.

Additional Resources

Summary

Checkpoints are an automatic feature in Claude Code that lets you safely explore different approaches without fear of losing work. Every user prompt creates a new checkpoint automatically, so you can rewind to any previous point in your session.

Key benefits:

  • Experiment fearlessly with multiple approaches
  • Quickly recover from mistakes
  • Compare different solutions side-by-side
  • Integrate safely with version control systems

Remember: checkpoints are not a replacement for git. Use checkpoints for rapid experimentation and git for permanent code changes.


Last Updated: November 12, 2026 Claude Code Version: 2.1.322 Sources: