Claude Code Resume: --continue, --resume and /resume
Claude Code saves every session locally and keeps it 30 days by default. How to resume with --continue and --resume, name sessions, branch, and what comes back.
- Claude Code saves sessions locally as you work. claude --continue (-c) reopens the most recent one in the current directory, and claude --resume (-r) opens a picker or takes a name, ID or transcript path.
- Resuming restores the conversation, the model and usually the permission mode, but not launch flags such as --mcp-config, --settings, --plugin-dir or --add-dir, and never bypassPermissions.
- Name a session with claude -n or /rename, and return to it with claude --resume <name> or /resume <name>.
Claude Code saves each session to a local file as you work, so you can come back to it after exiting or after /clear. This guide covers the ways to resume, naming and finding sessions, what a resumed session restores, where transcripts live, branching, how resuming differs from rewinding, and what to watch for when you resume a long conversation.
On 2026-10-27 our test environment (macOS) reported Claude Code 2.1.311 from claude --version. We did not resume, name or branch a real session for this article (not run). Everything about behavior below comes from the docs.
The quick ways back
| Command | What it does |
|---|---|
claude --continue (-c) | Reopens the most recent session in the current directory |
claude --resume (-r) | Opens the session picker |
claude --resume <name> | Resumes a named session directly |
claude --resume <session-id> | Resumes by ID, from any directory |
claude --resume <transcript-path> | Resumes the session stored in that .jsonl file (absolute path) |
claude --from-pr <number> | Opens the picker filtered to sessions linked to that pull request; it also takes GitHub, GitLab or Bitbucket PR URLs |
/resume | Switches to another session from inside an active one |
Use -c to pick up where you just left off, -r to choose, and a name or ID when you know exactly which one. You can also pass a prompt: claude -r "auth-refactor" "Finish this PR".
An ID is looked up first in the current project and its git worktrees, then in every other project on the machine (the cross-project search arrived in v2.1.223). If nothing matches, you get No conversation found with session ID: <session-id>. A name is resolved across the current repository and its worktrees. If the name is ambiguous, claude --resume <name> opens the picker with the name as a search term, while /resume <name> reports an error.
If the session you resume is a background session that’s still running, Claude Code opens that running session instead of loading its transcript (v2.1.285 or later). From the shell, this attaches the terminal with claude attach.
Sources: https://code.claude.com/docs/en/sessions and https://code.claude.com/docs/en/cli-reference, checked 2026-10-27
What a resumed session restores
When Claude Code loads a conversation from its transcript, it brings back:
- The conversation: messages, tool calls and results. A compacted session opens at a
Conversation compactedrow and continues from the last summary plus the messages after it - The model it was using, with a few exceptions covered in the model configuration docs
- The agent, if the session started with
--agentor theagentsetting - The permission mode, in most terminal cases (see the table below)
- An active goal and session-scoped scheduled tasks that haven’t expired
What doesn’t come back:
- Launch flags. Pass
--mcp-config,--settings,--plugin-dir,--fallback-modeland--add-diragain. Directories added mid-session with/add-diraren’t restored either. Settings files such assettings.jsonandsettings.local.jsonare re-read at launch, so anything in them doesn’t need passing again - Interrupted tool calls. A tool that was running when the previous process ended, for example in a crash, isn’t finished or rerun. Claude sees it marked as cut off and is told to check whether it took effect before running it again
- Background work. A background subagent, Bash command or workflow that ended with the old process shows up as a note that it didn’t finish. Background Bash and monitor tasks aren’t restored
Source: https://code.claude.com/docs/en/sessions, checked 2026-10-27
Permission mode on resume
| How you resume | Permission mode |
|---|---|
Terminal: claude --continue, claude --resume <session-id>, or claude --resume <name> matching one session, without -p | The mode the session ended in. bypassPermissions is never restored; you get the mode a new session would start in. auto comes back only if your account still meets the auto mode requirements |
| Picking from the picker at launch | The mode a new session would start in from the same command line, except that a session that ended in plan mode resumes in plan mode |
/resume inside a session | Your current session’s mode, except that a session that ended in plan mode resumes in plan mode |
claude -p --resume or claude -p --continue | The mode a new claude -p run would start in, with plan mode restored only under specific conditions |
Pass --permission-mode or --dangerously-skip-permissions to override the restored mode. --fork-session stops plan mode from being restored.
Source: https://code.claude.com/docs/en/sessions, checked 2026-10-27
Naming and finding sessions
If you run several tasks in parallel, names make them easy to find.
| When | How |
|---|---|
| At startup | claude -n auth-refactor |
| Mid-session | /rename auth-refactor. The name also shows on the prompt bar |
| In the picker | Highlight a session and press Ctrl+R |
| On plan accept | Accepting a plan in plan mode gives an unnamed session a title based on the plan |
Then return with claude --resume auth-refactor or /resume auth-refactor.
Unnamed sessions get two labels, but only one works for resuming. The generated title, a short summary of your first prompt, can be passed to --resume like a name. The default display name, such as my-app-3f, only identifies running sessions in listings and isn’t a resume handle. A claude -p run started straight from a shell or script gets no generated title.
The session picker
Open it with /resume or claude --resume with no argument.
| Key | Action |
|---|---|
↑ / ↓ or k / j | Move between sessions |
→ / ← | Expand or collapse grouped sessions |
Enter | Resume the highlighted session |
1 to 9 | Resume the session at that position |
Space | Preview the session (Ctrl+V also works where the terminal doesn’t take it as paste) |
Ctrl+R | Rename the highlighted session |
/ or typing | Search. Pasting a pull or merge request URL finds the session that created it |
Ctrl+B | Only sessions from the current git branch; press again for all |
Ctrl+W | All worktrees of the repository; press again for the current one. Shown only in multi-worktree repositories |
Ctrl+A | Every project on this machine; press again for the current repository |
Esc | Leave the picker or search |
By default the picker lists sessions from the current worktree, including background sessions (marked bg) and sessions started elsewhere that added this directory with /add-dir. Sessions created with claude -p or the Agent SDK, and sessions whose first prompt was /loop, are left out of both the picker and claude --continue. Resume them by passing the session ID. claude -p --continue does include them.
Selecting a session from another project copies a cd and resume command to your clipboard instead of resuming it.
Sources: https://code.claude.com/docs/en/sessions and https://code.claude.com/docs/en/cli-reference, checked 2026-10-27
For running work in parallel across worktrees, see our guide to parallel agents and worktrees.
Where sessions are stored
Transcripts are JSONL files at ~/.claude/projects/<project>/<session-id>.jsonl. <project> is your working directory path with every non-alphanumeric character replaced by -, cut to 200 characters plus a hash when it’s longer. That’s why sessions are grouped per directory. The format is internal to Claude Code and changes between versions, so the docs recommend /export or the script interfaces over parsing the files.
| To | Use |
|---|---|
| Change the 30-day retention | cleanupPeriodDays in settings.json |
Move storage off ~/.claude | CLAUDE_CONFIG_DIR |
Name the <project> directory yourself | CLAUDE_CODE_PROJECT_DIR_NAME, together with CLAUDE_CONFIG_DIR (v2.1.234 or later) |
Not write a transcript for one -p run | --no-session-persistence |
| Not write transcripts in any mode | CLAUDE_CODE_SKIP_PROMPT_HISTORY |
| Delete a project’s transcripts now | claude purge [path], with --dry-run to preview |
/export copies the current conversation to the clipboard or saves it as readable text.
Sources: https://code.claude.com/docs/en/sessions and https://code.claude.com/docs/en/cli-reference, checked 2026-10-27
Branching instead of overwriting
To try a different approach without losing the current one, branch:
/branch try-streaming-approach
Without a name, the branch is named after the first prompt. The confirmation prints both session IDs, and the original stays in the picker. From the command line, add --fork-session to --continue or --resume:
claude --continue --fork-session
Branches get their own session IDs and appear as separate rows. /branch stays in the same process, so “Allow for this session” grants carry over and running background work keeps going in the branch. --fork-session starts a new process, so you approve again there. If you resume the same session in two terminals without forking, both sets of messages interleave into one transcript.
Sources: https://code.claude.com/docs/en/sessions and https://code.claude.com/docs/en/cli-reference, checked 2026-10-27
Resume versus rewind
Resuming returns to a session you closed. Rewinding (checkpointing) goes back to an earlier point inside one session. Open the rewind menu with /rewind, or press Esc twice with the input empty. Checkpoints are saved with the conversation, so /rewind still works after you resume.
Two limits matter here. File snapshots are deleted in the retention sweep, by default about 30 days after the session last saved one; after that, rewinding can fail with No files were restored. cleanupPeriodDays keeps them longer. And Bash changes are tracked only for files Claude had already edited with its file tools; a file that only Bash commands changed isn’t restored, so use Git for that.
If you ran /clear earlier in the same process, the rewind menu also offers the previous session at the top, labeled /resume <session-id> (previous session).
Source: https://code.claude.com/docs/en/checkpointing, checked 2026-10-27
Resuming from a script
Pass a session ID to claude -p --resume to ask an existing session a follow-up and capture the answer:
claude -p --resume <session-id> --output-format json "summarize what we changed" | jq -r '.result'
Source: https://code.claude.com/docs/en/sessions, checked 2026-10-27
For getting the session_id out of a run in the first place, see Claude Code Headless Mode: claude -p for Scripts and Cron.
Resuming a long conversation
Resuming puts the whole saved conversation back into context, so every request carries it again. On Pro and Max plans you may see a “Resume this conversation?” dialog when you resume a long conversation after a long break or on a different model. Its estimate is the share of your 5-hour limit the saved conversation alone would use, and the usage lands with your first message after Resume. Choose Start a new conversation if the next task doesn’t need it; /resume can still bring it back later.
For unrelated work, /clear starts fresh and keeps the old session for /resume. To keep going but smaller, summarize with /compact; see Claude Code /compact: Auto Compact and What Survives It.
Source: https://code.claude.com/docs/en/sessions, checked 2026-10-27
Related articles
-
Claude Code Setup and Daily Operations: where config files, instructions, daily commands and IDE setup live.
Summary
claude -creopens the latest session here,claude -ropens the picker, andclaude -r <name>or an ID goes straight to one.- Launch flags like
--mcp-config,--settingsand--add-dirdon’t come back; pass them again.bypassPermissionsis never restored. - Name sessions with
claude -nor/renameand resume them by name. - Sessions live under
~/.claude/projects/per directory and are kept 30 days by default; change it withcleanupPeriodDays. - The picker shows the current worktree; widen it with
Ctrl+WandCtrl+A.-pand SDK sessions resume by ID. - Branch with
/branchor--fork-sessionto experiment, and use/rewindto go back inside one session.
FAQ
- How do I resume a previous conversation in Claude Code?
- Run claude --continue to reopen the most recent session in the current directory, or claude --resume to pick one from a list. Inside a session, /resume switches to another conversation.
- Where does Claude Code store session history?
- As JSONL files at ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is the working directory path with non-alphanumeric characters replaced by -. Sessions are kept for 30 days by default, which cleanupPeriodDays in settings.json changes.
- Why is my session missing from claude --resume?
- The picker shows the current worktree by default. Press Ctrl+W for all worktrees of the repository or Ctrl+A for every project. Sessions from claude -p, the Agent SDK, or a first prompt of /loop are left out, but you can still resume them by session ID.
- What is the difference between --continue and --fork-session?
- --continue reopens the most recent session and keeps writing to it. Adding --fork-session resumes a copy with a new session ID, so the original stays as it was.
- Does resuming restore my MCP servers and flags?
- No. Flags such as --mcp-config, --settings, --plugin-dir, --fallback-model and --add-dir must be passed again. Configuration in settings.json and settings.local.json is re-read at launch, so it doesn't need to be passed.