Skip to content

Releases: anthropics/claude-agent-sdk-python

v0.1.77

08 May 00:04

Choose a tag to compare

Bug Fixes

  • Actionable error messages after error results: Replaced the generic Command failed with exit code 1 exception raised after an error result with one carrying the result's actual error text (e.g. "Reached maximum number of turns"), matching the TypeScript SDK behavior (#918)

Documentation

  • Deprecated "Skill" in allowed_tools in favor of the skills option on ClaudeAgentOptions, which provides more granular control over available skills (#924)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.133

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.77/

pip install claude-agent-sdk==0.1.77

v0.1.76

06 May 22:23

Choose a tag to compare

New Features

  • API error status on result messages: Added api_error_status: int | None to ResultMessage, surfacing the HTTP status code (e.g. 429, 500, 529) from failing API calls. This provides a safe-to-log field for classifying API failures when is_error=True (#923)

Bug Fixes

  • Permission suggestions deserialization: Fixed ToolPermissionContext.suggestions containing raw dicts instead of PermissionUpdate instances. Added PermissionUpdate.from_dict() so suggestions from can_use_tool callbacks can be inspected and echoed back in PermissionResultAllow(updated_permissions=...) without AttributeError (#920)

Internal/Other Changes

  • Pinned third-party GitHub Actions to immutable commit SHAs (#919)
  • Updated bundled Claude CLI to version 2.1.132

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.76/

pip install claude-agent-sdk==0.1.76

v0.1.75

06 May 08:00

Choose a tag to compare

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.131

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.75/

pip install claude-agent-sdk==0.1.75

v0.1.74

06 May 01:53

Choose a tag to compare

New Features

  • Hook event streaming: Added include_hook_events option to ClaudeAgentOptions. When set, hook events (PreToolUse, PostToolUse, Stop, etc.) are emitted by the CLI and yielded from the message stream as HookEventMessage, matching the TypeScript SDK's includeHookEvents (#917)
  • Defer hook decision: Added support for the "defer" hook decision in PreToolUseHookSpecificOutput.permissionDecision and new DeferredToolUse dataclass on ResultMessage.deferred_tool_use, bringing parity with the TypeScript SDK's deferred tool use round trip (#865)
  • Strict MCP config: Added strict_mcp_config option to ClaudeAgentOptions. When True, the CLI only uses MCP servers passed via mcp_servers, ignoring project, user, and global MCP configurations for fully deterministic server sets (#915)
  • Permission context enrichment: Added decision_reason, blocked_path, title, display_name, and description fields to ToolPermissionContext, enabling richer permission prompts in can_use_tool callbacks (#909)
  • updatedToolOutput for post-tool hooks: Added updatedToolOutput to PostToolUseHookSpecificOutput for replacing any tool's output before it reaches the model, not just MCP tools (#911)
  • xhigh effort level: Added "xhigh" to the effort Literal on ClaudeAgentOptions and AgentDefinition, an Opus 4.7-specific level that falls back to high on other models (#914)
  • Subprocess cleanup on parent exit: Registered an atexit handler to terminate live CLI subprocesses when the parent process exits, preventing orphaned claude processes from leaking (#916)

Bug Fixes

  • ResourceWarning on disconnect: Fixed ResourceWarning: Unclosed <MemoryObjectReceiveStream> emitted on ClaudeSDKClient disconnect and query() cleanup by closing the receive stream at the consumer boundary (#908)
  • Session created_at timestamp: Fixed list_sessions() returning created_at=None for sessions whose first JSONL record lacks a timestamp field by scanning the full head buffer instead of only the first line (#907)

Documentation

  • Clarified that can_use_tool fires only on "ask" permission decisions, not on "allow" or "deny" (#912)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.129

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.74/

pip install claude-agent-sdk==0.1.74

v0.1.73

04 May 23:15

Choose a tag to compare

New Features

  • Eager session store flushing: Added session_store_flush option to ClaudeAgentOptions ("batched" or "eager"). When set to "eager", the transcript mirror delivers frames to SessionStore.append() in near-real-time instead of waiting for the end-of-turn flush, enabling live-tailing UIs, cross-process resume, and crash-durability use cases (#905)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.128

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.73/

pip install claude-agent-sdk==0.1.73

v0.1.72

01 May 02:18

Choose a tag to compare

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.126

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.72/

pip install claude-agent-sdk==0.1.72

v0.1.71

29 Apr 03:41

Choose a tag to compare

New Features

  • Domain allowlist fields for sandbox network config: Added allowedDomains, deniedDomains, allowManagedDomainsOnly, and allowMachLookup fields to SandboxNetworkConfig, bringing parity with the TypeScript schema and enabling Python SDK users to configure network allowlists with proper type hints (#893)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.123

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.71/

pip install claude-agent-sdk==0.1.71

v0.1.70

28 Apr 22:18

Choose a tag to compare

Bug Fixes

  • In-process MCP tool results silently lost with older mcp versions: Bumped the mcp dependency floor to >=1.19.0. Older versions mishandled CallToolResult returns from SDK MCP tool handlers, causing the model to receive a validation-error blob instead of the actual tool output (#891)
  • Trio nursery corruption on early cancellation: Fixed RuntimeError: Nursery stack corrupted when breaking out of query() iteration inside a trio nursery with options.stderr set. The stderr reader now uses spawn_detached() instead of manually managing a task group, matching the approach already used for the read loop (#885)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.122

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.70/

pip install claude-agent-sdk==0.1.70

v0.1.69

28 Apr 00:44

Choose a tag to compare

Documentation

  • Added docstrings to ClaudeAgentOptions fields for improved IDE autocompletion and inline documentation (#873)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.121

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.69/

pip install claude-agent-sdk==0.1.69

v0.1.68

25 Apr 02:07

Choose a tag to compare

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.119

PyPI: https://pypi.org/project/claude-agent-sdk/0.1.68/

pip install claude-agent-sdk==0.1.68