anthropics

anthropics/claude-agent-sdk-python

Python MIT AI & ML
7.6k stars
1.2k forks
active
GitHub +87 / week

7.6k

Stars

1.2k

Forks

361

Open issues

30

Contributors

v0.2.115 09 Jul 2026

AI Analysis

This is the official Python SDK for Claude Agent, providing both simple query-based interfaces and bidirectional client support for building agent applications with Claude Code. It serves developers integrating Claude's capabilities into Python applications, particularly those needing tool use, custom MCP servers, and agentic workflows; it is specialized for Claude ecosystem integration rather than general-purpose LLM access.

AI & ML Developer Tool Discovery value: 4/10
Documentation 8/10
Activity 10/10
Community 9/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

claude-ai agent-sdk mcp-servers tool-use async-python
Actively maintained Well documented MIT licensed Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
2w ago

Anthropic's official Python SDK for building Claude-powered agentic applications with in-process MCP tool support

Claude Agent SDK for Python is Anthropic's official library for programmatically orchestrating Claude Code as an AI agent. It targets developers building autonomous workflows — code generation, file manipulation, multi-step reasoning — who need a structured Python interface rather than raw API calls. The SDK wraps Claude Code CLI, supports bidirectional sessions, in-process MCP tool servers, and agent hooks. It is positioned for teams embedding Claude into internal tooling, CI pipelines, or product features requiring agentic behavior.

Origin

Created June 11, 2025 — roughly a year after Claude Code's public debut. Appears to be Anthropic's response to growing demand for programmatic agent orchestration, complementing the lower-level anthropic-sdk-python and the TypeScript counterpart released around the same time.

Growth

The repo gained 7,399 stars in roughly one year with 51 stars in the last 7 days, suggesting a strong initial spike driven by Anthropic's brand and Claude Code's existing 134k-star mindshare, followed by a leveling-off to organic, steady inflow rather than viral momentum. The TypeScript counterpart has only 1,568 stars, indicating Python is the dominant adoption surface for this SDK.

In production

adoption not verified via third-party sources. The repo is official Anthropic output and has 1,110 forks, which implies developers are actively building on or experimenting with it. No documented case studies, blog post references, or community forum evidence available from metadata alone.

Code analysis
Architecture

Appears to be a thin orchestration layer that shells out to the bundled Claude Code CLI. Exposes two primary abstractions: a stateless async generator `query()` for single-shot prompts, and a stateful `ClaudeSDKClient` for multi-turn interactive sessions. In-process MCP servers likely use a lightweight local IPC or direct function dispatch to avoid subprocess overhead. Hooks appear to be Python callbacks injected at defined points in the agent loop. Overall architecture likely prioritizes composability over abstraction depth.

Tests

not documented in README

Maintenance

Last push was June 22, 2026 — 3 days before evaluation date — indicating active, ongoing maintenance. 1,110 forks suggest meaningful community engagement. Being an official Anthropic repo with recent commits signals institutional backing rather than community-driven maintenance.

Honest verdict

ADOPT IF: you are building Claude-native agentic workflows in Python and want an officially maintained, low-friction abstraction over Claude Code with in-process tool execution and session management. AVOID IF: you need vendor-agnostic orchestration, are not committed to Claude as your model, or require production-hardened guarantees — the repo is under a year old and lacks documented production validation. MONITOR IF: you are evaluating whether Anthropic's first-party agent tooling matures into the de-facto standard for Claude-based automation, particularly as MCP adoption grows.

Independent dimensions

Mainstream potential

6/10

Technical importance

7/10

Adoption evidence

3/10

Risks
  • Tight coupling to Claude Code CLI means breaking changes in Claude Code propagate directly into SDK behavior, creating upgrade friction for downstream applications.
  • Less than one year old — API surface and behavioral guarantees may still be in flux, posing stability risks for long-lived production systems.
  • Anthropic controls the entire stack; if pricing, API policy, or product direction changes, users of this SDK have limited migration paths.
  • In-process MCP server architecture, while convenient, may introduce security surface area if tool definitions are derived from untrusted inputs — not addressed in available README.
  • Relatively low adoption evidence compared to star count makes it difficult to assess real-world reliability at scale; most usage may still be experimental or prototypal.
Prediction

Likely to become the standard programmatic interface for Claude-based agent workflows among Python developers, especially as Claude Code adoption grows — but may remain Claude-ecosystem-specific rather than crossing into general agentic AI tooling.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Python
99.3%
Shell
0.7%

Information

Language
Python
License
MIT
Last updated
9h ago
Created
13mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

anthropics

anthropics/anthropic-sdk-python

The Claude SDK for Python provides official client library access to...

3.7k Python AI & ML
anthropics

anthropics/claude-agent-sdk-typescript

The Claude Agent SDK is a TypeScript library for building autonomous AI agents...

1.6k Shell AI & ML
anthropics

anthropics/claude-code

Claude Code is an agentic, terminal-based coding assistant developed by...

137.2k Python AI & ML
agentclientprotocol

agentclientprotocol/claude-agent-acp

An adapter that enables Claude Agent SDK to work with any ACP-compatible...

2.2k TypeScript AI & ML
anthropics

anthropics/claude-quickstarts

Claude Quickstarts is a curated collection of example applications...

17.2k Python AI & ML
vs. alternatives
anthropics/anthropic-sdk-python

The lower-level Anthropic SDK gives raw API access (completions, tool use). The Agent SDK wraps Claude Code CLI and adds orchestration, sessions, and in-process MCP — it solves a higher-level problem and does not replace the base SDK.

LangChain / LangGraph

LangChain provides model-agnostic agent orchestration with a large ecosystem. The Claude Agent SDK is Claude-specific and tightly coupled to Claude Code tooling, offering less portability but potentially tighter integration with Claude's native capabilities.

OpenAI Agents SDK

Structural peer — OpenAI released a similar first-party agent SDK in early 2025. Both take the approach of opinionated, model-specific orchestration. Claude's version differentiates via in-process MCP servers and hooks; OpenAI's has a longer track record.

CrewAI

CrewAI targets multi-agent role-based workflows and supports multiple LLM backends. The Claude Agent SDK is single-model and single-vendor but offers deeper native tooling integration for Claude-specific use cases.

anthropics/claude-agent-sdk-typescript

Functional peer in TypeScript. Python version has roughly 4.7x more stars, suggesting stronger adoption among the Python-heavy data/ML/backend audience Anthropic primarily targets.