Why you'd want it
The Agent SDK is a library that runs the Claude Code binary, so your agent gets the same tools (read, write and edit files, run commands, search the web), agent loop and context management that power Claude Code. You can add custom tools as in-process MCP servers, run hooks at points in the agent lifecycle, spawn subagents, control which tools run automatically through permissions, and resume or fork sessions. It is available for Python (claude-agent-sdk) and TypeScript (@anthropic-ai/claude-agent-sdk).
Best for
- Agents that edit files and run commands
- Teams already using Claude Code
- Embedding a coding agent in your own app
Use it when
You want Claude Code's tool set and permission model inside a process you operate, instead of writing the tool loop yourself.
Skip it if
You want to use non-Claude models. It needs an Anthropic API key or Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry, and third-party products may not offer claude.ai login unless approved by Anthropic.
Editor's note
The Python and TypeScript SDKs live in separate repos (anthropics/claude-agent-sdk-python and anthropics/claude-agent-sdk-typescript); this entry covers both and tracks the Python repo.