The Claude Agent SDK for Python is Anthropic’s official open-source SDK for building AI agents with Claude, published on GitHub with around 8,300 stars. It packages the same agent loop and tool set that power Claude Code into a Python library, so you can embed a full coding-capable agent inside your own applications.
Installation is a single pip command, and the Claude Code CLI is bundled with the package, so there is nothing else to set up. The simplest entry point is the async query() function, which streams messages from an agent given a prompt and options. For interactive, bidirectional sessions you use ClaudeSDKClient, which unlocks two signature capabilities: custom tools defined as plain Python functions and exposed to Claude through in-process MCP servers — no separate server process needed — and hooks, Python callbacks that intercept points in the agent loop to enforce policies such as blocking unsafe shell commands. By default the agent can use the complete Claude Code toolset (Read, Write, Edit, Bash and more), with permission allowlists and permission modes giving you fine-grained control over what runs automatically. The SDK is under very active development, with frequent releases continuing through late 2026.
The SDK itself is free and open source under the MIT license. Running agents consumes Claude usage, so you pay Anthropic’s normal API or subscription pricing for the model calls your agents make.
This SDK is for Python developers building agentic products on Claude — internal automation, coding assistants, data pipelines, and support tools — who want the proven Claude Code harness instead of assembling an agent loop from scratch.