Install
pip install claude-agent-sdkClaude-first agent SDK. The production successor to the Code SDK — Computer Use, MCP, extended thinking, checkpointing, and session rewind, all tuned for Claude.
Install
pip install claude-agent-sdkVersion
v0.1.73 · May 2026 · Python 3.10+
Best for
Claude-exclusive apps, Computer Use, MCP-heavy workflows, durable sessions.
get_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 asynciofrom 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 asynciofrom 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 →
| Date | Framework version (installed) | Summary of changes | Reviewer |
|---|---|---|---|
| 2026-05-05 | claude-agent-sdk 0.1.73 | Version 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-01 | claude-agent-sdk 0.1.72 | Version 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-29 | claude-agent-sdk 0.1.71 | Version 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-28 | claude-agent-sdk 0.1.69 | Version 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-25 | claude-agent-sdk 0.1.68 | Version 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-24 | claude-agent-sdk 0.1.66 | Version bumped 0.1.65 → 0.1.66; revision history entry added for 0.1.66 patch release. | Claude routine |
| 2026-04-22 | claude-agent-sdk 0.1.65 | Version 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-21 | claude-agent-sdk 0.1.63 | Index redesigned with Zero → Hero + Jump-to-topic grid. | — |
| 2026-04-18 | claude-agent-sdk 0.1.63 | Stability fixes. | — |
| 2026-04-16 | claude-agent-sdk 0.1.60 | Extended thinking; file checkpointing; session rewind. | — |
| 2025 | — | Renamed from Claude Code SDK to Claude Agent SDK. | — |
Note: TypeScript implementation lives at Claude Agent SDK (TypeScript).