Resume, fork or start fresh
Choose between resuming a named session, forking it, and starting fresh with a summary, and tell a resumed session exactly what changed.
Scenario
You are building Developer Productivity with Claude tools. On Monday an engineer spends an hour with the agent mapping a legacy billing module: which files compute tax, where refunds are rounded, which tables they touch.
On Wednesday she wants to continue. Since Monday, a teammate merged a change to two of those files. Retyping the context wastes the hour. Reopening it blindly means the agent trusts what it read on Monday.
Explanation
A session is the conversation history the agent builds: your prompts, every tool call, every tool result, every response. It is saved, so you can return to it. It records the conversation, not the files: if a file changed since the agent read it, the history still holds the old contents.
Three ways to return:
Resume continues a specific session with its full history.
- Claude Code: name a session with
claude -n billing-mapor/rename billing-map, then return withclaude --resume billing-map.claude --continueopens the most recent session in the directory. - Agent SDK: read
session_idfrom the result message, then pass it as theresumeoption.continue_conversation=True(Python) orcontinue: true(TypeScript) picks the most recent session in the directory, no ID needed.
Fork creates a new session that starts with a copy of the history; the original stays unchanged, and each has its own ID.
- Claude Code:
claude --resume billing-map --fork-session, or/branchinside a session. - Agent SDK:
resumeplusfork_session=True(Python) orforkSession: true(TypeScript). - Use it to compare two approaches from one shared analysis. Forks branch the conversation only: file edits made in a fork are real in that directory.
Start fresh with a summary when the history is mostly stale. Old tool results describe files that no longer look that way, and the agent may reason from them. Open a new session and give it a structured summary: conclusions that still hold, what changed, and the open questions.
The decision:
| Situation | Choice |
|---|---|
| Prior context mostly valid | Resume, and say what changed |
| Two directions from one baseline | Fork |
| Prior tool results largely stale | New session with a summary |
When you resume after changes, name them. "Continue" lets the agent trust its old reads; "re-explore everything" throws away valid work. List the changed files and what changed, so it re-reads only those.
Worked example
The engineer resumes billing-map on Wednesday.
Before:
Continue where we left off.
The agent keeps Monday's reading of tax.ts, which no longer matches the code, and builds on it.
After:
Since Monday, PR 212 was merged: invoice/tax.ts now rounds per line instead of per invoice, and legacy/rates.ts was deleted (its rates moved to config/rates.json). Re-read those three files only and update your map. Everything else you read is unchanged. Then continue with the refund flow.
The agent re-reads three files instead of the whole module, and its map is current.