Courses/Claude Certified Architect — Foundations (CCA-F)/1.7 Session State, Resumption & Forking
Domain 1: Agentic Architecture & Orchestration (27%)Lesson 7 of 30

1.7 Session State, Resumption & Forking

1.7.1 Work That Spans More Than One Sitting

Real work rarely fits in a single sitting. You investigate a codebase on Monday, go home, and want to pick up exactly where you left off on Tuesday. Or you reach a decision point and want to try two different approaches without losing your place. Task Statement 1.7 is about exactly this: how an agent's conversation — its session — is saved, resumed, branched, and, crucially, how to avoid a subtle trap where picking up an old session feeds the agent information that's no longer true.

A session is simply a saved conversation tied to a project. Everything the agent and you have said, plus the results of every tool it ran, is stored so you can return to it later. There are three distinct things you might want to do with a saved session, and the entire lesson hinges on choosing the right one for your situation. Get it wrong and you'll have an agent confidently reasoning from stale facts.

The three options are: resume (continue a conversation right where it stopped), fork (branch a copy to try a different direction while keeping the original), and fresh-start-with-summary (begin a brand-new conversation but hand it a written summary of where things stand). Think of a session like a saved video game. You can LOAD your save and keep playing (resume); you can COPY the save into a second slot and try a risky path without ruining your main game (fork); or you can START a new game but carry over a written recap of the story so far (fresh start). Same save, three very different moves.

Resumeload & keep playingForkcopy save, try a pathFresh + summarynew game, carry a recapthe stale trapfiles changed → old facts

Three moves with a saved session — resume (load & continue), fork (copy & branch), fresh-start-with-summary (new conversation, carry a recap). Choosing wrong leads to the stale-context trap.

ℹ️

The one idea to hold onto

A session is a saved conversation. You can resume it (continue where you stopped), fork it (branch a copy to explore a different path), or start fresh with a summary. The right choice depends on whether the old context is still TRUE.

1.7.2 Resume: Loading Your Save

Resuming is the simplest move: you reopen a saved conversation and continue, with the full prior history restored. The agent remembers everything it knew when you left — the files it read, the conclusions it drew, the half-finished plan. It's loading your saved game and pressing play.

Four ways to reopen a saved session--continuemost recent here--resumeopen the picker--resume <name>a named session--from-pr Nsession behind a PR

The resume entry points: --continue for the most recent, --resume for the picker or a named session, --from-pr to reopen the session behind a pull request.

