D3.4 · Claude Code Configuration & Workflows20% of CCA-F8 min read

Checkpoints & Session Management.

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

Mental modelCheckpoints save and restore conversation state.
Checkpoints & Session Management, hero illustration featuring Loop mascot in a warm gallery scene.
Share
On this page
01 · Summary

TLDR

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

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.

Show 2 more examples

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.

01Summarize the conversation at each
× Looks right
Summarize the conversation at each checkpoint to save tokens.
✓ What wins
Summarization erases precision.

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

02Checkpoints and fork_session do the
× Looks right
Checkpoints and fork_session do the same thing.
✓ What wins
Different.

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

03If a session crashes, just
× Looks right
If a session crashes, just start over; files are saved.
✓ What wins
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.

04Use checkpoints only for infrastructure
× Looks right
Use checkpoints only for infrastructure failures.
✓ What wins
Checkpoints are for any resumption: daily breaks, phase boundaries, human review gates.

Waiting for failure is reactive; checkpointing by design is proactive.

05Merge two checkpoints from different
× Looks right
Merge two checkpoints from different sessions into one.
✓ What wins
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

↔ scroll to compare
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.

6 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.

Question 1 of 6 · D1Choose the best answer

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

10 · FAQ

Frequently asked

Showing 10 of 10 questions

Help someone pass

Share this concept.

One share is one less person stuck on the same question.

Last reviewed: 2026-05-04·Refresh cadence: monthly