Claude Code SDK Python — Development skill for Claude Code
The official Python SDK for Claude Code.
How to install Claude Code SDK Python
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anthropics/claude-agent-sdk-python and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code SDK Python does
Python SDK for Claude Agent. See the [Claude Agent SDK documentation](https://platform.claude.com/docs/en/agent-sdk/python) for more information.
Alternatives in Development
- Anthropic Cookbook — Official examples and guides from Anthropic 36.3k ★
- MCP Python SDK — Python SDK for building MCP servers 22.3k ★
- Claude Plugins Official — Anthropic-managed directory of high quality Claude Code Plugins 14.9k ★
README
Claude Agent SDK for Python
Python SDK for Claude Agent. See the [Claude Agent SDK documentation](https://platform.claude.com/docs/en/agent-sdk/python) for more information.
Installation
pip install claude-agent-sdk
**Prerequisites:**
- Python 3.10+
**Note:** The Claude Code CLI is automatically bundled with the package - no separate installation required! The SDK will use the bundled CLI by default. If you prefer to use a system-wide installation or a specific version, you can:
- Install Claude Code separately:
curl -fsSL https://claude.ai/install.sh | bash - Specify a custom path:
ClaudeAgentOptions(cli_path="/path/to/claude")
Quick Start
import anyio
from claude_agent_sdk import query
async def main():
async for message in query(prompt="What is 2 + 2?"):
print(message)
anyio.run(main)
Basic Usage: query()
`query()` is an async function for querying Claude Code. It returns an `AsyncIterator` of response messages. See [src/claude_agent_sdk/query.py](src/claude_agent_sdk/query.py).
from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage, TextBlock
# Simple query
async for message in query(prompt="Hello Claude"):
if isinstance(message, AssistantMessage):
for block in message.content:
if isinstance(block, TextBlock):
print(block.text)
# With options
options = ClaudeAgentOptions(
system_prompt="You are a helpful assistant",
max_turns=1
)
async for message in query(prompt="Tell me a joke", options=options):
print(message)
Using Tools
...
Related Skills
ClaudeAgentSDK
Swift SDK for Claude Code — feature parity with the official Python SDK
Project R0x
Official SDK, Claude Code plugin and facilitator docs for r0x, the x402 facilitator for Robinhood Chain.
Denied SDK
Official SDKs for the Denied authorization platform.
Pyright Lsp
Python /plugin install pyright-lsp@claude-plugins-official
P123 Claude Skill
Agent Skill for Portfolio123 (P123): 464 functions, 4456 factors, verified line-by-line against official docs.
Claude Visio Diagrams
Native Visio (.vsdx) + PDF network diagrams from a BOM with official Cisco stencils - stdlib Python, Claude Co
Related Agents
Al Agent Builder
Agent Toolkit Builder — specialist in designing and coding Business Central agents using the AI Development To
MCP Currency
MCP protocol & Kotlin SDK currency expert. Researches the latest MCP spec revision, kotlin-sdk-server releases
SDK Researcher
Deep-research a specific SDK or service. Reads official docs, finds all credentials requirements, documents AP