Claude Code sessions: resume, name and branch a conversation
Closing the terminal does not lose your Claude Code conversation. Every conversation is a saved session tied to a project folder, and you can reopen it, give it a name you will remember, or branch it to try something different without losing the original. Here is the short version.
Get back to a conversation
claude --continuereopens the most recent session in the current folder.claude --resumeopens a picker so you can choose one.claude --resume nameresumes a session by the name you gave it. If the name matches more than one, you get the picker with the name already typed in as a search./resumeswitches to another session from inside the one you are in./clearalso keeps the old conversation, so you can come back to it with/resume.claude --from-pr 123opens the picker filtered to sessions linked to that pull request.
Name sessions so you can find them
If you work on several tasks, a name beats scrolling a list. Start with claude -n auth-refactor, rename during a session with /rename auth-refactor, or press Ctrl+R on a session in the picker. If you never name one, Claude Code makes a short title from your first prompt, and that generated title also works with --resume.
The picker
- Arrow keys move, Enter resumes, Space previews, and typing searches. You can even paste a pull request URL to find the session that created it.
- By default it shows sessions from the current folder (and its worktrees). Ctrl+W widens to all worktrees of the repository and Ctrl+A to every project on the machine; Ctrl+B filters to the current git branch.
- Sessions made with
claude -p, the Agent SDK, or a first prompt of/loopstay out of the picker and out of--continue. You can still resume one by passing its session ID.
What a resumed session brings back
As we read the docs, resuming restores the conversation (if it had been compacted, you continue from the summary plus what came after), the model the session was using, an agent you started it with, the permission mode in most cases, and scheduled tasks that have not expired. A tool call that was still running when the process ended is not run again. Not everything comes back: if the session depended on flags such as --mcp-config, --settings, --plugin-dir or directories you added, pass them again, and directories added mid-session with /add-dir are not restored either. A session that ended in plan mode comes back in plan mode.
On some plans you may see a "Resume this conversation?" prompt for a long conversation after a break. It estimates how much of your usage limit the saved conversation alone would use. If your next task does not need it, start a new conversation instead and keep the old one for later (see reduce token usage).
Branch a conversation
To try a different approach without losing the path you were on, run /branch (with a name if you like, for example /branch try-streaming-approach). It copies the conversation so far into a new session and switches you into it, and the original stays untouched in the picker. From the command line, claude --continue --fork-session does the same in a new process; "allow for this session" permissions are not carried into that new process, so you approve them again. If you resume the same session in two terminals without forking, their messages are interleaved in one transcript, so fork instead. To undo code and conversation inside one session, see rewinding.
Where it is stored
- Transcripts are plain-text JSONL files under your Claude folder, in a
projectssubfolder, one file per session. By default they are kept for 30 days, which thecleanupPeriodDayssetting changes. - The file format is internal and changes between versions, so don't build scripts on parsing it. To save a readable copy, use
/export; to feed a script, useclaude -pwith JSON output. - Your conversations are on your disk, so treat transcripts as sensitive: they can contain whatever you or a tool printed. Don't share them without checking.
Clear, compact or branch?
/clear starts with an empty context and saves the old session. /compact replaces the history with a summary and stays in the same session. /context shows what is using space (more in what survives /compact). For carrying work between sessions on purpose, a short handoff note works well, and for parallel work see git worktrees.
All the guides are in the guides index. This follows Anthropic's sessions documentation as we read it in October 2026, shortened on purpose. We are not affiliated with Anthropic. We wrote this from the documentation and have not tested every setup. Flags, menus and defaults change between versions, and where this page and the documentation disagree, the documentation wins.
The free loop-stop skill gives long tasks a limit and a stop rule. If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.