Free to read. Sign up to save your progress and take knowledge-check quizzes.

Sign up free
5 min read·Updated March 27, 2026

Claude Agent SDK

Anthropic logoBy Anthropic

The Claude Agent SDK is Anthropic's official framework for building custom AI agents in Python and TypeScript — providing built-in file operations, shell commands, web search, and MCP integration out of the box, with the same architecture that powers Claude Code.

Listen to this lesson

Free preview · first 0:30
0:00 / 0:30

Audio & video lessons are paid features

Plus unlocks audio streaming. Pro adds downloadable audio, video, certificates, and more.

Plus adds:
  • Audio streaming
  • Downloadable PDFs
  • All AI Playbooks
  • Personalized content
Pro also adds:
  • Certificates of completion
  • Audio MP3 downloads
  • Video lessonssoon
  • & More…soon

Watch this lesson

Video coming soon

Learning Objectives

  • Understand what the Claude Agent SDK is and how it differs from Claude Code
  • Identify the SDK's built-in capabilities and when to use it versus other agent frameworks
  • Evaluate the Claude Agent SDK against alternatives like OpenAI Agents SDK and LangChain

What Is the Claude Agent SDK?

The Claude Agent SDK is Anthropic's official framework for building custom AI agents powered by Claude models. Available in Python and TypeScript, it provides the building blocks for creating agents that can read files, execute shell commands, search the web, interact with external services via MCP (Model Context Protocol), and orchestrate multi-step workflows.

The SDK uses the same architecture that powers Claude Code — Anthropic's terminal-based coding agent. While Claude Code is a complete, ready-to-use product, the Agent SDK is the developer toolkit for building your own agents tailored to your specific use case.

Apple integrated the Claude Agent SDK natively into Xcode 26.3, making it the first third-party agent framework embedded in a major IDE.

Tip

Get started: Install via pip install claude-agent-sdk (Python) or npm install @anthropic-ai/agent-sdk (TypeScript). Documentation at docs.anthropic.com/agent-sdk.

Claude Code vs. Claude Agent SDK

AspectClaude CodeClaude Agent SDK
What it isReady-to-use coding agent (CLI tool)Developer framework for building custom agents
UserDevelopers using AI for their own coding tasksDevelopers building AI agents for others or custom workflows
CustomizationConfigurable via CLAUDE.md and hooksFully programmable — define tools; workflows; and behaviors
Use caseCode a feature; fix a bug; create a PRBuild a customer service agent; data pipeline agent; or research agent
Installationnpm install -g @anthropic-ai/claude-codepip install claude-agent-sdk or npm install @anthropic-ai/agent-sdk

Built-in Capabilities

The SDK ships with production-ready tools out of the box:

File Operations

Read, write, create, and modify files programmatically. The agent can navigate directory structures, analyze file contents, and make targeted edits — the same file manipulation capability that makes Claude Code effective for coding tasks.

Shell Command Execution

Execute shell commands with configurable permissions. Agents can run builds, execute tests, query databases, invoke CLI tools, and perform system operations — with sandboxing controls for safety.

Built-in web search lets agents retrieve current information without requiring external API setup. Useful for research agents, fact-checking workflows, and any task that needs up-to-date information beyond the model's training data.

MCP Integration

Native support for the Model Context Protocol — the open standard for connecting AI models to external tools and data sources. Agents built with the SDK can connect to any MCP server:

  • Database queries (Supabase, PostgreSQL, MongoDB)
  • Cloud services (AWS, Vercel, GitHub)
  • Business tools (Slack, Stripe, Jira)
  • Custom internal APIs

MCP integration means agents can interact with your existing infrastructure without building custom API connectors.

Sub-Agents

Spawn ephemeral sub-agents for parallel subtasks. A primary agent can delegate work to specialized sub-agents that execute independently and return results — enabling complex, multi-step workflows that would be slow or fragile as a single agent chain.

Example Use Cases

  • Customer service agent — reads customer data via MCP, searches knowledge base, drafts responses, escalates complex issues
  • Data pipeline agent — monitors data sources, validates incoming data, transforms and loads to destination, reports anomalies
  • Research agent — searches the web, reads documents, synthesizes findings, generates structured reports
  • DevOps agent — monitors deployments, runs health checks, executes rollbacks, sends notifications
  • Content moderation agent — reviews submissions, applies policy rules, flags edge cases for human review

Access

DetailInfo
PriceFree (open-source SDK); pay per API usage for Claude model calls
LanguagesPython and TypeScript
Install (Python)pip install claude-agent-sdk
Install (TypeScript)npm install @anthropic-ai/agent-sdk
Models supportedClaude Opus 4.7; Sonnet 4.6; Haiku 4.5
IDE IntegrationApple Xcode 26.3 (native)

Strengths

  • Same architecture as Claude Code — proven agent framework powering Anthropic's own production coding agent
  • Built-in tools — file operations, shell commands, web search, and MCP integration out of the box; no boilerplate setup
  • MCP-native — first-class support for the open standard that Claude, OpenAI, Google, and others are adopting
  • Sub-agent support — parallel task delegation for complex workflows
  • Python and TypeScript — covers the two most popular languages for AI development
  • Apple Xcode integration — first third-party agent framework embedded in a major IDE
  • Free SDK — no licensing cost for the framework; pay only for Claude API usage

Limitations & Considerations

  • Claude models only — the SDK is designed for Anthropic's models; it does not support GPT, Gemini, or other providers
  • API costs scale with usage — agents that run many multi-step workflows can accumulate significant API costs
  • Newer than alternatives — LangChain and LangGraph have larger communities, more tutorials, and broader framework support
  • No visual builder — entirely code-based; teams wanting no-code agent building should look at n8n or Relevance AI
  • Agent reliability — as with all agent frameworks, multi-step autonomous workflows can fail or produce unexpected results; human-in-the-loop checkpoints are recommended for high-stakes actions

Claude Agent SDK vs. Alternatives

FrameworkModels SupportedStrengthsBest For
Claude Agent SDKClaude onlyBuilt-in tools; MCP-native; proven architectureTeams building on Claude; MCP-integrated workflows
OpenAI Agents SDKOpenAI onlyTool use; handoffs; guardrailsTeams building on GPT models; OpenAI ecosystem
LangChain / LangGraphAny LLMLargest ecosystem; most integrations; flexibleMulti-model support; complex orchestration; prototyping
CrewAIAny LLMRole-based multi-agent; easy to startTeam-structured workflows; content pipelines

Key Takeaways

  • The Claude Agent SDK is Anthropic's official framework for building custom AI agents — providing file operations, shell commands, web search, and MCP integration out of the box
  • It uses the same architecture that powers Claude Code, meaning the agent framework is proven in production at scale
  • Free to use (pay only for Claude API calls); available in Python and TypeScript; natively integrated into Apple Xcode 26.3
  • Best suited for teams building agents on Claude models with MCP integrations; teams needing multi-model support should consider LangChain or CrewAI instead

Save your progress & take the quiz

Sign up free to bookmark lessons, track which modules you've completed, and lock in what you learned with a quick knowledge-check quiz at the end of each lesson.

🧭Recommended for you