Urgent.News

What's breaking now, across thousands of outlets.

AI

Durable Sessions for the Claude Agent SDK, in One Prompt

We shipped a Claude Agent SDK executor in Dapr Agents with durable sessions and human approvals. Meaning: your Claude-built agent survives a crash mid-task, resumes with its session intact, and waits for an approval for as long as the approval takes – through restarts and deploys. Getting started is rather easy: pip install dapr - agents dapr init Then paste this into your agent definition: from…

Claude Agent SDK now supports durable sessions and human approvals, allowing agents to survive crashes and resume tasks with intact sessions. To get started, install Dapr agents and initialize the environment using pip install dapr - agents dapr init. Then, add the following code snippet to your agent definition:

from dapr_agents import DurableAgent

from dapr_agents.executors import ClaudeAgentExecutor

agent = DurableAgent(

name = "reviewer"

, executor = ClaudeAgentExecutor(session_store = statestore)

, require_approval = [merge_pr, deploy]

)

Once the agent is started, you can break it on purpose by killing the process mid-task. When you restart the agent, it will resume from the last saved point, and the previously completed steps will be retrieved from the journal instead of being re-run by Claude. You can also trigger an approval-gated tool, close your laptop, and approve the task later, and the wait time will still be remembered.

The behavior of this setup has been tested against the DaprAgents main branch, and the release notes provide the exact versions used: https://github.com/dapr/dapr-agents/releases. The same functionality works with LangChain Deep Agents, which was added to the diagrid python package earlier this year. Deep agents with long tasks particularly benefit from durable sessions.

For a guided introduction, check out the free Dapr Agents track on Dapr University: https://www.diagrid.io/university/dapr-agents. Give it a try and share your thoughts!

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Tuesday 13 October →