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.2.93 · June 2026 · Python 3.10+
Best for
Claude-exclusive apps, Computer Use, MCP-heavy workflows, durable sessions.
query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.93 (.routine-envs/refresh-py, 2026-06-07); no DeprecationWarning emissions. 140 public symbols confirmed.query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.91 (.routine-envs/check-0605-claude-py, 2026-06-05); no DeprecationWarning emissions. 140 public symbols confirmed.query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.89 (/tmp/claude-sdk-check, 2026-06-04); no DeprecationWarning emissions. 140 public symbols confirmed.query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.88 (.routine-envs/py-0603); no DeprecationWarning emissions. 140 public symbols confirmed.query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.87 (.routine-envs/check-0523-claude-py); no DeprecationWarning emissions. 140 public symbols confirmed.query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.85 (.routine-envs/check-0522-claude-py); no DeprecationWarning emissions. 140 public symbols confirmed.SandboxSettings, SandboxNetworkConfig, SandboxIgnoreViolations for sandbox configuration; TaskBudget, TaskNotificationMessage, TaskNotificationStatus, TaskProgressMessage, TaskStartedMessage, TaskUsage for task lifecycle tracking; EffortLevel for configurable effort modes; DeferredToolUse for deferred tool execution patterns; SdkBeta, SdkMcpTool, SdkPluginConfig for plugin and MCP configuration; store-backed variants of all session management functions (delete_session_via_store, fork_session_via_store, etc.); project_key_for_directory utility. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent, InMemorySessionStore) verified against installed claude-agent-sdk==0.2.82 (.routine-envs/check-0519-py); no DeprecationWarning emissions.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-06-07 | claude-agent-sdk 0.2.93 | Patch releases 0.2.92–0.2.93; version card updated to v0.2.93; “What’s new” heading updated; two patch bullets added; revision history entry added. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.93 (.routine-envs/refresh-py, 2026-06-07); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-06-05 | claude-agent-sdk 0.2.91 | Patch releases 0.2.90–0.2.91; “What’s new” heading updated to v0.2.91; two patch bullets added; comprehensive guide header updated; revision history entry added. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.91 (.routine-envs/check-0605-claude-py, 2026-06-05); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-06-04 | claude-agent-sdk 0.2.89 | Patch release 0.2.89; “What’s new” heading updated to v0.2.89; v0.2.89 bullet added; comprehensive guide header updated; revision history entry added. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, PermissionMode, McpServerConfig, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.89 (/tmp/claude-sdk-check, 2026-06-04); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-06-03 | claude-agent-sdk 0.2.88 | Patch release 0.2.88; version card updated June 2026; “What’s new” heading updated to v0.2.88; v0.2.88 bullet added. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.88 (.routine-envs/py-0603); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-05-23 | claude-agent-sdk 0.2.87 | Patch releases 0.2.86–0.2.87; “What’s new” heading updated to v0.2.87; two patch bullets added. All core symbols verified against installed claude-agent-sdk==0.2.87 (.routine-envs/check-0523-claude-py); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-05-22 | claude-agent-sdk 0.2.85 | Patch releases 0.2.83–0.2.85; “What’s new” heading updated to v0.2.85; three patch bullets added. All core symbols (query, tool, ClaudeSDKClient, ClaudeAgentOptions, SandboxSettings, TaskBudget, EffortLevel, DeferredToolUse) verified against installed claude-agent-sdk==0.2.85 (.routine-envs/check-0522-claude-py); no DeprecationWarning emissions. 140 public symbols confirmed. | Claude routine |
| 2026-05-19 | claude-agent-sdk 0.2.82 | Major version bump 0.1.81 → 0.2.82; “What’s new” updated with expanded API surface; comprehensive guide updated; revision history entry added. All core symbols verified against installed claude-agent-sdk==0.2.82 (.routine-envs/check-0519-py); no DeprecationWarning emissions. | Claude routine |
| 2026-05-12 | claude-agent-sdk 0.1.81 | Version bumped 0.1.80 → 0.1.81; “What’s new” updated; revision history entry added. query, ClaudeAgentOptions, PermissionMode, McpServerConfig, TextBlock, AssistantMessage, UserMessage, ResultMessage, StreamEvent, RateLimitEvent verified against installed 0.1.81 (.routine-envs/check-0512-py); no DeprecationWarnings. | Claude routine |
| 2026-05-09 | claude-agent-sdk 0.1.80 | Version bumped 0.1.73 → 0.1.80 (seven patch releases: 0.1.74–0.1.80); “What’s new” updated; revision history entry added. All symbols verified against installed 0.1.80 (.routine-envs/check-0509-py); no DeprecationWarnings. | Claude routine |
| 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).