---
title: "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."
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

Choose whichever fits your setup:

1. Copy this skill folder into your local skills directory.
2. Clone the repo and symlink or copy the skill into your agent workspace.
3. Add the repo as a git submodule if you manage shared skills centrally.
4. Install it through your internal provisioning or packaging workflow.
5. Download the folder directly from GitHub and place it in your skills collection.

Install command or upstream instructions:

```
Install the Python package with pip install claude-agent-sdk, configure any ClaudeAgentOptions you need such as cwd and permission handling, then call the SDK from your Python automation to run bounded agent queries.
```

## 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/)
