Blog

Resuming a Claude Code session: --continue, --resume, and what comes back

Claude Code writes every session to disk as it happens. That makes resuming cheap, but it is worth knowing exactly what you get back.

The RoamAI teamPublished September 9, 2026

The two commands

  • claude --continue (or -c) resumes the most recent session in the current directory.
  • claude --resume (or -r) shows the sessions in this directory and lets you pick one. Pass a session id to skip the list: claude --resume <id>.

Both work in headless mode too. claude -p --resume <id> "next prompt" continues the same session without the interactive UI, which is how scripts pick up where a person left off.

Where the transcript lives

Each session is one JSONL file under ~/.claude/projects/, in a folder named after the working directory. The file is append-only. Resuming appends to the same file under the same session id rather than creating a new one. To branch instead, pass --fork-session.

ls -t ~/.claude/projects/*/ | head

What is restored

  • The whole conversation: your messages, Claude's replies, every tool call and its result. The model sees all of it again, so it knows what it did and why.
  • Sessions that were auto-compacted resume from the compacted summary plus everything after it.

In our tests on 2.1.234, a resumed session kept facts from earlier turns. After truncating the transcript file to an earlier point and resuming, it correctly no longer knew the turns we had removed.

What is not restored

  • Anything that lived only in the old process: a shell command that was still running, environment variables set in that shell, background tasks.
  • Files. The transcript records what was edited, but resuming does not undo or redo edits. The working directory is whatever it is now.
  • Memory files Claude Code wrote during the session. They are ordinary files on disk and stay as they are.

How /rewind differs

Inside an interactive session, /rewind takes the conversation back to an earlier turn. It does not truncate the transcript file. The file stays append-only and the new branch is written after the old one. Its restore-code option uses the file checkpoints Claude Code keeps under ~/.claude/file-history/ for edits made with its own Edit and Write tools. Those checkpoints are recorded only in interactive sessions, not in -p mode, and not for changes made through shell commands.

When the id is wrong

Resuming a session that does not exist fails immediately with "No conversation found". It does not silently start a new one, so a script that resumes by id can rely on the error.

In RoamAI

You do not run these commands. Sessions stay on the server, idle ones are put away and brought back when you send a message, and the app shows all of them in one list. Working with sessions.

Sessions that stay up, without the server work

RoamAI runs Claude Code on a hosted machine or on a server you connect, and tells you when a session needs you. Signing up is free. Workspaces are $9 / month.

Get started

← All posts