Skip to content
Back to skills

Claude Agent Sdk

FSecurity

Official Anthropic SDK for building multi-agent systems. Provides agent loops, tool use, subagent spawning, session management.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentspythongobashapidocumentation

Works with

  • claude code
  • cli
  • api

Security analysis

F38/100
  • criticalPipes output to a shell interpreter
  • mediumUses curl or wget to download content
  • criticalDownloads and executes remote scripts — classic supply chain attack
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add thiagofernandes1987-create/APEX --skill claude-agent-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Agent Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Claude Agent Sdk
[![Security: F — Skills Directory](https://www.skillsdirectory.com/api/skills/thiagofernandes1987-create-claude-agent-sdk/badge)](https://www.skillsdirectory.com/skills/thiagofernandes1987-create-claude-agent-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
skill_id: algorithms.claude_agent_sdk.python
name: "Claude Agent SDK -- Python"
description: "Official Anthropic SDK for building multi-agent systems. Provides agent loops, tool use, subagent spawning, session management."
version: v00.33.0
status: ADOPTED
domain_path: algorithms/claude-agent-sdk
anchors:
  - agent_sdk
  - multi_agent
  - subagent
  - tool_use
  - agent_loop
  - session
  - anthropic_sdk
source_repo: claude-agent-sdk-python
risk: safe
languages: [python]
llm_compat: {claude: full, gpt4o: minimal, gemini: minimal, llama: minimal}
apex_version: v00.33.0
executor: LLM_BEHAVIOR
---

# Claude Agent SDK (Python)

## Why This Skill Exists

Official Anthropic library for production multi-agent systems.

## Installation

```bash
pip install claude-agent-sdk
```

## Core Usage Pattern

```python
# WHY: Agent SDK handles loop, tool dispatch, response management
# WHEN: Building multi-step autonomous agents with tool use
# HOW: Create agent, define tools, run with prompt
# WHAT_IF_FAILS: Check API key, tool schema, context window

import anthropic
from claude_agent_sdk import Agent, tool

@tool
def search(query: str) -> str:
    """Search for information."""
    return f"Results for: {query}"

agent = Agent(model="claude-opus-4-6", tools=[search])
result = agent.run("Research APEX framework")
print(result.final_response)
```

## Source 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

```bash
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

```python
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).

```python
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

By default, Claude has access to the full [Claude Code toolset](https://code.claude.com/docs/en/settings#tools-available-to-claude) (Read, Write, Edit, Bash, and others). `allowed_tools` is a permission allowlist: listed tools are auto-approved, and unlisted tools fall through to `permission_mode` and `can_use_tool` for a decision. It does not remove tools from Claude's toolset. To block specific tools, use `disallowed_tools`. See the [permissions guide](https://platform.claude.com/docs/en/agent-sdk/permissions) for the full evaluation order.

```python
options = ClaudeAgentOptions(
    allowed_tools=["Read", "Write", "Bash"],  # auto-approve these tools
    permission_mode='acceptEdits'  # auto-accept file edits
)

async for message in query(
    prompt="Create a hello.py file",
    options=options
):
    # Process tool use and results
    pass
```

### Working Directory

`

## Diff History
- **v00.33.0**: Ingested from claude-agent-sdk-python-main

Files in this skill

  • SKILL.md3.9 KB
  • src/.claude/agents/test-agent.md186 B
  • src/.claude/commands/commit.md624 B
  • src/.claude/commands/generate-changelog.md822 B
  • src/.claude/settings.json568 B
  • src/.dockerignore377 B
  • src/.github/workflows/auto-release.yml1.8 KB
  • src/.github/workflows/build-and-publish.yml7.2 KB
  • src/.github/workflows/build-wheel-check.yml3.9 KB
  • src/.github/workflows/claude-code-review.yml1.6 KB
  • src/.github/workflows/claude-issue-triage.yml4.6 KB
  • src/.github/workflows/claude.yml2 KB
  • src/.github/workflows/lint.yml562 B
  • src/.github/workflows/publish.yml1.9 KB
  • src/.github/workflows/pypi-quota-check.yml2.3 KB
  • src/.github/workflows/slack-issue-notification.yml1.1 KB
  • src/.github/workflows/test.yml5.1 KB
  • src/.gitignore443 B
  • src/CHANGELOG.md23.5 KB
  • src/CLAUDE.md677 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…