Claude Agent SDK for Python is a Python SDK for building agents with Claude that provides both simple query interfaces and stateful interactive conversations.
The SDK addresses the need to integrate Claude's agentic capabilities into Python applications. It offers two primary approaches: a `query()` function for one-off requests to Claude Code, and a `ClaudeSDKClient` for bidirectional, interactive conversations that maintain state across multiple exchanges. The tool automatically bundles the Claude Code CLI, eliminating separate installation steps. Developers can control which tools Claude accesses through permission allowlists and blocklists, with decisions flowing through a defined evaluation order.
The SDK distinguishes itself by supporting custom tools implemented as in-process MCP servers, allowing Python functions to be offered to Claude without spawning separate processes. This eliminates subprocess management overhead, reduces inter-process communication latency, and simplifies debugging since all code runs in a single Python process. The tool also supports hooks, which are Python functions that the application invokes at specific points in the agent loop to provide deterministic processing and automated feedback. Developers can mix in-process custom tools with external MCP servers in the same application. The project suits teams building Python applications that need Claude to act autonomously on their behalf, particularly those wanting to extend Claude's capabilities with application-specific functions or intercept and control agent behavior at key decision points.
Development activity shows consistent engagement with the codebase through regular commits addressing both features and maintenance. The project maintains active documentation updates alongside code changes, indicating attention to keeping guidance current with implementation. Pull request activity demonstrates ongoing refinement of the SDK's interfaces and capabilities. Issue tracking reflects responsiveness to user-reported problems and feature requests.