6 6
7> Build production AI agents with Claude Code as a library7> Build production AI agents with Claude Code as a library
8 8
9An agent is an application that completes a task by planning its own steps and calling tools that read files, run commands, or edit code. The Agent SDK gives you the same tools, [agent loop](/docs/en/agent-sdk/agent-loop.md), and context management that power Claude Code, programmable in Python and TypeScript.9An agent is an application that completes a task by planning its own steps and calling tools that read files, run commands, or edit code. The Agent SDK gives you the same tools, [agent loop](https://code.claude.com/docs/en/agent-sdk/agent-loop.md), and context management that power Claude Code, programmable in Python and TypeScript.
10 10
11## Compare the Agent SDK to other Claude tools11## Compare the Agent SDK to other Claude tools
12 12
15| You want to | Use | What you get |15| You want to | Use | What you get |
16| - | - | - |16| - | - | - |
17| Embed Claude Code's agent in your own Python or TypeScript application, in a process you operate | **Agent SDK** | A library that runs the Claude Code binary, with Claude Code's [capabilities](#capabilities), such as built-in tools, permissions, sessions, and hooks. |17| Embed Claude Code's agent in your own Python or TypeScript application, in a process you operate | **Agent SDK** | A library that runs the Claude Code binary, with Claude Code's [capabilities](#capabilities), such as built-in tools, permissions, sessions, and hooks. |
18| Do interactive development or run one-off tasks from a terminal | [**Claude Code CLI**](/docs/en/overview.md) | The terminal interface, built for daily interactive use. |18| Do interactive development or run one-off tasks from a terminal | [**Claude Code CLI**](https://code.claude.com/docs/en/overview.md) | The terminal interface, built for daily interactive use. |
19| Call the Claude API directly from your own code | [**Client SDK**](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) | Direct access to the Claude API from any of the client SDK languages. You write the tool loop yourself, or let the client SDK's beta [tool runner](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner) drive it. |19| Call the Claude API directly from your own code | [**Client SDK**](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) | Direct access to the Claude API from any of the client SDK languages. You write the tool loop yourself, or let the client SDK's beta [tool runner](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner) drive it. |
20| Have Anthropic host the agent, configured through the Claude API | [**Managed Agents**](https://platform.claude.com/docs/en/managed-agents/overview) | A hosted agent harness that runs the agent loop, with sessions in an Anthropic-managed cloud sandbox or a [self-hosted sandbox](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes) on your own infrastructure. Use it from the [SDK for your language](https://platform.claude.com/docs/en/managed-agents/quickstart#install-the-sdk), the `ant` CLI, or the REST API. |20| Have Anthropic host the agent, configured through the Claude API | [**Managed Agents**](https://platform.claude.com/docs/en/managed-agents/overview) | A hosted agent harness that runs the agent loop, with sessions in an Anthropic-managed cloud sandbox or a [self-hosted sandbox](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes) on your own infrastructure. Use it from the [SDK for your language](https://platform.claude.com/docs/en/managed-agents/quickstart#install-the-sdk), the `ant` CLI, or the REST API. |
21 21
22To drive the same agent loop from a language other than Python or TypeScript, [run the CLI as a subprocess](/docs/en/headless.md) with the `-p` flag and `--output-format json`.22To drive the same agent loop from a language other than Python or TypeScript, [run the CLI as a subprocess](https://code.claude.com/docs/en/headless.md) with the `-p` flag and `--output-format json`.
23 23
24## Capabilities24## Capabilities
25 25
27 27
28| Capability | What it does | Learn more |28| Capability | What it does | Learn more |
29| - | - | - |29| - | - | - |
30| Built-in tools | Read, write, edit files, run commands, and search the web | [Tools reference](/docs/en/tools-reference.md) |30| Built-in tools | Read, write, edit files, run commands, and search the web | [Tools reference](https://code.claude.com/docs/en/tools-reference.md) |
31| Hooks | Run custom code at key points in the agent lifecycle | [Hooks](/docs/en/agent-sdk/hooks.md) |31| Hooks | Run custom code at key points in the agent lifecycle | [Hooks](https://code.claude.com/docs/en/agent-sdk/hooks.md) |
32| Subagents | Spawn specialized agents for focused subtasks | [Subagents](/docs/en/agent-sdk/subagents.md) |32| Subagents | Spawn specialized agents for focused subtasks | [Subagents](https://code.claude.com/docs/en/agent-sdk/subagents.md) |
33| MCP | Connect external tools and data sources via the Model Context Protocol | [MCP](/docs/en/agent-sdk/mcp.md) |33| MCP | Connect external tools and data sources via the Model Context Protocol | [MCP](https://code.claude.com/docs/en/agent-sdk/mcp.md) |
34| Permissions | Control which tools run automatically, which need approval | [Permissions](/docs/en/agent-sdk/permissions.md) |34| Permissions | Control which tools run automatically, which need approval | [Permissions](https://code.claude.com/docs/en/agent-sdk/permissions.md) |
35| Sessions | Maintain context across exchanges, resume or fork later | [Sessions](/docs/en/agent-sdk/sessions.md) |35| Sessions | Maintain context across exchanges, resume or fork later | [Sessions](https://code.claude.com/docs/en/agent-sdk/sessions.md) |
36| Skills, commands, and memory | Load automatically from your project's `.claude/` and from `~/.claude/`, same as Claude Code | [Skills](/docs/en/agent-sdk/skills.md), [Commands](/docs/en/agent-sdk/skills.md#commands-in-agent-sdk-sessions), [Memory](/docs/en/agent-sdk/modifying-system-prompts.md), [Configuration loading](/docs/en/agent-sdk/claude-code-features.md) |36| Skills, commands, and memory | Load automatically from your project's `.claude/` and from `~/.claude/`, same as Claude Code | [Skills](https://code.claude.com/docs/en/agent-sdk/skills.md), [Commands](https://code.claude.com/docs/en/agent-sdk/skills.md#commands-in-agent-sdk-sessions), [Memory](https://code.claude.com/docs/en/agent-sdk/modifying-system-prompts.md), [Configuration loading](https://code.claude.com/docs/en/agent-sdk/claude-code-features.md) |
37| Plugins | Package skills, agents, hooks, and MCP servers, and load them by local path | [Plugins](/docs/en/agent-sdk/plugins.md) |37| Plugins | Package skills, agents, hooks, and MCP servers, and load them by local path | [Plugins](https://code.claude.com/docs/en/agent-sdk/plugins.md) |
38 38
39## Get started39## Get started
40 40
41Follow the [Quickstart](/docs/en/agent-sdk/quickstart.md) to install the SDK, set your API key, and build your first agent, one that finds and fixes bugs in existing code.41Follow the [Quickstart](https://code.claude.com/docs/en/agent-sdk/quickstart.md) to install the SDK, set your API key, and build your first agent, one that finds and fixes bugs in existing code.
42 42
43> [!NOTE]43> [!NOTE]
44>44>
45> Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK. Use the API key authentication methods described in the [Quickstart](/docs/en/agent-sdk/quickstart.md) instead.45> Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK. Use the API key authentication methods described in the [Quickstart](https://code.claude.com/docs/en/agent-sdk/quickstart.md) instead.
46 46
47## Changelog47## Changelog
48 48
83 83
84These resources cover deeper technical detail and example projects for building with the Agent SDK.84These resources cover deeper technical detail and example projects for building with the Agent SDK.
85 85
86* [Quickstart](/docs/en/agent-sdk/quickstart.md): build your first agent that finds and fixes bugs86* [Quickstart](https://code.claude.com/docs/en/agent-sdk/quickstart.md): build your first agent that finds and fixes bugs
87* [Migration guide](/docs/en/agent-sdk/migration-guide.md): migrate from the Claude Code SDK packages to the Agent SDK87* [Migration guide](https://code.claude.com/docs/en/agent-sdk/migration-guide.md): migrate from the Claude Code SDK packages to the Agent SDK
88* [Agent loop](/docs/en/agent-sdk/agent-loop.md): how Claude plans, calls tools, and decides when a task is done88* [Agent loop](https://code.claude.com/docs/en/agent-sdk/agent-loop.md): how Claude plans, calls tools, and decides when a task is done
89* [Example agents](https://github.com/anthropics/claude-agent-sdk-demos): demo apps for local development89* [Example agents](https://github.com/anthropics/claude-agent-sdk-demos): demo apps for local development
90* [TypeScript SDK](/docs/en/agent-sdk/typescript.md): full TypeScript API reference and examples90* [TypeScript SDK](https://code.claude.com/docs/en/agent-sdk/typescript.md): full TypeScript API reference and examples
91* [Python SDK](/docs/en/agent-sdk/python.md): full Python API reference and examples91* [Python SDK](https://code.claude.com/docs/en/agent-sdk/python.md): full Python API reference and examples
92* [Agent harness design](https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code): how the Claude Code team uses dynamic workflows to orchestrate many subagents at once92* [Agent harness design](https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code): how the Claude Code team uses dynamic workflows to orchestrate many subagents at once