Claude Agent SDK (code.claude.com/docs/en/agent-sdk) — the official SDK for building agents in TypeScript / Python
reference.query() agent loop execution by, custom tools (in-process MCP), external MCP connections, hooks,
subagents, permissions (canUseTool), session persistence/resume/fork, streaming, structured outputs,
covers production hosting.
For the Claude Code CLI itself, see anthropic-claude-code / anthropic-claude-code-extend; for calling the Messages API directly, see
anthropic-api-core; for tool use / Agent Skills / MCP on the Claude API side, see anthropic-api-tools-mcp (this skill handles the side that builds and operates agents via the SDK).
Directory structure
skills/anthropic-agent-sdk/
SKILL.md
references/
getting-started/
README.md
agent-loop.md
claude-code-features.md
migration-guide.md
overview.md
quickstart.md
api-reference/
README.md
python.md
typescript.md
extending/
README.md
custom-tools.md
hooks.md
mcp.md
plugins.md
skills.md
slash-commands.md
subagents.md
tool-search.md
sessions-io/
README.md
file-checkpointing.md
session-storage.md
sessions.md
streaming-output.md
streaming-vs-single-mode.md
structured-outputs.md
todo-tracking.md
control/
README.md
modifying-system-prompts.md
permissions.md
user-input.md
operations/
README.md
cost-tracking.md
hosting.md
observability.md
secure-deployment.md
troubleshooting.md
samples/
README.md
minimal-agent.md
custom-tools.md
mcp-servers.md
hooks.md
permissions.md
subagents.md
sessions.md
streaming.md
structured-outputs.md
system-prompts.md
scripts/
README.md
setup.md
runtime.md
Exploration procedure
Derive the category from the task, and identify the target page in the category's README.md:
- Find the category corresponding to the task in the mapping table below
- of that category
references/{category}/README.md(samples/scripts/is the README.md directly under it) to identify the target page - Read the
.mdof the relevant page to check the details
Task → Category mapping
| Task | Category | Reference README |
|---|---|---|
| Want to know an overview of the Agent SDK and how the agent loop works / want to install it and build a first agent / migration from the Claude Code SDK / want to use Claude Code features (CLAUDE.md, Agent Skills, hooks) within the SDK | getting-started | references/getting-started/README.md |
query() や ClaudeAgentOptions / Options such as the complete types and function signatures for TypeScript / Python |
api-reference | references/api-reference/README.md |
custom tools(in-process MCP, createSdkMcpServer) / want to connect to external MCP servers / want to control tool calls with hooks / want to handle plugins / SKILL.md / slash commands / subagents / tool search |
extending | references/extending/README.md |
| Want to handle session persistence/resume/fork (resume / fork) / saving to external storage / file checkpointing / todo management / streaming output / structured outputs | sessions-io | references/sessions-io/README.md |
Want to customize the system prompt, permission mode, or canUseTool want to control permissions with / want to handle user input/approval flows |
control | references/control/README.md |
| Want to know about hosting in production environments / secure deployment / observability with OpenTelemetry / cost/token tracking / troubleshooting errors | operations | references/operations/README.md |
| Want to know typical usage (minimal agent, custom tools, MCP server connection, hooks, permissions, subagents, session continuation, streaming, structured outputs, system prompt customization) | samples | samples/README.md |
| Want to know SDK installation / API key configuration / telemetry environment variables for hosting | scripts | scripts/README.md |