Comprehensive knowledge of Claude Agent SDK architecture, tools, hooks, skills, and production patterns. Auto-activates for agent building, SDK integration, tool design, and MCP server tasks.
View on GitHub.claude/skills/agent-sdk/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/rysweet/amplihack/blob/main/.claude/skills/agent-sdk/SKILL.md -a claude-code --skill agent-sdkInstallation paths:
.claude/skills/agent-sdk/# Claude Agent SDK - Comprehensive Skill
## Overview
The **Claude Agent SDK** is Anthropic's official framework for building production-ready AI agents with Claude. It provides a high-level abstraction over the Messages API, handling the agent loop, tool orchestration, context management, and extended-thinking patterns automatically.
### When to Use the Agent SDK
**Use the Agent SDK when:**
- Building autonomous agents that need to use tools iteratively
- Implementing agentic workflows with verification and iteration
- Creating subagent hierarchies for complex task decomposition
- Integrating MCP (Model Context Protocol) servers for standardized tools
- Need production patterns like hooks, permissions, and context management
**Don't use when:**
- Simple single-turn API calls suffice (use Messages API directly)
- No tool use required (standard chat)
- Custom agent loop logic needed (SDK loop is opinionated)
### Language Support
- **Python**: `claude-agents` package (recommended for most use cases)
- **TypeScript**: `@anthropics/agent-sdk` package (Node.js environments)
Both implementations share the same core concepts and API patterns.
## Quick Start
### Installation
**Python:**
```bash
pip install claude-agents
```
**TypeScript:**
```bash
npm install @anthropics/agent-sdk
```
### Authentication
Set your API key as an environment variable:
```bash
export ANTHROPIC_API_KEY="your-api-key-here"
```
Or pass it explicitly in code:
```python
from claude_agents import Agent
agent = Agent(api_key="your-api-key-here")
```
### Basic Agent Creation
**Python Example:**
```python
from claude_agents import Agent
# Create agent with default settings
agent = Agent(
model="claude-sonnet-4-5-20250929",
system="You are a helpful assistant focused on accuracy."
)
# Run simple task
result = agent.run("What is 2+2?")
print(result.response)
```
**TypeScript Example:**
```typescript
import { Agent } from "@anthropics/agent-sdk";
const agent = new Agent(