Overview
A session is a saved conversation tied to a project directory. Claude Code stores
it locally as you work, so you can resume where you left off, branch to try a
different approach, or switch between tasks. This guide covers the CLI workflow.
Resume
| Command |
What it does |
claude --continue |
Resume the most recent session in this directory |
claude --resume |
Open the session picker |
claude --resume <name> |
Resume a named session directly |
claude --from-pr <number> |
Resume the session linked to a pull request |
/resume |
Switch conversations from inside a session |
Sessions started with claude -p or the Agent SDK do not appear in the picker
but can be resumed by passing their session ID to claude --resume <id>.
Name your sessions
Descriptive names make sessions findable and resumable:
- At startup:
claude -n auth-refactor
- During a session:
/rename auth-refactor
- From the picker: highlight and press
Ctrl+R
- On plan accept: the session is named from the plan content unless you already
set a name
Use the session picker
Run /resume (or claude --resume) to open the picker. Navigate with arrows,
Space to preview, Ctrl+R to rename, Ctrl+A to widen to all projects,
Ctrl+W to widen to all worktrees, and Ctrl+B to filter to the current branch.
You can paste a pull/merge request URL to find the session that created it.
Branch a session
Branching copies the conversation so far and switches you into it, leaving the
original intact:
/branch try-streaming-approach
From the command line, combine resume with fork:
claude --continue --fork-session
Forked sessions are grouped under their root in the picker. To return to the
original, resume it by ID or name.
Manage context within a session
/clear starts fresh with an empty context (the prior conversation is saved).
/compact [instructions] replaces history with a summary.
/context shows what is consuming context.
Where session data lives
Transcripts are JSONL at ~/.claude/projects/<project>/<session-id>.jsonl,
removed after 30 days by default (cleanupPeriodDays). Use /export to copy or
save a readable transcript. Set CLAUDE_CONFIG_DIR to relocate storage.
Source