ModulesPhase 3: Working at scale

10. Safe experimentation

/plan/rewind/resume/branch
The 30-second answer

"Claude Code gives you four ways to try things without fear. Plan mode makes Claude research and propose before it edits anything, and nothing in your source changes until you approve the plan. Checkpoints snapshot your code before every prompt, so /rewind, or Esc twice, restores the code, the conversation, or both, to any earlier point. /branch copies the conversation so you can try a second approach while the first stays intact, and /resume brings back any saved session by name. The limit to say out loud: checkpoints track the files Claude edits with its own tools, not everything a shell command did, so a push or a deploy can't be rewound. Git is still the record."

The last sentence is what a customer's platform team is listening for.

Say it yourself first, then compare.
See it

8 pictures, in order.

Use the arrow keys or the dots. Tap a picture to see it full size.

Four ways to experiment without fear1 of 8
Know it

The facts someone can check.

Plan mode
  • Enter it with Shift+Tab (it cycles manual, accept edits, plan, then auto if available), with /plan before a prompt (/plan fix the auth bug), or at launch with claude --permission-mode plan. Make it a project's default with "defaultMode": "plan" in .claude/settings.json.
  • What Claude does: reads files, runs commands to explore, and writes a plan. Source edits stay blocked until you approve. The built-in Plan subagent does the research in its own context.
  • Commands while planning: when auto mode is available, a classifier reviews each exploring command instead of prompting you. Without it, anything outside the read-only command set asks for approval.
  • Approving: choose auto mode (or auto-accept edits), or approve each edit yourself, or "No, keep planning". Ctrl+G opens the plan in your editor first. Approving switches the session out of plan mode, and titles the session after the plan unless you named it.
  • Where the plan goes: a file in ~/.claude/plans, unless the plansDirectory setting points somewhere inside the project.
  • opusplan: a model alias that uses Opus while planning and Sonnet while executing.

Checkpoints and /rewind (aliases /undo, /checkpoint)

  • Every prompt that starts a turn creates a checkpoint. File snapshots are kept for the 100 most recent checkpoints in a session.
  • Checkpoints are saved with the conversation, so /rewind still works after /resume. Snapshots are swept with the session data, by default about 30 days after the session last saved one.
  • Open the menu with /rewind, or Esc twice on an empty prompt.
Rewind option What it does
Restore code and conversation Both go back to that point
Restore conversation Chat goes back; current code stays
Restore code Files go back; chat stays
Summarize from here Compresses everything after this point, keeping your early instructions intact
Summarize up to here Compresses everything before this point, keeping recent messages
Never mind Back to the list

Summarizing changes no files and the originals stay in the transcript. You can type instructions to steer the summary. Rewinding also lands on a prefix the prompt cache already holds, so the next request is cheap.

What rewind cannot undo
Restored Not restored
Edits Claude made with its file editing tools A file only shell commands changed
Later shell changes to a file Claude had already edited A background subagent's edits to files Claude hadn't edited
Edits by a forked skill running in the foreground Your manual edits, or edits from another session
The conversation Symlinked or hard-linked files (skipped, with a warning)

A message you type while Claude is mid-turn has no checkpoint of its own. Checkpoints are session-level undo, not version control.

Sessions and /resume (alias /continue)

Command What it does
claude --continue Reopens the most recent session in this folder
claude --resume Opens the session picker
claude --resume <name> Resumes a named session directly
claude --from-pr <number> The picker, filtered to sessions linked to that pull request
/resume [session] Switches sessions from inside one
  • Name sessions at launch (claude -n auth-refactor), during one (/rename auth-refactor), in the picker (Ctrl+R), or by accepting a plan. Names are capped at 200 characters. The default display name, like my-app-3f, is not a resume handle.
  • A resume restores the conversation, the model, the agent, the permission mode when resumed from a terminal, an active goal, and unexpired scheduled tasks.
  • It does not restore launch flags such as --mcp-config, --settings, --plugin-dir, --add-dir (or /add-dir folders) and --fallback-model; pass them again. Settings files are re-read. Background shell and monitor tasks don't come back.
  • Storage: one .jsonl per session under ~/.claude/projects/<project>/, deleted after 30 days by default (cleanupPeriodDays).
  • /clear does not delete anything: the previous session stays resumable, and in the same process the rewind menu offers it at the top.
