---
name: embed-bounded-claude-code-sessions-into-python-auto-3fd94ebffcb4
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"
  npm_weekly_downloads: 40
---

# 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

Install or set up from the source-backed 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.

- Source: https://github.com/anthropics/claude-agent-sdk-python

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


---
Source attribution: agentskillexchange
Original project: https://github.com/agentskillexchange/skills/blob/7964af467fccaf7d68a4b705bb2e26081fbdd3e8/skills/embed-bounded-claude-code-sessions-into-python-automation-with-the-claude-agent-sdk/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Agent Skill Exchange

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: agentskillexchange
Original project: https://github.com/agentskillexchange/skills/blob/7964af467fccaf7d68a4b705bb2e26081fbdd3e8/skills/embed-bounded-claude-code-sessions-into-python-automation-with-the-claude-agent-sdk/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, ML / AI Engineer
Specialties: Backend, Word Documents, Frontend, Git
Tools: GitHub, Claude Agent Sdk
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: d09d7b026705e0418747ca024455170b0cf6da7d519f613469afdbf3de5210db
