Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Durable Sessions for the Claude Agent SDK, in One Prompt

Description and use

Claude Agent sessions in Dapr Agents survive crashes and restarts, resuming from the last completed step and preserving approval waits.

Problem

Agents built with Claude often lose progress when a crash or restart occurs, and approval‑gated steps can be lost if they rely on in‑memory state.

Outcome

Agents survive crashes and restarts, resume from the last completed step, and approval‑gated steps persist across restarts, enabling reliable long‑running tasks.

Workflow

  • Install dapr_agents and initialize dapr
  • Define a DurableAgent with a ClaudeAgentExecutor and specify session_store and require_approval
  • Start the agent
  • Assign a multi‑step task to the agent
  • Kill the process mid‑task (e.g., kill -9)
  • Restart the agent and observe session resumption
  • Trigger an approval‑gated tool, close the laptop, and approve later; the wait survives restarts

Evidence

We shipped a Claude Agent SDK executor in Dapr Agents with durable sessions and human approvals.

Source

Now break it on purpose, because that's the whole point: Give it a multi-step task. kill -9 the process somewhere in the middle. Start it again. The session resumes where it stopped and the steps already completed come back from the journal, not from re-running Claude.

Source

  • Record date: 2026-10-13T07:56:01.563Z