Agent SDK overview - Claude Code Docs (original) (raw)

Build AI agents that autonomously read files, run commands, search the web, edit code, and more. The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript.

The Agent SDK includes built-in tools for reading files, running commands, and editing code, so your agent can start working immediately without you implementing tool execution. Dive into the quickstart or explore real agents built with the SDK:

Get started

Ready to build? Follow the Quickstart to create an agent that finds and fixes bugs in minutes.

Capabilities

Everything that makes Claude Code powerful is available in the SDK:

Claude Code features

The SDK also supports Claude Code’s filesystem-based configuration. With default options the SDK loads these from .claude/ in your working directory and ~/.claude/. To restrict which sources load, set setting_sources (Python) or settingSources (TypeScript) in your options.

Feature Description Location
Skills Specialized capabilities Claude uses automatically or you invoke with /name .claude/skills/*/SKILL.md
Commands Custom commands in the legacy format. Use skills for new custom commands .claude/commands/*.md
Memory Project context and instructions CLAUDE.md or .claude/CLAUDE.md
Plugins Extend with skills, agents, hooks, and MCP servers Programmatic via plugins option

The Claude Platform offers multiple ways to build with Claude. Here’s how the Agent SDK fits in:

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:

Same capabilities, different interface:

Use case Best choice
Interactive development CLI
CI/CD pipelines SDK
Custom applications SDK
One-off tasks CLI
Production automation SDK

Many teams use both: CLI for daily development, SDK for production. Workflows translate directly between them.

Managed Agents is a hosted REST API: Anthropic runs the agent and the sandbox, and your application sends events and streams back results. The Agent SDK is a library that runs the agent loop inside your own process.

Agent SDK Managed Agents
Runs in Your process, your infrastructure Anthropic-managed infrastructure
Interface Python or TypeScript library REST API
Agent works on Files on your infrastructure A managed sandbox per session
Session state JSONL on your filesystem Anthropic-hosted event log
Custom tools In-process Python or TypeScript functions Claude triggers the tool; you execute and return results
Best for Local prototyping, agents that work directly on your filesystem and services Production agents without operating sandbox or session infrastructure, long-running and asynchronous sessions

A common path is to prototype with the Agent SDK locally, then move to Managed Agents for production.

Changelog

View the full changelog for SDK updates, bug fixes, and new features:

Reporting bugs

If you encounter bugs or issues with the Agent SDK:

Branding guidelines

For partners integrating the Claude Agent SDK, use of Claude branding is optional. When referencing Claude in your product: Allowed:

Not permitted:

Your product should maintain its own branding and not appear to be Claude Code or any Anthropic product. For questions about branding compliance, contact the Anthropic sales team.

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