Claude Agent SDK
Claude Agent SDK is Anthropic's library for running the Claude Code agent loop inside your own process. Python is anthropics/claude-agent-sdk-python (7,910 stars, MIT). TypeScript is anthropics/claude-agent-sdk-typescript (1,702 stars). It is not pip install anthropic and not github.com/anthropics/anthropic-sdk-python. That Messages client is a different SDK.
Compare Claude Code if you wanted the interactive CLI, OpenAI Agents SDK if you wanted OpenAI's agent library, and Cline if you wanted a $0 editor agent instead of a library.
Key Features
- Library, not the Messages client: Docs say the Agent SDK gives you the same tools, agent loop, and context management as Claude Code, in Python and TypeScript.
- Install the agent packages:
pip install claude-agent-sdkandnpm install @anthropic-ai/claude-agent-sdk. Do not paste the leftoverfrom anthropic import Anthropicsnippet as the getting-started path. - Sessions, MCP, subagents, hooks: The live overview lists sessions, streaming, MCP, tool search, subagents, skills, plugins, permissions, hooks, checkpoints, and OpenTelemetry. Confirm the page you opened; do not freeze Sonnet 4.5 as the only model.
- Hosted vs in-process: Anthropic also sells a CLI and managed agents. Use the docs comparison table instead of calling this SDK the only official agent product.
Use Cases
- People embedding Claude Code in an app who need the loop in-process.
- People who installed
anthropicby mistake and need the correct repo. - Teams comparing Agent SDK vs CLI after they see the official table.
API tokens are billed on Anthropic's platform.
Pricing
The SDK repos are open. Model use is Anthropic API billing.
| Piece | Price | Notes from first-party pages |
|---|---|---|
| Python Agent SDK | $0 library | MIT. 7,910 stars on the check date. |
| TypeScript Agent SDK | $0 library | 1,702 stars. License field empty on GitHub. |
| Claude tokens | API | Confirm Anthropic API pricing. Not a ChatGPT Pro seat. |
| Not this SDK | anthropic Messages client | Different repo and install. |
If a leftover page still points at anthropic-sdk-python and client.messages.create, treat this table as the source.
Getting Started
- Read the overview.
- Install
claude-agent-sdk(Python) or@anthropic-ai/claude-agent-sdk(TypeScript). - Confirm Claude Code if you wanted a terminal UI instead of a library.
- Do not
pip install anthropicfor this product.
Frequently Asked Questions
Is this the official Anthropic Python SDK?
No. That is anthropic-sdk-python. This product is claude-agent-sdk.
Is it still called Claude Code SDK?
Docs now say Agent SDK. The loop is the Claude Code loop as a library.
Does it include Sonnet 4.5 forever?
No. Confirm the live model list. Do not freeze 4.5 as the catalog.
Alternatives
- Claude Code: Interactive Anthropic agent.
- OpenAI Agents SDK: OpenAI's agent library.
- Cline: $0 individual VS Code/CLI agent.
Tips
- Quote claude-agent-sdk and 7,910 stars.
- Do not point website at anthropic-sdk-python.
- Confirm TypeScript license before you call both repos MIT.
Conclusion
Claude Agent SDK is Anthropic's in-process Claude Code library, not the Messages Python client. Start at the overview, then decide whether Claude Code already covers the interface you need.
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights
The Twilight of Low-Code Platforms: Why Claude Agent SDK Will Make Dify History
A deep dive from first principles of large language models on why Claude Agent SDK will replace Dify. Exploring why describing processes in natural language is more aligned with human primitive behavior patterns, and why this is the inevitable choice in the AI era.

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.
Claudesidian: Transform Obsidian into an AI-Powered Second Brain
Discover Claudesidian, an open-source project that perfectly integrates Obsidian with Claude Code. Built-in PARA method, custom commands, and automated workflows for a complete idea-to-implementation solution.