anthropics/claude-agent-sdk-python

Claude Agent SDK for Python is a Python SDK for building agents with Claude that provides both simple query interfaces and stateful interactive conversations.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 51 minutes ago
Added to GitGenius on September 8th, 2026
Created on June 11th, 2025
Open Issues & Pull Requests: 449 (+0)
GitHub issues: Enabled
Number of forks: 1,267
Total Stargazers: 8,069 (+0)
Total Subscribers: 70 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.3 days
Mean response time: 26.6 days
90th percentile: 96.0 days
Tracked items: 452

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 98% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "documentation" is answered fastest, typically in about 28 hours, while "enhancement" waits about 9 days. 63% of tracked open issues have had no activity in three months, so the open count overstates what is actively being worked. Only 9% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 187
New in 7 days: 3
Closed in 7 days: 5
Avg open age: 159 days
Stale 30+ days: 155
Stale 90+ days: 103

Recent activity

Opened in 7 days: 2
Closed in 7 days: 5
Comments in 7 days: 0
Events in 7 days: 4

Top labels

  • bug (145)
  • enhancement (101)
  • question (52)
  • documentation (24)
  • good first issue (13)
  • duplicate (11)
  • invalid (9)
  • help wanted (4)

Detailed Description

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.