Claude Agent SDK

Anthropic's Python and TypeScript SDK exposing the Claude Code agent engine as a library.

Open Source
0.0 (0)

About

Rather than reimplementing an agent loop, developers can pull in the exact engine that powers Claude Code: Anthropic packages it as the Claude Agent SDK for Python and TypeScript, MIT licensed on GitHub. A simple async query interface streams messages from a running agent, while a client class holds bidirectional interactive sessions. Tools defined as plain decorated functions become in-process MCP servers with no separate process to manage, and these mix freely with external MCP servers. Hooks intercept the loop at points like PreToolUse for validation or policy enforcement, and permission controls pre-approve, block, or gate individual tools. Subagents, working directory control, and file tools such as Read, Write, Edit, and Bash carry over from Claude Code, whose CLI ships bundled with the package, so pip install claude-agent-sdk is the only setup beyond Python 3.10 or newer. The Python repository stands at about 8,000 stars, and the SDK has become the default route for teams building custom autonomous agents on Anthropic models, from CI bots to internal operations agents.

Should you use Claude Agent SDK?

Pick it when

Pick it when you build on Claude models and want the same loop, file tools, subagents, hooks, and permission gates that Claude Code uses, for example CI bots or internal operations agents, without writing your own agent loop.

Look elsewhere when

It is built around Anthropic's Claude models, so it is the wrong base if you need to switch model providers freely or compare vendors in one codebase. OpenAI Agents SDK, Pydantic AI, or Strands Agents keep the model layer swappable.

Alternatives to Claude Agent SDK

  • OpenAI Agents SDK

    Works with 100+ LLMs using handoffs and guardrails; more provider freedom, but you do not get Claude Code's engine and its built-in file tools.

  • Deep Agents

    Similar planning, filesystem, and sub-agent harness on LangGraph that works with any tool-calling model, including open weights.

  • Strands Agents

    Model-driven loop with Bedrock, Anthropic, OpenAI, and Ollama providers plus OpenTelemetry; provider freedom, but not Claude Code's coding-agent engine.

  • Open Interpreter

    Finished terminal coding agent tuned for low-cost models; a tool to use as is, rather than an SDK to embed in your own app.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Intermediate (3/5)
License
MIT
Added
Aug 24, 2026

Tags