Router skill for the Claude Agent SDK — Anthropic's libraries for
building autonomous AI agents that wrap the Claude Code CLI runtime.
Ships in TypeScript (`@anthropic-ai/claude-agent-sdk` on npm) and
Python (`claude-agent-sdk` on PyPI). Covers `query()` / `ClaudeSDKClient`,
hooks (PreToolUse / PostToolUse / Stop / etc.), subagents, MCP
servers (stdio / HTTP / SSE / SDK in-process), permission modes,
the sandbox (Docker / Kubernetes), structured outputs (JSON Schema
validation), session capture / resume / fork, and session storage
adapters (`SessionStore`, `InMemorySessionStore`, S3/Redis/Postgres).
Use when the user asks about: importing `@anthropic-ai/claude-agent-sdk`
in TypeScript or `from claude_agent_sdk import ...` in Python, writing
an agent that uses `query()` or `ClaudeSDKClient`, registering hooks
via the SDK (`hooks: { PreToolUse: [...] }` / `hooks={"PreToolUse": [...]}`),
defining MCP servers in SDK options, configuring `permissionMode` /
`permission_mode`, building subagents with `AgentDefiniti
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Router skill for the Claude Agent SDK — Anthropic's libraries for
building autonomous AI agents that wrap the Claude Code CLI runtime.
Ships in TypeScript (`@anthropic-ai/claude-agent-sdk` on npm) and
Python (`claude-agent-sdk` on PyPI). Covers `query()` / `ClaudeSDKClient`,
hooks (PreToolUse / PostToolUse / Stop / etc.), subagents, MCP
servers (stdio / HTTP / SSE / SDK in-process), permission modes,
the sandbox (Docker / Kubernetes), structured outputs (JSON Schema
validation), session capture / resume / fork, and session storage
adapters (`SessionStore`, `InMemorySessionStore`, S3/Redis/Postgres).
Use when the user asks about: importing `@anthropic-ai/claude-agent-sdk`
in TypeScript or `from claude_agent_sdk import ...` in Python, writing
an agent that uses `query()` or `ClaudeSDKClient`, registering hooks
via the SDK (`hooks: { PreToolUse: [...] }` / `hooks={"PreToolUse": [...]}`),
defining MCP servers in SDK options, configuring `permissionMode` /
`permission_mode`, building subagents with `AgentDefinition`, enabling
structured outputs, running agents in a Docker/K8s sandbox, capturing
and resuming sessions, mirroring session transcripts to external storage
(S3, Redis, Postgres) via `SessionStore`, or troubleshooting SDK-specific
errors (the
SDK wraps Claude Code, so its errors differ from raw Messages API
errors).
Skip: questions about the Claude Code CLI itself such as `.claude/
settings.json` or `.mcp.json` files (use claude-code), the Anthropic
Messages API directly without the SDK (use anthropic-api), the MCP
protocol spec itself (use mcp-spec), or Anthropic's hosted Managed
Agents product (use anthropic-platform-features).