D3.4 · Domain 3 · Agent Operations · 20% of CCA-F

Checkpoints & Session Management.

8 min read·10 sections·Tier A

Checkpoints save and restore conversation state. A full deep-dive guide is coming soon. Claude Code checkpoints

Stub, research neededDomain 3
Checkpoints & Session Management, hero illustration featuring Loop mascot in a warm gallery scene.
Domain D3Agent Operations · 20%
On this page
01 · Summary

TLDR

Checkpoints save and restore conversation state. A full deep-dive guide is coming soon. Claude Code checkpoints

C
Coverage tier
D3
Exam domain
stub
Status
thin
Vault depth
research
Action
02 · Definition

What it is

A checkpoint is a saved state snapshot of a multi-turn Claude session, designed for resuming long-running work across days or after infrastructure failures. After turn 12 of a 30-turn project, save state (history, file context, progress) to disk. Tomorrow, load that checkpoint, continue from turn 13, agent picks up with full context. Checkpoints are state persistence, not summarization.

The critical distinction: checkpoints preserve the full conversation thread, not a summary. Different from progressive summarization, which compresses history. Summarization loses transactional details (order IDs, amounts, deadlines); checkpoints keep them verbatim in the original messages. When you resume, Claude sees the full prior conversation. Preserves precision for financial, legal, medical use cases.

Checkpoints are scoped to single-session resumption, not multi-session fusion. Session A crashes at turn 12, load checkpoint, resume in same session at turn 13. You do not fork session A into session B. Linear resumption, not branching (that would be fork_session, a different pattern).

The use-case cluster is long-running work: multi-day research, 20+ file refactor, hour-spanning data pipelines. Triggers: daily boundaries, infrastructure limits, failure recovery. After 8 hours of work, save a checkpoint. If Claude times out at 2 AM, load yesterday's checkpoint. Checkpoints are the human-friendly recovery mechanism for work too large for one continuous session.

03 · Mechanics

How it works

Checkpointing has three stages. Capture: at a milestone, export conversation history (messages, tool results, file state) to JSON. Not a summary, the exact message sequence. Store: in version control, cloud storage, or local disk. Restore: next session, load the file, inject messages back into Claude's context, continue. Claude resumes with full memory of prior turns.

The message list in a checkpoint is immutable. When you restore, you inject all prior messages exactly as they were. No rewriting, no compression, no summarization. This is why precision is preserved: a customer ID from turn 8 is still verbatim in turn 13. Contrast with summarization, where turn 8-10 collapse to two sentences.

Checkpoints face one challenge: context window limits. A 30-turn project generates a large message list; by turn 25, prior messages may get lost in the middle (lost-in-the-middle). Mitigation: include a persistent case-facts block at the start of restored context. The block does not expire even as the conversation grows.

Restoration is not automatic. You explicitly load the checkpoint and confirm before continuing. Prevents accidental context corruption (merging unrelated sessions). Flow: end session → save checkpoint → next day → load → confirm → continue. The explicit gate is where you spot issues before proceeding.

Checkpoints & Session Management mechanics, painterly diagram featuring Loop mascot.
04 · In production

Where you'll see it

Multi-day medical records extraction

1000 clinical notes, 12 hours/day. Save checkpoint after batch 333; next morning, load and continue from batch 334 with same schema and learned patterns. Without checkpointing, day 2 would re-extract or start fresh.

Cross-service API refactor over 3 days

Day 1 = dependency mapping, day 2 = schema refactoring, day 3 = migration tests. Each day saves a checkpoint. Day 2 finds an issue, revert to day 1's checkpoint and adjust. Without checkpoints, lose day 1's analysis.

Failure recovery in overnight batch

Pipeline processes 10M records via Batch API. Cluster restarts at 7.2M. Checkpoint saved every 1M records: load 7M, resume at 7M+1. Without checkpoints, restarting wastes compute on 7M records.

Long-form content with iterative refinement

50-page guide. Day 1: chapters 1-10 + checkpoint. Day 2: chapters 11-20 with full prior context. Day 3: chapters 21-50 with all consistency. Without checkpoints, day 2 lacks chapter 1-10 details.

05 · Implementation

Code examples

