Claude Code / Reference
Claude Code Agent SDK
Agent SDK is suitable for embedding Claude Code's agent capabilities into your own products, internal platforms, or automation pipelines.

What is Agent SDK?
Claude Agent SDK uses Claude Code's agent loop as a library for building production-grade AI agents. It supports tool calls, sessions, streaming output, permissions, Hooks, MCP, Skills, Subagents, and structured output.
If the CLI/IDE allows developers to use Claude Code directly, the Agent SDK embeds this set of capabilities into their own products, internal platforms or automation systems.
core competencies
SDK documentation covers quick start, custom tools, MCP, session storage, cost tracking, file checkpoints, user input, structured output, observation and secure deployment.
Sessions and status
Persist transcript, supporting continue, resume and fork.
Tools and MCP
Let the agent call your functions, APIs, and external systems.
Permissions and user input
Handle approval requests and clarification questions to the application layer.
Production deployment
Handle isolation, credentials, observations, costs, and multi-tenant boundaries.
Differences from other Claude tools
Agent SDK is more suitable for developing products and internal systems; Claude Code CLI/IDE is more suitable for individual developers or teams to work directly; ordinary Claude Chat is more suitable for conversations and analysis.
| Tools | suitable for |
|---|---|
| Claude Code CLI/IDE | Human-in-the-loop codebase tasks. |
| Claude Code Web/Desktop | Cloud and multi-session task management. |
| Agent SDK | Embed agent capabilities into applications or automation platforms. |
Complete usage points
Supplement the core concepts, operation sequences, permission boundaries and verification requirements that are easily compressed and missed in official documents, making it easier for English readers to learn completely by page.
Agent SDK Supplement
Claude Agent SDK uses Claude Code's agent loop as a library, suitable for building your own AI agent, internal developer platform, automatic repair system, code review service or ticket processing pipeline.
SDK capabilities include tool invocation, MCP, sessions, streaming output, permissions, Hooks, Skills, Subagents, structured output, cost tracking, checkpoints, user input, and observations. It's more product-friendly than the CLI, but also requires you to take responsibility for the platform yourself.
Production must handle: multi-tenant isolation, credential management, permission approval, tool auditing, timeouts, retries, cancellations, rollbacks, cost control, and manual takeovers. Don’t design the SDK process as an unobservable black box.
Study Checklist
Put the content on this page into real tasks and use the five dimensions of entry, context, permissions, verification and team rules to check whether you have truly mastered it.
Study Checklist
After reading this page, do not just remember the concept name. You should be able to place "Claude Code Agent SDK" back into a real Claude Code engineering workflow: where the task starts, what context the system loads, which actions need approval, how the result is verified, and how to roll back when it fails.
If this is a configuration or reference page, be specific about where the configuration is placed, whether it will be submitted, whether it contains sensitive information, whether it will extend the default permissions, and how to troubleshoot the settings that actually took effect in the event of a failure.
- Be able to describe in your own words the specific problem this page solves, rather than just reciting the title.
- Able to write a minimal example task with goals, scope, prohibitions, and acceptance criteria.
- Be able to determine which information should be put into the current prompt and which should be captured as project rules or configurations.
- Be able to explain which long-term rules should go into CLAUDE.md, and which runtime behavior should be handled by settings, permissions, Hooks, Skills and MCP.
- Ability to check diffs, command output, test results, screenshots or PR notes after a task is completed instead of just trusting the natural language summary.
If this page is used for team training, ask learners to complete a small task with Claude Code: read and explain first, submit a plan, make the smallest useful change, and close with real verification commands plus human diff review.