Claude Agent SDK
Build production AI agents with Claude Code as a library.
What it is
The Claude Agent SDK (formerly the Claude Code SDK) is a Python/TypeScript library that runs Claude Code's agent loop, built-in tools, and context management inside your own process, so agents can autonomously read files, run commands, search the web, and edit code.
At a glance
7/7 facts sourced- Pricing
- The SDK library is free (the Python repo is MIT), but use is governed by Anthropic's Commercial Terms of Service and you pay Claude API token costs (or via Bedrock/Vertex/Azure).source ↗
- Hosting model
- A self-deployed library that runs the agent loop inside your own process; a separate hosted option (Managed Agents, an Anthropic-run sandbox per session) also exists.source ↗
- Memory & state
- Sessions maintain context across exchanges (files read, analysis, history), are resumable and forkable, and are stored as JSONL on your filesystem; it also supports CLAUDE.md memory files and automatic context compaction.source ↗
- MCP support
- Nativesource ↗
- Integrations
- Built-in tools (Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch), lifecycle hooks, subagents, permissions, Skills, slash commands, and plugins.source ↗
- Model providers
- Anthropic-first (Claude models); authenticates via the Anthropic API, Amazon Bedrock, Google Vertex AI, or Microsoft Azure AI Foundry. No non-Claude model support is indicated.source ↗
- Open source
- Yessource ↗
Editorial scorecard
Overall 4.2 / 5
Our opinion — the same 0–5 rubric is applied to every platform, including Alfe. See the rubric.
Strengths
- Ships the same agent loop, tools, and context compaction that power Claude Code.
- Native MCP plus subagents, hooks, skills, and resumable/forkable sessions.
- Multiple auth backends — Anthropic API, Bedrock, Vertex, and Azure.
Trade-offs
- Claude-only — no non-Anthropic model support.
- Governed by Anthropic's Commercial Terms of Service rather than a blanket permissive license, despite the MIT-licensed Python repo.
- You pay Claude token costs and run your own infrastructure, unless you move to the hosted Managed Agents option.
Our take
Editorial opinion — not a hands-on test resultIn our opinion, the Claude Agent SDK is a strong option when you want a proven, feature-rich agent runtime and are committed to Claude models. Its tooling — subagents, hooks, skills, resumable sessions, and first-class MCP — is among the most complete of the SDKs here. The trade-off is single-vendor model lock-in and the commercial-terms governance layer over the MIT repo.
FAQ
- Is this the old Claude Code SDK?
- Yes — it was renamed from the Claude Code SDK to the Claude Agent SDK.
- Where does session state live?
- As JSONL on your own filesystem — sessions are resumable and forkable.
Compare Claude Agent SDK
Sources
- Claude Agent SDK overview · accessed 2026-07-01
- Claude Agent SDK (Python) on GitHub · accessed 2026-07-01
- Building agents with the Claude Agent SDK · accessed 2026-07-01
The Agent Examiner editorial · last updated 2026-07-01. Facts are drawn from each vendor’s own public materials; scores are our editorial opinion (methodology).
Product and company names are trademarks of their respective owners and are used here only to identify the products under discussion.