Branching with /branch

/branch [name] copies the conversation up to now and switches you into the copy. The original stays on disk; return to it with /resume. From the shell, claude --continue --fork-session does the same in a new process.

State After /branch
Conversation history Copied up to that point
"Allow for this session" grants Carried over (same process). --fork-session starts without them
Background subagents and shell commands Keep running; output lands in the branch
Remote Control Follows you into the branch

Neighbors that sound alike: /fork copies the conversation into a background session while you keep working here; /subtask hands a side task to a subagent that reports back; /rewind goes back within the same session. Resuming one session in two terminals without forking interleaves both into one transcript.

Which tool for which moment

The table to keep in your head during a demo.

Quiz

Answer out loud, then flip the card.

Mark each one honestly. Cards you miss stay flagged for review, in this browser.

0 of 8 right
Question 1

Claude ran a script that dropped a test table, then edited three files. Can /rewind undo all of it?

Only part of it. Rewind restores the three files Claude edited with its own tools, and the conversation. The dropped table is not a file Claude edited, so nothing in a checkpoint covers it. That needs a database backup. For the next time: plan mode first, permission rules that make that kind of command ask, and git commits before risky steps.

Question 2

What does plan mode actually prevent?

Edits to your source until you approve the plan. It doesn't stop Claude from running commands: Claude explores with shell commands, which a classifier reviews when auto mode is available, and which otherwise prompt you unless they are in the read-only set. Think of it as "propose before changing," not as a sandbox.

Question 3

A developer wants to try two approaches to a refactor. What do you suggest?

/branch to try the second approach in a copy of the conversation while the first stays intact, with /resume to go back. Branching copies the conversation transcript, so for file changes you want kept apart, commit between attempts or use a git worktree (Module 11). /fork is the alternative when the second attempt should run in the background while you keep working.

Question 4

How far back can you rewind, and how long do sessions last?

File snapshots are kept for the 100 most recent checkpoints in a session, and checkpoints are saved with the conversation, so rewind works after a resume. Transcripts and snapshots are swept after about 30 days by default; cleanupPeriodDays changes that. A rewind to a point whose snapshots are gone fails with "No files were restored."

Question 5

"I resumed yesterday's session and the MCP server I loaded with --mcp-config is gone. Is that a bug?"

No. A resume restores the conversation, model, agent and permission mode, but not launch flags. --mcp-config, --settings, --plugin-dir, --add-dir and --fallback-model have to be passed again. Configuration that lives in the settings files is re-read at launch, so the durable fix is to put it there.

Question 6

A developer ran /clear by accident. Is the conversation gone?

No. /clear saves the previous session and starts an empty one. Get it back with /resume, or, in the same Claude Code process, from the entry the rewind menu adds at the top of its list.

Question 7

When would you use "Summarize from here" instead of /compact?

When the start of the session holds instructions you want kept word for word and the noise came later. "Summarize from here" compresses everything after the chosen point and leaves the earlier messages intact, like a targeted /compact. "Summarize up to here" does the reverse. Neither changes files, and the original messages stay in the transcript.

Question 8

A customer asks: "With checkpoints, can we let Claude work unsupervised?" What do you say?

Checkpoints are undo for the files Claude edits in a session. They don't cover a file only a shell command changed, a background subagent's edits to other files, another session's edits, symlinked files, or anything outside the filesystem such as a push. For unsupervised work, combine plan mode, permission rules or the sandbox, and git commits. Checkpoints make recovery fast; they aren't the safety boundary.

Traps

Wrong answers that sound right.

Before you tap, say why each one is wrong.

Try it

Three moves in a fresh project.

Facts checked against code.claude.com/docs/en/checkpointing, /sessions, /permission-modes, /settings-reference, /prompt-caching, /interactive-mode and /commands on 2026-10-25. Claude Code ships fast: confirm anything that matters against the official docs.