Claude Agent SDK
AnthropicPython library that puts Claude Code's agent loop inside an application. It starts the Claude Code command-line binary as a subprocess and exposes its built-in file, shell and search tools, permission controls, sessions, hooks and subagents through Python calls, with custom tools written as Python functions served as in-process MCP servers. Anthropic publishes the wrapper and bundles the Claude Code binary in each platform wheel.
Openness
2 high confidence- license
- MIT(Python SDK wrapper)+Proprietary(bundled Claude Code CLI, all rights reserved under Anthropic's Commercial Terms of Service)
- source
- partial(the Python wrapper is public
The Python wrapper is MIT licensed, but it cannot run without the Claude Code binary it bundles, and that binary is closed and licensed under Anthropic's Commercial Terms of Service. Anthropic's documentation says those terms govern use of the SDK as a whole, so the open part is the interface to the agent rather than the agent.
- https://code.claude.com/docs/en/agent-sdk/overview recorded 2026-10-07
The overview describes the Agent SDK as "A library that runs the Claude Code binary" and says "Use of the Claude Agent SDK is governed by Anthropic's Commercial Terms of Service", except where a component's own LICENSE file says otherwise.
- https://pypi.org/pypi/claude-agent-sdk/json recorded 2026-10-07
claude-agent-sdk 0.2.164 ships five platform wheels of roughly 97 to 110 MB each beside a 365 KB sdist, the size difference being the bundled Claude Code binary.
- https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/main/LICENSE recorded 2026-10-07
The repository LICENSE is the MIT text: "MIT License" and "Copyright (c) 2025 Anthropic, PBC".
- https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/main/README.md recorded 2026-10-07
The README says "The Claude Code CLI is automatically bundled with the package - no separate installation required! The SDK will use the bundled CLI by default."
- https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/main/scripts/download_cli.py recorded 2026-10-07
The wheel build script's docstring reads "Download Claude Code CLI binary for bundling in wheel", fetched "using the official install script and place it in the package directory."
- https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/main/src/claude_agent_sdk/_internal/transport/subprocess_cli.py recorded 2026-10-07
The transport looks for the bundled CLI, then a claude binary on PATH, and otherwise raises CLINotFoundError: "Claude Code not found."
- https://raw.githubusercontent.com/anthropics/claude-code/main/LICENSE.md recorded 2026-10-07
The Claude Code LICENSE.md is a bare notice: "© Anthropic PBC. All rights reserved. Use is subject to Anthropic's [Commercial Terms of Service]".
Adoption
5 medium confidenceAdoption is read from PyPI downloads of claude-agent-sdk over the trailing month. Each install also delivers the bundled Claude Code binary, and some of the volume comes from CI runs, so it counts installs rather than developers; the TypeScript SDK on npm is not included.
- https://pypistats.org/api/packages/claude-agent-sdk/recent recorded 2026-10-07
29,777,372 downloads in the trailing 30 days for claude-agent-sdk (pypistats last_month)
Capability
5 medium confidenceThe SDK drives the same agent loop, built-in tools and context management that power Claude Code, so it does what Claude Code does, called from Python instead of a terminal. Anthropic publishes no separate benchmark for the SDK.
- https://code.claude.com/docs/en/agent-sdk/overview recorded 2026-10-07
The overview says "The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript."
- https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/main/README.md recorded 2026-10-07
The README documents query() and ClaudeSDKClient, "the full Claude Code toolset (Read, Write, Edit, Bash, and others)", permission modes, hooks and custom tools run as in-process SDK MCP servers; no benchmark figure.
Verified 2026-10-07, except some scores, still awaiting re-confirmation