Skip to content

Anthropic Claude Agent SDK (Python)

Claude-first agent SDK. The production successor to the Code SDK — Computer Use, MCP, extended thinking, checkpointing, and session rewind, all tuned for Claude.

Install

Terminal window
pip install claude-agent-sdk

Version

v0.1.73 · May 2026 · Python 3.10+

Best for

Claude-exclusive apps, Computer Use, MCP-heavy workflows, durable sessions.

  • v0.1.73 (May 5) — Patch release; stability improvements.
  • v0.1.72 (May 1) — Patch release; stability improvements.
  • v0.1.71 (April 29) — Patch release; stability improvements.
  • v0.1.70 (April 29) — Patch release; stability improvements.
  • v0.1.69 (April 28) — Patch release; stability improvements.
  • v0.1.68 (April 25) — Patch release; stability improvements.
  • v0.1.67 (April 24) — Patch release; stability improvements.
  • v0.1.66 (April 23) — Patch release; stability improvements.
  • v0.1.65 (April 22) — Patch release; bundled Claude Code CLI updated; dependency pinning improvements.
  • v0.1.64 (April 20) — Stability and dependency updates.
  • v0.1.63get_context_usage() per-category token breakdown; typing.Annotated per-parameter descriptions; tool_use_id/agent_id in ToolPermissionContext.

The SDK offers two entry points — query() for one-shot calls and ClaudeSDKClient for bidirectional sessions. There is no Agent class; an earlier draft of this page documented one that doesn’t exist.

import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions
async def main():
options = ClaudeAgentOptions(
model="claude-3-5-sonnet-latest",
system_prompt="You are a helpful assistant.",
)
async for message in query(prompt="What is 15 + 27?", options=options):
print(message)
asyncio.run(main())
import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
async def main():
options = ClaudeAgentOptions(system_prompt="You are a helpful assistant.")
async with ClaudeSDKClient(options=options) as client:
await client.query("What is 15 + 27?")
async for message in client.receive_response():
print(message)
asyncio.run(main())

Ready? Start Zero → Hero Step 1 →


DateFramework version (installed)Summary of changesReviewer
2026-05-05claude-agent-sdk 0.1.73Version bumped 0.1.72 → 0.1.73; “What’s new” updated; revision history entry added. query, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock verified against installed 0.1.73 (.routine-envs/check-0505).Claude routine
2026-05-01claude-agent-sdk 0.1.72Version bumped 0.1.71 → 0.1.72; “What’s new” updated; revision history entry added. Symbols verified against installed 0.1.72 (.routine-envs/check-claude-0501).Claude routine
2026-04-29claude-agent-sdk 0.1.71Version bumped 0.1.69 → 0.1.71 (two patch releases: 0.1.70, 0.1.71); “What’s new” updated; revision history entry added. Symbols verified against installed 0.1.71 (.routine-envs/main-py-0429).Claude routine
2026-04-28claude-agent-sdk 0.1.69Version bumped 0.1.68 → 0.1.69 (patch release); “What’s new” updated; revision history entry added. Symbols verified against installed 0.1.69 (.routine-envs/main-py-0428).Claude routine
2026-04-25claude-agent-sdk 0.1.68Version bumped 0.1.66 → 0.1.68 (two patch releases); “What’s new” updated with 0.1.67 and 0.1.68 entries; revision history entry added. Symbols verified against installed 0.1.68 (.routine-envs/main-py-0425).Claude routine
2026-04-24claude-agent-sdk 0.1.66Version bumped 0.1.65 → 0.1.66; revision history entry added for 0.1.66 patch release.Claude routine
2026-04-22claude-agent-sdk 0.1.65Version bumped 0.1.63 → 0.1.65; “What’s new” section updated; revision history entries added for 0.1.64 and 0.1.65.Claude routine
2026-04-21claude-agent-sdk 0.1.63Index redesigned with Zero → Hero + Jump-to-topic grid.
2026-04-18claude-agent-sdk 0.1.63Stability fixes.
2026-04-16claude-agent-sdk 0.1.60Extended thinking; file checkpointing; session rewind.
2025Renamed from Claude Code SDK to Claude Agent SDK.

Note: TypeScript implementation lives at Claude Agent SDK (TypeScript).