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.2.93 · June 2026 · Python 3.10+

Best for

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

  • v0.2.93 (June 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.92 (June 2026) — Patch release; stability and dependency updates.
  • v0.2.91 (June 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.90 (June 2026) — Patch release; stability and dependency updates.
  • v0.2.89 (June 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.88 (June 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.87 (May 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.86 (May 2026) — Patch release; stability and dependency updates.
  • v0.2.85 (May 2026) — Patch release; stability and dependency updates. All core symbols (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.
  • v0.2.84 (May 2026) — Patch release; stability and dependency updates.
  • v0.2.83 (May 2026) — Patch release; stability and dependency updates.
  • v0.2.82 (May 2026) — Major minor-version bump (0.1 → 0.2). Significantly expanded API surface including 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.
  • v0.1.81 (May 12) — Final 0.1.x release; stability and dependency updates.
  • 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-06-07claude-agent-sdk 0.2.93Patch 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-05claude-agent-sdk 0.2.91Patch 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-04claude-agent-sdk 0.2.89Patch 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-03claude-agent-sdk 0.2.88Patch 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-23claude-agent-sdk 0.2.87Patch 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-22claude-agent-sdk 0.2.85Patch 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-19claude-agent-sdk 0.2.82Major 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-12claude-agent-sdk 0.1.81Version 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-09claude-agent-sdk 0.1.80Version 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-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).