What's the difference between the Claude Agent SDK and Claude Managed Agents?
The Claude Agent SDK is a library you run yourself, in a process you control, embedding Claude Code’s own agent loop, tools, and hooks into your application; Claude Managed Agents is Anthropic’s hosted alternative, where Claude runs in an Anthropic-managed cloud sandbox, or a self-hosted one on your infrastructure, and you talk to it over events instead of owning the process. Anthropic’s own docs frame the SDK as a library that embeds Claude Code’s agent, its built-in tools, permissions, sessions, and hooks, into a process you operate yourself; Managed Agents is for “long-running tasks and asynchronous work” where you’d rather not build your own loop, sandbox, or tool execution layer.
Managed Agents also persists more than a bare SDK session does: conversation history, sandbox state, and outputs are stored server-side, resumable after a pause and runnable on a schedule through scheduled deployments. The tradeoff is what that history costs you: a Managed Agents session isn’t eligible for zero data retention, because there’s nothing to retain zero of once the state has to survive a pause. Grading a run you can only reconstruct from stored events afterward is a different problem than grading one your own process already watched happen.
sources
- Claude Docs: Agent SDK overview fetched
- Claude Docs: Managed Agents overview fetched