In Claude Code this is a handful of flags. claude --continue reopens the most recent session in the current directory — the quickest 'pick up where I left off.' claude --resume opens a picker so you can choose among saved sessions, and claude --resume <name> jumps straight to a named one (you can name sessions so they're easy to find later). There's even claude --from-pr <number> to reopen the session that created a particular pull request.

Resume is the right choice when the prior context is still VALID — nothing important has changed since you left. If you were reasoning about code on Monday and that code is untouched on Tuesday, resuming is perfect: why re-do all that analysis? But hold onto that condition — 'when the context is still valid' — because it's precisely where the trap in section 1.7.4 springs.

1.7.2 — Key Concept

Resume (--continue / --resume <name> / --from-pr) reopens a saved conversation with its full history intact. It's the right move when the prior context is still valid — when nothing important has changed since you left.

1.7.3 Fork: Branching to Explore Two Paths

Sometimes you reach a fork in the road — two reasonable approaches, and you want to try both without committing. Say you've spent an hour analysing a codebase and now face a choice: refactor it one way, or a completely different way. You don't want to lose that hour of shared analysis, and you don't want the two experiments to contaminate each other. That's what forking is for.

Forking takes everything up to this moment — the shared baseline — and creates an independent branch you can explore freely, leaving the original conversation untouched and available. It's copying your save into a second slot: you keep the hard-won progress, but anything you do in the branch can't ruin the original. You can fork from inside a session with /branch, or from the command line by combining --fork-session with --continue or --resume. Forked sessions even group neatly under their root in the picker, so you can see the family tree.

The keyword for fork is divergent exploration from a shared baseline. Use it to compare two refactoring strategies, two testing approaches, two designs — anything where you want to branch from a common starting point. And note the boundary carefully, because the exam tests it: forking is for exploring alternatives, NOT for escaping stale information. A fork copies the baseline as-is, including any out-of-date facts in it — so if your baseline is stale, both branches inherit the same staleness. Forking duplicates the problem; it doesn't cure it.

1.7.3 — Key Concept

Fork (/branch or --fork-session) copies the conversation so far into an independent branch, leaving the original intact — for exploring divergent approaches from a shared baseline. It is NOT a fix for stale context: a fork inherits the same stale facts the original had.

1.7.4 The Stale-Context Trap

Here is the trap the exam loves, and it's worth slowing right down for. Picture this: on Monday your agent analyses a 50-file codebase and reads every file into its context. You then spend the afternoon EDITING several of those files. On Tuesday you resume the session to keep working. The agent dutifully reasons from what it remembers — but what it remembers is the OLD contents of files you've since changed. It gives you advice based on code that no longer exists, and worse, it can contradict itself, mixing old memories with any new reads.

This is the stale-context problem. The cached tool results from Monday's reads are now wrong, but they're still sitting in the conversation, exerting their pull. And here's the part that trips people up: the obvious fix — 'just resume and ask the agent to re-read the changed files' — is NOT enough. Why? Because the stale results are still in context, sitting right alongside the fresh reads, and the model has to somehow reconcile two contradictory versions of the same file. You haven't removed the bad information; you've just added good information next to it.

The reliable cure is the third option from section 1.7.1: start a FRESH session — one with no stale results at all — then inject a structured summary of where things stand, and explicitly NAME the files that changed so the agent re-reads exactly those. This gives you a clean slate plus precise, current information. Notice the efficiency too: if only 3 of the 50 files changed, you re-read just those 3 (targeted re-analysis), not the whole codebase again (full re-exploration). Clean context, current facts, minimal waste.

After editing files, resume is a trap — fresh start is the cure✗ Resumeold file contents still in contextreasons from code that's gonere-read on top? stale + fresh clash✓ Fresh + summaryno stale results at allinject summary + name changed filesre-read just the 3 of 50 that changed

Resuming after edits drags stale file contents into reasoning, and re-reading on top just adds conflict. The cure: a fresh session + a summary + the names of the changed files for targeted re-analysis.

1.7.4 — Key Concept

After files change, resuming makes the agent reason from stale cached results — and re-reading on top is insufficient because the stale results still conflict. The cure: a fresh session + a structured summary + naming the changed files, re-reading only what changed (targeted re-analysis).

1.7.5 The Exam Traps

The 1.7 traps cluster around two confusions: mixing up which of the three moves fits a situation, and — most of all — treating fork as a staleness remedy when it only duplicates the staleness. Map the situation to the move and they're straightforward.

SituationRight move
Continue yesterday's work, nothing changedResume (--resume <name>)
Compare two refactoring strategies from one baselineFork (/branch or --fork-session)
Resume after editing several analysed filesFresh session + summary + name changed files
Only 3 of 50 files changedTargeted re-analysis of those 3, not full re-exploration

Each situation has one right move. The most common mistakes are reaching for resume or fork when the context has gone stale and a fresh start is what reliability demands.

Two distractors show up again and again. The first: using fork to 'get a clean start' after edits — but a fork copies the stale baseline, so both branches are equally wrong. The second: re-exploring all 50 files when only 3 changed — wasteful when targeted re-analysis of the 3 changed files is precise and cheap. Keep the question 'is the old context still TRUE?' front of mind: if yes, resume; if you want alternatives, fork; if it's gone stale, start fresh with a summary.

⚠️

1.7.5 — Exam Trap

✗ Using --resume after code edits and trusting the cached results. ✗ Using fork to escape stale context (the fork inherits it). ✗ Re-exploring all files when only a few changed. ✗ Confusing fork (divergent exploration) with resume (continuation). ✓ Fresh session + structured summary + named changed files for targeted re-analysis.

1.7.6 Put It Together: Practise All Three Moves

You now have the three session moves, the flags that trigger them, and — most importantly — the stale-context trap and its cure. The exercise has you reproduce the trap deliberately, because seeing the agent give confidently wrong advice from a stale memory is what makes the fresh-start discipline stick.

1.7.6 — Build Exercise (45 min)

Practise all three. (1) Name and resume a session with --resume to continue an investigation where nothing has changed. (2) Fork from a shared codebase-analysis baseline (/branch) to compare two testing strategies; confirm the original stays intact and untouched. (3) Reproduce the stale trap: analyse several files, edit a few, --resume, and watch the agent give contradictory advice from the old contents. (4) Apply the cure — fresh session + a structured summary + the list of changed files for targeted re-analysis — and confirm the advice is now correct and consistent.

This completes Domain 1. Step back and see the arc: you learned the loop you control (1.1), how to coordinate teams of agents and pass them context (1.2–1.3), how to guarantee behaviour with enforcement and hooks (1.4–1.5), and how to structure the work itself across decomposition and sessions (1.6–1.7). Every later domain — tools, Claude Code, prompting, context management — builds on this foundation of how agentic systems actually run.

ℹ️

Where this shows up on the exam

1.7 questions describe resuming after changes, or choosing between resume/fork/fresh-start. If you always ask 'is the old context still true?' and remember that a fork inherits staleness, you'll route every scenario to the right move.

Key Takeaways

  • A session is a saved conversation; three moves are possible — resume (continue where you stopped), fork (branch a copy to explore a different path), and fresh-start-with-summary — and the right one depends on whether the old context is still true.
  • Resume (--continue / --resume <name> / --from-pr) restores full history; it's right when prior context is still valid and nothing important has changed.
  • Fork (/branch or --fork-session) copies the conversation into an independent branch, leaving the original intact — for divergent exploration from a shared baseline.
  • Fork is NOT a staleness fix: it copies the baseline as-is, so both branches inherit the same stale facts — forking duplicates the problem rather than curing it.
  • Stale-context trap: resuming after files change makes the agent reason from cached old results; re-reading on top is insufficient because stale and fresh contents then conflict.
  • The cure for staleness: start a fresh session, inject a structured summary, and name the changed files for targeted re-analysis — re-read only what changed (e.g. 3 of 50 files), not everything.
  • Map the situation to the move: still valid → resume; want alternatives → fork; gone stale → fresh start with summary. Always ask 'is the old context still true?'

Check Your Understanding

Test what you learned in this lesson.

Q1.After analysing a 50-file codebase and editing several files, you --resume the session and the agent gives contradictory advice based on code that no longer exists. What's the most reliable fix?

Q2.You want to compare two different refactoring strategies starting from the same codebase analysis, without losing your original work. Which mechanism fits?

Q3.Only 3 of 50 analysed files changed since your last session. What's the most efficient way to bring the agent up to date?

Q4.Why is fork the WRONG tool for fixing stale tool results after files change?

Practice This Lesson