The Claude Code SDK has been renamed to the Claude Agent SDK. If you’re migrating from the old SDK, see the Migration Guide.
Quickstart
Build a bug-fixing agent in minutes
Example agents
Email assistant, research agent, and more
Get started
Set your API key
Get an API key from the Console, then set it as an environment variable:The SDK also supports authentication via third-party API providers:
- Amazon Bedrock: set
CLAUDE_CODE_USE_BEDROCK=1environment variable and configure AWS credentials - Google Vertex AI: set
CLAUDE_CODE_USE_VERTEX=1environment variable and configure Google Cloud credentials - Microsoft Azure: set
CLAUDE_CODE_USE_FOUNDRY=1environment variable and configure Azure credentials
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. Please use the API key authentication methods described in this document instead.
Capabilities
Everything that makes Claude Code powerful is available in the SDK:- Built-in tools
- Hooks
- Subagents
- MCP
- Permissions
- Sessions
Your agent can read files, run commands, and search codebases out of the box. Key tools include:
This example creates an agent that searches your codebase for TODO comments:
| Tool | What it does |
|---|---|
| Read | Read any file in the working directory |
| Write | Create new files |
| Edit | Make precise edits to existing files |
| Bash | Run terminal commands, scripts, git operations |
| Monitor | Watch a background script and react to each output line as an event |
| Glob | Find files by pattern (**/*.ts, src/**/*.py) |
| Grep | Search file contents with regex |
| WebSearch | Search the web for current information |
| WebFetch | Fetch and parse web page content |
| AskUserQuestion | Ask the user clarifying questions with multiple choice options |
Claude Code features
The SDK also supports Claude Code’s filesystem-based configuration. To use these features, setsetting_sources=["project"] (Python) or settingSources: ['project'] (TypeScript) in your options.
| Feature | Description | Location |
|---|---|---|
| Skills | Specialized capabilities defined in Markdown | .claude/skills/*/SKILL.md |
| Slash commands | Custom commands for common tasks | .claude/commands/*.md |
| Memory | Project context and instructions | CLAUDE.md or .claude/CLAUDE.md |
| Plugins | Extend with custom commands, agents, and MCP servers | Programmatic via plugins option |
Compare the Agent SDK to other Claude tools
The Claude Platform offers multiple ways to build with Claude. Here’s how the Agent SDK fits in:- Agent SDK vs Client SDK
- Agent SDK vs Claude Code CLI
The Anthropic Client SDK gives you direct API access: you send prompts and implement tool execution yourself. The Agent SDK gives you Claude with built-in tool execution.With the Client SDK, you implement a tool loop. With the Agent SDK, Claude handles it:
Changelog
View the full changelog for SDK updates, bug fixes, and new features:- TypeScript SDK: view CHANGELOG.md
- Python SDK: view CHANGELOG.md
Reporting bugs
If you encounter bugs or issues with the Agent SDK:- TypeScript SDK: report issues on GitHub
- Python SDK: report issues on GitHub
Branding guidelines
For partners integrating the Claude Agent SDK, use of Claude branding is optional. When referencing Claude in your product: Allowed:- “Claude Agent” (preferred for dropdown menus)
- “Claude” (when within a menu already labeled “Agents”)
- ” Powered by Claude” (if you have an existing agent name)
- “Claude Code” or “Claude Code Agent”
- Claude Code-branded ASCII art or visual elements that mimic Claude Code
License and terms
Use of the Claude Agent SDK is governed by Anthropic’s Commercial Terms of Service, including when you use it to power products and services that you make available to your own customers and end users, except to the extent a specific component or dependency is covered by a different license as indicated in that component’s LICENSE file.Next steps
Quickstart
Build an agent that finds and fixes bugs in minutes
Example agents
Email assistant, research agent, and more
TypeScript SDK
Full TypeScript API reference and examples
Python SDK
Full Python API reference and examples