Releases: anthropics/claude-agent-sdk-python
Releases · anthropics/claude-agent-sdk-python
v0.1.77
Bug Fixes
- Actionable error messages after error results: Replaced the generic
Command failed with exit code 1exception 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"inallowed_toolsin favor of theskillsoption onClaudeAgentOptions, 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.77v0.1.76
New Features
- API error status on result messages: Added
api_error_status: int | NonetoResultMessage, 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 whenis_error=True(#923)
Bug Fixes
- Permission suggestions deserialization: Fixed
ToolPermissionContext.suggestionscontaining raw dicts instead ofPermissionUpdateinstances. AddedPermissionUpdate.from_dict()so suggestions fromcan_use_toolcallbacks can be inspected and echoed back inPermissionResultAllow(updated_permissions=...)withoutAttributeError(#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.76v0.1.75
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.75v0.1.74
New Features
- Hook event streaming: Added
include_hook_eventsoption toClaudeAgentOptions. When set, hook events (PreToolUse, PostToolUse, Stop, etc.) are emitted by the CLI and yielded from the message stream asHookEventMessage, matching the TypeScript SDK'sincludeHookEvents(#917) - Defer hook decision: Added support for the
"defer"hook decision inPreToolUseHookSpecificOutput.permissionDecisionand newDeferredToolUsedataclass onResultMessage.deferred_tool_use, bringing parity with the TypeScript SDK's deferred tool use round trip (#865) - Strict MCP config: Added
strict_mcp_configoption toClaudeAgentOptions. WhenTrue, the CLI only uses MCP servers passed viamcp_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, anddescriptionfields toToolPermissionContext, enabling richer permission prompts incan_use_toolcallbacks (#909) updatedToolOutputfor post-tool hooks: AddedupdatedToolOutputtoPostToolUseHookSpecificOutputfor replacing any tool's output before it reaches the model, not just MCP tools (#911)xhigheffort level: Added"xhigh"to theeffortLiteral onClaudeAgentOptionsandAgentDefinition, an Opus 4.7-specific level that falls back tohighon other models (#914)- Subprocess cleanup on parent exit: Registered an atexit handler to terminate live CLI subprocesses when the parent process exits, preventing orphaned
claudeprocesses from leaking (#916)
Bug Fixes
- ResourceWarning on disconnect: Fixed
ResourceWarning: Unclosed <MemoryObjectReceiveStream>emitted onClaudeSDKClientdisconnect andquery()cleanup by closing the receive stream at the consumer boundary (#908) - Session
created_attimestamp: Fixedlist_sessions()returningcreated_at=Nonefor sessions whose first JSONL record lacks atimestampfield by scanning the full head buffer instead of only the first line (#907)
Documentation
- Clarified that
can_use_toolfires 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.74v0.1.73
New Features
- Eager session store flushing: Added
session_store_flushoption toClaudeAgentOptions("batched"or"eager"). When set to"eager", the transcript mirror delivers frames toSessionStore.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.73v0.1.72
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.72v0.1.71
New Features
- Domain allowlist fields for sandbox network config: Added
allowedDomains,deniedDomains,allowManagedDomainsOnly, andallowMachLookupfields toSandboxNetworkConfig, 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.71v0.1.70
Bug Fixes
- In-process MCP tool results silently lost with older
mcpversions: Bumped themcpdependency floor to>=1.19.0. Older versions mishandledCallToolResultreturns 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 corruptedwhen breaking out ofquery()iteration inside a trio nursery withoptions.stderrset. The stderr reader now usesspawn_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.70v0.1.69
Documentation
- Added docstrings to
ClaudeAgentOptionsfields 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.69v0.1.68
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