Save and restore a session checkpoint
import Anthropic from "@anthropic-ai/sdk";
import fs from "fs";

const client = new Anthropic();

interface Checkpoint {
  messages: Anthropic.MessageParam[];
  metadata: { savedAt: string; phase: string; objective: string };
}

function saveCheckpoint(messages: Anthropic.MessageParam[], phase: string, objective: string) {
  const cp: Checkpoint = {
    messages,
    metadata: { savedAt: new Date().toISOString(), phase, objective },
  };
  fs.writeFileSync("checkpoint.json", JSON.stringify(cp, null, 2));
  console.log(`Saved at phase ${phase}`);
}

function loadCheckpoint(): Checkpoint {
  const data = fs.readFileSync("checkpoint.json", "utf-8");
  return JSON.parse(data);
}

async function resume() {
  const cp = loadCheckpoint();
  const messages = cp.messages;
  console.log(`Resuming at ${cp.metadata.phase}, ${messages.length} prior messages`);

  messages.push({ role: "user", content: "Continue. What patterns emerge?" });
  const resp = await client.messages.create({
    model: "claude-opus-4-5",
    max_tokens: 4096,
    system: `You are continuing a multi-day research project. Phase: ${cp.metadata.phase}. Objective: ${cp.metadata.objective}.`,
    messages,
  });

  messages.push({ role: "assistant", content: resp.content });
  saveCheckpoint(messages, `phase ${parseInt(cp.metadata.phase) + 1}`, cp.metadata.objective);
}
Save full message history (not a summary); load and continue. Precision preserved across sessions.
06 · Distractor patterns

Looks right, isn't

Each row pairs a plausible-looking pattern with the failure it actually creates. These are the shapes exam distractors are built from.

Looks right

Summarize the conversation at each checkpoint to save tokens.

Actually wrong

Summarization erases precision. Checkpoints preserve the full thread; summarization is the opposite approach (and is tested as an anti-pattern).

Looks right

Checkpoints and fork_session do the same thing.

Actually wrong

Different. Checkpoints resume linearly (A → A+1 → A+2). fork_session branches (A → A1 AND A2). Don't confuse them.

Looks right

If a session crashes, just start over; files are saved.

Actually wrong

Files survive but agent context does not. A new session lacks the prior conversation: Claude repeats analysis, misses nuances, makes inconsistent decisions. Checkpoints preserve agent reasoning, not just output files.

Looks right

Use checkpoints only for infrastructure failures.

Actually wrong

Checkpoints are for any resumption: daily breaks, phase boundaries, human review gates. Waiting for failure is reactive; checkpointing by design is proactive.

Looks right

Merge two checkpoints from different sessions into one.

Actually wrong

Checkpoints are single-session snapshots. Merging is not supported; corrupts context. To combine work, use manual synthesis or explicit hand-offs (output of A as input to B).

07 · Compare

Side-by-side

AspectCheckpointsSummarizationfork_sessionSubagent
Preserves full conversation?Yes, verbatimNo (summary)Yes per forkNo, isolated
Precision loss?NoneHighNoneYes
Resumption patternLinearLossyBranchingSequential
Token budget impactGrows with historyReduced (lossy)Per branchCurrent turn only
Use caseMulti-day work, recoveryLong convos, costComparing approachesParallel tasks
ReversibilityYes (reload prior)No (data lost)Yes (merge decision)No (work discarded)
08 · When to use

Decision tree

01

Will the task span multiple days or sessions?

YesUse checkpoints. Save at daily boundaries.
NoOptional; single-session work doesn't need them.
02

Is losing fine-grained context details unacceptable?

YesCheckpoints. Never summarize. Preserve verbatim messages.
NoSummarization acceptable if token budget tight.
03

Need to compare 2+ approaches from same starting point?

YesUse fork_session, not checkpoints. Checkpoints are linear.
NoCheckpoints for linear multi-day work.
04

Resilient to infrastructure failures?

YesRecommended.
NoCheckpoints save state so failures don't lose progress.
05

Have explicit approval gates or human-in-the-loop decisions?

YesSave before and after each decision point.
NoOptional for continuous work.
09 · On the exam

Question patterns

Checkpoints & Session Management exam trap, painterly cautionary scene featuring Loop mascot.

