Claude Agent SDK

Anthropic’s library that embeds the Claude Code agent loop, tools and context management in your own Python or TypeScript application. Renamed from the Claude Code SDK (reported 2025-09-29, alongside v0.1.0; the official migration guide is undated).

  • Packages: claude-agent-sdk (Python, was claude-code-sdk), @anthropic-ai/claude-agent-sdk (TypeScript, was @anthropic-ai/claude-code). Python ClaudeCodeOptions became ClaudeAgentOptions.
  • Breaking change at rename: no longer uses Claude Code’s system prompt by default (opt in via the claude_code preset).
  • Capabilities: built-in file/shell/web tools, hooks, subagents, permissions, sessions (resume/fork), skills, commands, memory and plugins loaded from .claude/, MCP client and in-process MCP servers.
  • Not the same as: the Claude Code CLI (Claude Code), the raw Client SDK (you write the tool loop) or Managed Agents (Anthropic-hosted harness).
  • Terms: third parties may not offer claude.ai login or rate limits in products built on it; use API keys.
  • Interop: first-class MCP (model-context-protocol); microsoft-agent-framework ships a connector for it (per a Build 2026 summary, secondary).

Sources

Merged from laptop copy (2026-10-01)

Source: owner’s laptop note KB-AI/ai-coding/ai-coding-assistants/claude-agent-sdk.md (author carine, published 2025-09-29, modified 2025-12-30). The note’s published date is taken from it. The laptop copy is a late-2025 snapshot; items below were not re-verified (unverified).

  • Origin: renamed from Claude Code SDK because the agent harness proved useful beyond coding (research, video creation, note-taking).
  • Release timeline (late 2025, per laptop copy): announced 2025-09-29 alongside Claude Sonnet 4.5; v0.1.0 on 2025-09-28 (per that copy); 17+ releases v0.1.1 to v0.1.17 in Nov-Dec 2025; Claude Code CLI bundled in the pip package from v0.1.8 (2025-11-19).
  • TypeScript V2 preview (late 2025): session-based createSession()/resumeSession(), session.send(), session.receive() with unstable_v2_* prefix, instead of V1 async-generator input streams; session forking still needed V1. Preview status in 2026 not checked.
  • Agent loop: gather context (agentic grep/find search, semantic search) → act (custom tools, bash, code generation) → verify (linting/tests, screenshots, LLM-as-judge) → repeat. Automatic context compaction; subagents with isolated context windows; CLAUDE.md memory; prompt caching.
  • Also changed at rename (besides system prompt): settings (CLAUDE.md, settings.json, slash commands) are no longer loaded from the filesystem by default; pass settingSources explicitly. Rationale: predictable behaviour for CI/CD and multi-tenant apps.
  • Install: pip install claude-agent-sdk; npm install @anthropic-ai/claude-agent-sdk. Minimal Python use: query(prompt=..., options=ClaudeAgentOptions(model=..., permission_mode="acceptEdits", setting_sources=["project"])).
  • Use cases listed: SRE/oncall and security-review agents, legal/finance/support agents, personal assistants, research and content pipelines (a 7-subagent documentation workflow reported as 23 h to 5 h; vendor/community claim).
  • Related: aider, goose, Claude Code.

Sources (from the laptop copy): https://platform.claude.com/docs/en/agent-sdk/overview , https://platform.claude.com/docs/en/agent-sdk/typescript-v2-preview , https://platform.claude.com/docs/en/agent-sdk/migration-guide , https://github.com/anthropics/claude-agent-sdk-python , https://github.com/anthropics/claude-agent-sdk-typescript