Claude Agent SDK
Anthropic's official SDK for building production AI agents with the same loop that powers Claude Code.
About
The Claude Agent SDK (renamed from the Claude Code SDK on September 29, 2025) exposes the exact agent loop, built-in tools, permission system, and context management that power Claude Code as a programmable library for Python and TypeScript. Instead of hand-rolling tool-calling loops, developers import a battle-tested harness: the agent can read and write files, run terminal commands, search codebases, browse the web, delegate to subagents, and connect to external systems via MCP, with hooks for custom behavior at lifecycle points and sandboxing for command execution.
Anthropic positions it as the middle rung of its documented build ladder: raw Client SDK for API calls, Agent SDK to run the loop in your own process, and hosted Managed Agents for production REST deployment — prototype locally with the Agent SDK, then move to Managed Agents. Honest caveats: it locks you to Claude models (no provider switching), and it does not offer arbitrary LangGraph-style state graphs, so teams needing fine-grained control over each loop iteration or custom topologies may find it constraining.
What it can do
- Production agent loop with error handling and retries
- Built-in tools: Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch
- Subagents for parallel task execution within a session
- Hooks, permissions system, and auto-compacting context management
- MCP client support and session persistence
Setup
pip install claude-agent-sdk (Python) or npm install @anthropic-ai/claude-agent-sdk (TypeScript).
Prerequisites
An Anthropic API key; Python 3.10+ or Node.js 18+.
Use cases
Works with
Trust score — 9/10
Scored 9/10 (verified tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 70; Trending score 90/100 from researcher assessment.
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.