Claude CodeClaude Code 2.1 · macOS, Linux, Windows
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
31 small wins to finish your pathNext lesson

Sessions: resume, continue, fork

A session is a conversation tied to a directory, saved on your machine as it happens. Knowing how to come back to one, and when to branch instead, is most of working on something for more than an afternoon.

Every message, tool call and result is appended to a plain text file as you work. Those three runs from the earlier lessons each left one behind.

bash
ls ~/.claude/projects/-private-tmp-linkshort/
Captured from a real run
6cb086d7-a4b1-4f2c-8716-f4df56ce3c95.jsonl
d97247c3-193e-4f0b-a094-247f74cd67a3.jsonl
eebc5636-3afb-47d4-a4f7-da64a313841d.jsonl

The directory name is your project path with the slashes turned into dashes, and each file is one session. They are ordinary JSON lines, which means the record of what happened is yours to read, grep or delete.

Coming back

CommandWhat it does
claude --continueReopens the most recent conversation in this directory
claude --resumeOpens the picker so you can choose one
claude --resume <name>Goes straight to a session you named
/resumeSwitches to another conversation without leaving the one you are in

A resumed session comes back with the whole history, tool calls and results included, and continues on the model it was using. One thing does not come back: a tool that was still running when the process died does not run again, and Claude carries on without its output.

Headless runs are hidden
Sessions started with claude -p stay out of the picker and out of --continue, which is why the three files above will not appear there. You can still open one by passing its id to --resume.

Forking, and why it is different

Resuming appends to the same conversation. Forking copies the history into a new session and leaves the original exactly as it was.

bash
claude --continue --fork-session

You get a new session id holding a copy of the conversation. The original is untouched and still there to resume.

Use it when you want to try a second approach without losing the first, or before something you might regret. Inside a session the same thing is /branch.

Because a session belongs to a directory, two directories mean two independent sessions, which is how parallel work is done. Git worktrees give you those directories, and that is lesson 21.

Try it yourself
  • Run claude --resume and look at how your own sessions are named.
  • Open one of your .jsonl transcripts in an editor and read a tool call.

This is what real progress feels like.