Study FAQ
What should a Claude agent persist to resume safely after an interruption?
Also asked as 2
- How can an interrupted Claude agent recover from its last trustworthy checkpoint?
- What belongs in a durable Claude agent checkpoint and action ledger for safe resume?
Answer
To resume an interrupted Claude agent, load the workflow's last committed checkpoint and reconcile pending external actions before advancing. An Agent SDK session can restore conversational context. Use the application's action ledger and the owning systems to establish which effects actually took place.
A checkpoint should identify the run and compatible configuration version, durable stage and acceptance state, worker IDs and deadlines, current artifact and context references, and the last known stop or interruption reason. Record an action intent and idempotency key before dispatch, then persist its confirmed outcome with a stable result reference. Save approval scope and expiry so you can revalidate authority when resuming. Keep this evidence under a retention policy that fits the task.
When the runner restarts, reclaim unfinished work under its concurrency policy and rebuild context from approved records. If a write timed out, read its authoritative status before retrying. Reuse a confirmed result and continue from its recorded transition. If the action definitely did not run, perform only that missing step under its current authorization. If you still cannot determine what happened, escalate instead of replaying the run. Use comparable checks for worker cancellation, duplicate dispatch, and failure of the coordinator. The recovery trace should identify the state selected, reconciliation evidence, and the verified outcome.
Full explanation
Building Claude Agents with the Agent SDK, Custom Loops, and Frameworks
Study guide · CCDV-F
Read the full explanation