Skip to main content

Sessions: Resume, Fork or Start Fresh

Why This Matters

A session remembers everything, including the wrong turns. Sometimes that history is exactly what you need; sometimes it is the reason the agent keeps making the same mistake.

Three choices

ChoiceHowWhen
Resumeclaude --continue (most recent) or claude --resume <id or name>Yesterday’s work was on track and its context is still useful
ForkResume with --fork-sessionYou want to try a second approach from the same point without losing the first
Start freshclaudeThe context is polluted by a failed approach, or the task is new

Resume

You spent an hour yesterday mapping how TestPilot’s eval works. Resuming keeps that understanding. Starting fresh would mean reading everything again.

claude --resume lists the sessions for this project, with the branch they ran on:

The Resume session list in testpilot-ai: one session titled “runs.test.ts failureRate skipped runs”, 2 minutes ago, on branch solution/lesson-52-claude-code, 1MB

Look at the title. The session covered ten different things (rules, a hook, plan mode, a skill, MCP, a review), but it is named after the first one. In a week you will not find it. Rename sessions you may come back to (Ctrl+R in this list), or keep sessions short and about one thing, which is the better habit anyway.

Fork

You are halfway through adding severity. Two designs are possible: severity as a separate field, or folded into the category. Fork the session, try one design in each, compare the diffs, and keep the better one. Both start from the same understanding.

Start fresh

The agent tried three times to fix a failing test by changing the assertion, and you told it three times not to. The failed attempts are now part of its context, and it keeps drifting back. A fresh session with a clear brief (“the assertion is correct; find why the value is wrong”) usually works better than a fourth correction.

Keep long sessions sharp

Long sessions accumulate noise. Before it becomes a problem:

  • compact the conversation, telling Claude Code what to keep (the decisions, the open questions)
  • write a short status note (docs/status.md): what is done, what is decided, what is next
  • hand over: start a new session that reads the status note first

The status note is the same idea as the case file for agents in module 7.

Exercise

Use a fork to try both severity designs. Then write a status note and start a fresh session from it. Compare how quickly the fresh session gets back up to speed.

Compare with solution/lesson-52-claude-code, which has the Claude Code setup for lessons 42–52. Its docs/claude-code-demo.md walks you through all of module 6 in one session.