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.
Scanned 6/8/2026
Install via CLI
openskills install agentskillexchange/skills---
name: "Embed bounded Claude Code sessions into Python automation with the Claude Agent SDK"
slug: "embed-bounded-claude-code-sessions-into-python-automation-with-the-claude-agent-sdk"
description: "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."
github_stars: 6390
verification: "security_reviewed"
source: "https://github.com/anthropics/claude-agent-sdk-python"
author: "Anthropic"
publisher_type: "organization"
category: "Developer Tools"
framework: "Claude Code"
tool_ecosystem:
github_repo: "anthropics/claude-agent-sdk-python"
github_stars: 6390
npm_package: "claude-agent-sdk"
---
# 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](https://platform.claude.com/docs/en/agent-sdk/python) 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
- https://github.com/anthropics/claude-agent-sdk-python
## Source
- [Agent Skill Exchange](https://agentskillexchange.com/skills/embed-bounded-claude-code-sessions-into-python-automation-with-the-claude-agent-sdk/)
No comments yet. Be the first to comment!