28 V2 questions wired to this concept. Tap an answer to check it instantly — you'll see whether it's right and why — then expand the full breakdown for the mental model and all four rationales.

A subagent returns stop_reason: max_tokens with a partial summary. Production code aborts. What should it do instead?

Tap your answer to check it.

An agent loop hits stop_reason: max_tokens. Your code throws an error and exits. What should production code do?

Tap your answer to check it.

Long-document extraction dies at chapter 18 every run with stop_reason of max_tokens. What is the right fix?

Tap your answer to check it.

When you hit max_tokens, does increasing the model's context window solve the problem?

Tap your answer to check it.

For a single-file null-check fix, should you use plan mode?

Tap your answer to check it.

You are about to start a 30-file refactor. Direct execution or plan mode?

Tap your answer to check it.

22 additional questions for this concept live in the practice pillar. Take a mock exam ↗

10 · FAQ

Frequently asked

How much context is lost when resuming from a checkpoint?
Zero. Checkpoints preserve the full message list. When restored, Claude sees the complete prior conversation.
Can I edit a checkpoint before restoring?
Technically yes, but don't. Editing corrupts message sequences. If you need to correct, load and acknowledge in a new message; Claude adjusts.
What if the checkpoint is too large for the context window?
Save incremental checkpoints (one per day/phase). When resuming, load the most recent, not all 5 days. Sacrifice older context to fit.
Should I version-control checkpoints?
Yes, for recovery and audit. Commit at major milestones. Lets you revert to a prior phase if needed.
How often should I save checkpoints?
At meaningful milestones: daily, after a major phase, before risky decisions, after human approval. For a 30-turn project, ~3-5 checkpoints.
Can I share a checkpoint with a colleague?
Yes. Export, share via git/email, they import. They resume with full context. This is how teams hand off multi-day projects.
What if I load a checkpoint and make a conflicting request?
Claude respects restored context but may note the conflict. Clarify. Why explicit confirmation before continuing matters.
Is a checkpoint the same as a git commit?
No. Git commits save file state; checkpoints save agent conversation state. Together, they form a full recovery point.
Can I use checkpoints with the Batch API?
No. Batch is async, not a continuous agent session. Checkpoints are for interactive multi-turn work.
Does restoring reset the conversation counter or cost?
No. Restoring is one logical session (no reset). Tokens are charged for restored messages as if part of one continuous session.
11 · Practice with AI

Work this with your AI

Work this concept hands-on with Claude Code, Codex, or claude.ai. Copy a prompt, paste it into your assistant, and practise in tandem. Each one keeps you active (explain it back, get drilled, or build) rather than just reading.

  • Drill it like the exam (scenario MCQs)
    Practice in the exam's scenario-MCQ format with trap awareness.
  • Explain it back (Feynman)
    Build durable, transferable understanding of a concept you can half-state.
  • Test me, adapting the difficulty
    Active recall practice on a concept you think you know.
  • Check my prerequisites first
    Before studying a concept that keeps not sticking.
  • Find the high-leverage 20%
    When a domain feels too big and you are short on time.
Self-check

Test yourself

Three diagnostic questions on this primitive. Reveal each answer when you have a guess. Want a full 60-question mock? Open the mock hub →

Q1Session crashes at turn 12. You restart fresh. What did you lose?
All agent context: prior reasoning, accumulated facts, learned patterns. Files survive but agent context does not. Checkpoints preserve the full message thread, so resuming is precision-perfect.
Q2Long task: should you summarize at each checkpoint to save tokens?
No. Summarization erases precision. Checkpoints preserve the full message list (verbatim). The exam tests this distinction repeatedly: summarization is the opposite of checkpointing.
Q3Checkpoints and `fork_session`: same pattern?
Different. Checkpoints resume linearly (A → A+1 → A+2). fork_session branches from a common baseline (A → A1 AND A2). Linear resumption vs branching exploration.
Last reviewed: 2026-05-04·Refresh cadence: monthly
D3.4 · D3 · Agent Operations

Checkpoints & Session Management, complete.

You've covered the full ten-section breakdown for this primitive, definition, mechanics, code, false positives, comparison, decision tree, exam patterns, and FAQ. One technical primitive down on the path to CCA-F.

More platforms →