Claude Agent SDK
Usage BasedBuild agents on the harness that powers Claude Code.
Published 1 October 2026
Scores
Popularity4/5
About 8K stars on the Python repo plus a similar TypeScript package, and it is the documented way to build on Claude Code, with a large ecosystem of third-party apps built on top of it.
Learning Curve2/5
A single query call with built-in tools gives a working agent in a few lines, and anyone who has used Claude Code already knows the concepts of subagents, hooks, and permissions.
Flexibility4/5
Hooks, subagents, skills, custom MCP tools, and self-hosted sandboxes let teams shape almost any agent, but the harness is opinionated and the model choice is fixed to Claude.
Performance5/5
It is the same harness Claude Code runs on, and Claude models lead agentic coding and tool-use evaluations, so agents built on it inherit strong long-horizon results.
Portability2/5
The SDK itself is open source and runs anywhere, but agents are tied to Claude models, reached through Anthropic or the cloud providers that resell them.
About Claude Agent SDK
The Claude Agent SDK packages the agent harness behind Claude Code as a library, so developers can build their own agents on the same loop, tools, and context management rather than writing them from scratch. It was released as the Claude Code SDK and renamed at its 1.0 release in September 2025, reflecting that teams use it for research, operations, support, and data agents as well as coding. It is available as a Python package and a TypeScript package.
Out of the box an agent gets Claude Code's built-in tools for reading and editing files, running shell commands, searching, and fetching from the web, plus automatic context compaction for long sessions. On top of that sit the primitives teams use to shape behaviour: subagents for delegating work in isolated contexts, lifecycle hooks that run code before or after tool calls, permission modes, skills, slash commands, resumable sessions, and custom tools exposed as in-process MCP servers or connected from external MCP servers. 2026 releases added dynamic workflows that fan one task out to many parallel subagents, and self-hosted sandboxes with MCP tunnels for teams that need tool execution on their own infrastructure.
Unlike provider-agnostic frameworks such as LangChain or the OpenAI Agents SDK, it is Claude-only. It authenticates with an Anthropic API key or through Amazon Bedrock, Google Vertex AI, or Microsoft Foundry, and it can also draw on a Claude subscription's usage limits. The SDK code is open source and free; the cost is the Claude usage it consumes. Anthropic's hosted Managed Agents offering covers teams that would rather not run the agent loop themselves.
It suits teams that want a proven, batteries-included agent with file and shell access and are happy to standardise on Claude. Developers who need to switch model vendors, or who want explicit graph control over each step, usually pick LangGraph, Pydantic AI, or the OpenAI Agents SDK instead.
Key Features
- Claude Code's agent loop and automatic context compaction as a library
- Built-in file, shell, search, and web tools
- Subagents with isolated context, including large parallel fan-outs
- Lifecycle hooks, permission modes, skills, and slash commands
- Custom tools as in-process MCP servers or external MCP connections
- Resumable sessions for long-running agents
- Python and TypeScript packages
- Runs through the Claude API, Bedrock, Vertex AI, or Foundry
Pros
- Starts from a harness already proven on real coding work instead of a blank framework
- File and shell tools work immediately, so code and data agents need little custom tooling
- Hooks and permission modes give fine-grained control over what the agent may do
- Available through the major clouds as well as Anthropic's own API
Cons
- Works only with Claude models, so there is no switching to another vendor
- Agent loops with file and shell access can use many tokens on long tasks
- Less explicit control over step-by-step flow than graph-based frameworks such as LangGraph
- Subscription billing for SDK usage has already changed once and remains in flux
Claude Agent SDK Pricing
Usage Based- · Free Python and TypeScript packages
- · Pay only for the Claude usage agents consume
- · SDK usage draws on the plan's usage limits
- · Max, Team, and Enterprise plans raise the limits
- · Standard Claude API token rates by model
- · Also billable through Bedrock, Vertex AI, or Foundry
Tools Related to Claude Agent SDK
Integrates with Claude Agent SDK(1)
The Claude Agent SDK is Anthropic's own agent harness, built to run on Claude models through the Claude API, Amazon Bedrock, Google Vertex AI, or Microsoft Foundry.
Built on (2)
The Claude Agent SDK ships as a Python package for building agents on Claude Code's harness.
The Claude Agent SDK ships a TypeScript package for building agents in JavaScript and TypeScript projects.
Alternatives to Claude Agent SDK(8)
These are the two model vendors' own agent SDKs. The OpenAI Agents SDK is provider-agnostic and built from small primitives; the Claude Agent SDK is Claude-only but ships Claude Code's full harness, with file, shell, and web tools ready to use.
The Claude Agent SDK hands control to a proven autonomous loop with subagents and hooks; LangGraph has you lay out each step as an explicit graph with state. Pick the SDK for open-ended tasks on Claude, LangGraph for controlled workflows on any model.
The Claude Agent SDK runs long, autonomous tasks with file and shell tools on Claude; the Vercel AI SDK is a provider-agnostic toolkit geared to streaming model output and tool calls into web app interfaces.
The Claude Agent SDK is a batteries-included harness with file, shell, and web tools that runs only on Claude; LangChain is a provider-agnostic toolkit of components and integrations for assembling your own agent on any model.
The Claude Agent SDK delegates work to subagents inside one Claude-driven loop; CrewAI models a team of role-based agents with assigned tasks and works with many model providers.
The Claude Agent SDK gives an agent Claude Code's built-in tools and context management but only runs on Claude; Pydantic AI is model-agnostic and focuses on type-safe, validated agent outputs in Python.
Vendor
Anthropic
Website →Tags
Details
- Maintained
- Yes
- Agent type
- Framework
- Primary language
- Python
- Open source
- Yes
- Hosting
- Self-hosted
- GitHub stars
- 8.2k
- Stars updated
- 2026-09-30