Embed bounded Claude Code sessions into Python automation with the Claude Agent SDK
Use the Claude Agent SDK for Python when an existing script or service needs to delegate scoped repo work to Claude Code and consume structured responses programmatically.
What it does
Embed bounded Claude Code sessions into Python automation with the Claude Agent SDK
Use the Claude Agent SDK for Python when an existing script or service needs to delegate scoped repo work to Claude Code and consume structured responses programmatically.
Prerequisites
Python 3.10+, pip, Claude Agent SDK package, Claude Code compatible credentials
Installation
Use the upstream install or setup path that matches your environment:
- pip install claude-agent-sdk
- pip install build twine
Requirements and caveats from upstream:
-
Claude Agent SDK for Python
- Python SDK for Claude Agent. See the Claude Agent SDK documentation for more information.
- Prerequisites:
Basic usage or getting-started notes:
-
bash
-
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 v...
-
Specify a custom path: ClaudeAgentOptions(cli_path="/path/to/claude")
-
Source: https://github.com/anthropics/claude-agent-sdk-python
-
Extracted from upstream docs: https://raw.githubusercontent.com/anthropics/claude-agent-sdk-python/HEAD/README.md
Documentation
Source
Capabilities
Install
Quality
deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (1,502 chars)