
Claude Agent SDK
Anthropic's SDK for building agents on the same harness as Claude Code — tool use, file and shell access, subagents and context management — in Python and TypeScript.
83 open-source projects declare Claude Agent SDK in their code; no maker's live product we track uses it yet. What makers like most: Exposes nearly everything Claude Code has, including subagents, plan mode, background tasks, plugins, shell and MCP tools, as a library. Their most common complaint: Rules on using it with a Claude subscription are confusing and keep changing, including an announced billing change that was later paused.
Profile checked
Works with AI agents:llms.txtHow makers use Claude Agent SDK
What Claude Agent SDK is used for
Claude Agent SDK vs the alternatives makers chose
| Option | Makers' products | Open source | |
|---|---|---|---|
| 66 57% | Yes | ||
| 24 21% | Yes | ||
| 16 14% | Yes | ||
| 5 4% | Yes | ||
| 3 3% | Yes | ||
| 1 1% | Yes | ||
| 0 0% | Yes |
For AI SDK & agent framework: how many of the 115 makers' products we know the AI SDK & agent framework of chose each option.
When to use Claude Agent SDK, and when not
Pick Claude Agent SDK if
- Your agent works on files and runs commands, like a coding or research agent. AI SDK & Agent Framework →
Something else fits better if
- Your app is TypeScript and you want agents without adding a Python service: AI SDK or Mastra.
- You want a small typed agent loop in Python, close to the raw API: Pydantic AI or OpenAI Agents SDK.
- You need many prebuilt connectors for models, tools and data sources: LangChain.
- Your agent is a long-running workflow with branches, saved state and human approval steps: LangGraph.
- The agent mostly retrieves and reasons over your own documents: LlamaIndex.
The Claude Agent SDK is a library that puts the agent behind Claude Code inside your own program. Instead of writing the tool-calling loop yourself, you call one function and get an agent that reads and edits files, runs shell commands, searches the web and decides when it is done.
More about Claude Agent SDK
The model to understand: when your code calls query(), the SDK starts a claude CLI process and talks to it over stdio. That process owns a shell, a working directory and session transcripts on local disk, so each running session is a long-lived process with local state, not a stateless API call. The SDK ships for Python and TypeScript; other languages can run the CLI as a subprocess with JSON output.
What a small team gets: built-in file, shell and web tools; your own functions exposed as tools through an in-process MCP server, plus external MCP servers; permission rules for which tools run without approval; hooks at points in the agent lifecycle; subagents; and sessions you can resume or fork. It calls the Claude API with an API key, or Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry. You host it yourself, usually in sandboxed containers.
The main limit is operational. Anthropic suggests about 1 GiB of RAM, 5 GiB of disk and one CPU per agent as a starting point, and transcripts and working files disappear with the container unless you persist them. For a few tool calls per request, the plain Claude client SDK is lighter.
How Claude Agent SDK itself is built
3 tools, from its own code, website and Product Hunt page.
Claude Agent SDK pros and cons
What makers like most: Exposes nearly everything Claude Code has, including subagents, plan mode, background tasks, plugins, shell and MCP tools, as a library. Their most common complaint: Rules on using it with a Claude subscription are confusing and keep changing, including an announced billing change that was later paused.
Pros
- Exposes nearly everything Claude Code has, including subagents, plan mode, background tasks, plugins, shell and MCP tools, as a library. HNHN 2HN 3HN 4
- A headless Claude Code makes custom desktop and mobile front ends far easier to maintain than scraping terminal output. HNHN 2HN 3
- Teams stand up internal agents quickly, such as Slack helpers, grading tools and agent factories. HNHN 2HN 3HN 4
- Hooks and permission controls are unusually granular for an agent SDK. HN
Cons and watch-outs
- Rules on using it with a Claude subscription are confusing and keep changing, including an announced billing change that was later paused. HNHN 2HN 3HN 4
- It feels heavy and hard to customize, essentially a thin, closed wrapper around the CLI with incomplete docs. HNHN 2
- Automations, scheduling and security boundaries need separate infrastructure you build yourself. HN
- It ties you to Claude models, so some developers build vendor-agnostic replacements. HNHN 2
Themes that recur in makers' words and Hacker News comments, each linked to what it summarises.
Reliability and open issues
The most wanted open issue on GitHub has 36 👍.
Most wanted on GitHub
- Feature Request: Go/Golang SDK Support for Claude Agent SDK👍 36 · opened Jan 2026 · active Jun 2026
- [FEATURE] Prompt Caching Support in Claude Agent SDK👍 17 · opened Mar 2026 · active Jul 2026
- Performance Issues with Server-side Multi-instance Deployment👍 16 · opened Nov 2025 · active Mar 2026
- `cwd` in ClaudeCodeOptions does not seem to be honored at all👍 14 · opened Jun 2025 · active Apr 2026
- Feature: Portable session snapshots (export/import across machines)👍 11 · opened Oct 2025 · active Oct 2025
Who uses it
No maker's live product on record yet, and 83 open-source projects that declare it in their code.
We haven't found a maker's live product that uses Claude Agent SDK yet — only the open-source projects below, which declare it in their code.
None of these in makers' own words.
Open source: a project that declares Claude Agent SDK as a dependency in its public code — verifiable, but not necessarily a live product.
What its projects tell coding agents
55 of the 62 open-source products built with Claude Agent SDK that were worked on in the last 180 days keep instruction files for coding agents — 89%, against 53% of all the projects we read. AGENTS.md is in 45, CLAUDE.md in 40.
Alternatives to Claude Agent SDK
All alternatives by situation →Further reading
Questions makers ask about Claude Agent SDK
What are the pros and cons of Claude Agent SDK?
Pros makers name: Exposes nearly everything Claude Code has, including subagents, plan mode, background tasks, plugins, shell and MCP tools, as a library. A headless Claude Code makes custom desktop and mobile front ends far easier to maintain than scraping terminal output. Teams stand up internal agents quickly, such as Slack helpers, grading tools and agent factories. Cons: Rules on using it with a Claude subscription are confusing and keep changing, including an announced billing change that was later paused. It feels heavy and hard to customize, essentially a thin, closed wrapper around the CLI with incomplete docs. Automations, scheduling and security boundaries need separate infrastructure you build yourself.
What are the alternatives to Claude Agent SDK?
For AI SDK & agent framework, the other options makers' products we track chose most are LangChain (66), Mastra (24), LlamaIndex (16), AI SDK (5), CrewAI (3), LangGraph (1). Open source or self-hostable among them: LangChain, Mastra, LlamaIndex, AI SDK, CrewAI, LangGraph. Each alternative, with the situation it fits, is on the Claude Agent SDK alternatives page.
When should you use Claude Agent SDK?
Your agent works on files and runs commands, like a coding or research agent (AI SDK & agent framework). Something else fits better if: your app is TypeScript and you want agents without adding a Python service, pick AI SDK or Mastra; you want a small typed agent loop in Python, close to the raw API, pick Pydantic AI or OpenAI Agents SDK.
Can I run it in a serverless function?
It is built for a container rather than a stateless function. Each session is a long-lived claude subprocess with its own shell, working directory and transcripts on local disk, and Anthropic's hosting guide sizes containers at roughly 1 GiB RAM, 5 GiB disk and one CPU per agent. source ↗
Can I use it through Amazon Bedrock or Google Cloud instead of the Anthropic API?
Yes. Set an environment variable for Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry and configure that cloud's credentials; otherwise it uses an Anthropic API key. source ↗
Can my users sign in with their Claude.ai subscription?
No, not without prior approval from Anthropic. Third-party products built on the SDK are expected to authenticate with API keys, not claude.ai login or its rate limits. source ↗
Which languages are supported?
Python (3.10+) and TypeScript (Node.js 18+). Both packages bundle the native Claude Code binary; from other languages you can drive the same loop by running the CLI as a subprocess with JSON output. source ↗
How do I give the agent my own tools?
Define functions with a name, description and input schema, wrap them in the SDK's in-process MCP server, and pass it in the query options. You can also connect external MCP servers and restrict which built-in tools the agent sees. source ↗
Do sessions survive a container restart?
Not by default; transcripts, memory files and working-directory files live on the container's disk. A SessionStore adapter can persist transcripts across hosts, but other files need a mounted volume or your own sync. source ↗
Is it safe to serve several customers from one container?
Only with care. By default the SDK loads settings and memory files from the filesystem, so Anthropic's guide recommends a separate working directory and config directory per tenant and disabling auto memory, or one sandboxed container per agent. source ↗
Is Claude Agent SDK free?
No permanent free tier; paid use starts at Pay per token. source ↗
Is Claude Agent SDK open source or self-hostable?
Open source, and you can self-host it. source ↗
Can AI coding agents work with Claude Agent SDK?
It serves an llms.txt docs index.
Who uses Claude Agent SDK?
No maker's live product we track yet; 83 open-source projects declare it in their code. source ↗