Releases: anthropics/claude-agent-sdk-python
Releases · anthropics/claude-agent-sdk-python
Release list
v0.2.143
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.238
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.143/
pip install claude-agent-sdk==0.2.143v0.2.142
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.237
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.142/
pip install claude-agent-sdk==0.2.142v0.2.141
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.236
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.141/
pip install claude-agent-sdk==0.2.141v0.2.140
New Features
- MCP 2.x support for in-process SDK MCP servers: The SDK now supports
mcp2.x alongside 1.x (dependency widened tomcp>=1.23.0,<3.0.0). In-process servers are served over mcp's own in-memory transport instead of hand-rolled JSON-RPC dispatch, so hand-builtmcp.server.Serverinstances now work at full fidelity — resources, prompts, and all result content types reach the CLI verbatim. Tool cancellation on interrupt is supported on mcp 2.x.claude_agent_sdk.ToolAnnotationsaccepts both camelCase and snake_case hint names on every mcp version (#1218) forward_subagent_textoption: Newforward_subagent_textboolean onClaudeAgentOptionsforwards a subagent's text and thinking blocks as messages in the stream, so consumers can render the full nested transcript. Matches the TypeScript SDK'sforwardSubagentText(#1206)ResultErrorexception with structured error payload: When the CLI exits after a terminal error result, the SDK now raisesResultError(a subclass ofProcessError) instead of a bare "exit code 1" error. Carriessubtype,errors,result,api_error_status,terminal_reason,session_id, and the rawdatadict so callers can branch on failure reason without string matching. New exported types:ResultError(#1205)can_use_toolcallback support forquery()and string prompts: Thecan_use_toolpermission callback now works with string prompts (not justClaudeSDKClient), and stdin is kept open so the CLI can send permission requests over the control protocol (#1204)
Bug Fixes
- Recover
parent_tool_use_idwhen reading subagent transcripts:get_subagent_messages()andget_subagent_messages_from_store()now recover theparent_tool_use_idfrom the subagent's metadata, linking each subagent's messages to the Agenttool_useblock in the parent session.SessionMessagealso gains aparent_agent_idfield for the spawning agent's id (#1207)
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.235
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.140/
pip install claude-agent-sdk==0.2.140v0.2.139
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.233
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.139/
pip install claude-agent-sdk==0.2.139v0.2.138
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.232
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.138/
pip install claude-agent-sdk==0.2.138v0.2.137
New Features
ConversationResetMessagefor conversation reset events: The SDK now surfaces the CLI'sconversation_resetframe as aConversationResetMessagedataclass, letting applications detect when a/clearor other transcript-discarding flow resets the conversation mid-session. Includesnew_conversation_id,uuid, andsession_idfields. This widens theMessageunion — code that exhaustively matches withassert_neverwill need updating (#1196)- Message origin on
UserMessageandResultMessage: Neworigin: MessageOrigin | Nonefield onUserMessageandResultMessagesurfaces why a turn was initiated — distinguishing application-submitted prompts ("human") from background-task notifications, scheduled triggers, peer messages, and other session-injected turns. New exported types:MessageOrigin,MessageOriginKind,TaskNotificationOriginSubkind(#1199) resume_session_at/resume_drops_turnoptions for truncating resume:ClaudeAgentOptionsnow supportsresume_session_at(fork a session at an earlier transcript entry) andresume_drops_turn(validate that only entries from a specific turn are discarded). Enables safe rewind-to-before-last-prompt without silently dropping unobserved messages (#1198)
Bug Fixes
- Seed
settings.jsoninto temp config dir onSessionStoreresume: Resuming from aSessionStorenow copiessettings.jsonandcowork_settings.jsoninto the temporary config directory, preservingapiKeyHelperauth, user hooks, env vars, and permissions. Previously, hosts authenticating solely viaapiKeyHelperwould fail with "Not logged in" on resume (#1197) - Improved error messages for failed resume: When the CLI rejects a resume (e.g. nonexistent session or
resume_drops_turnguard failure), pending control requests likeinitialize()now receive the actual error text instead of a generic "Command failed with exit code 1" (#1198)
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.229
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.137/
pip install claude-agent-sdk==0.2.137v0.2.136
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.228
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.136/
pip install claude-agent-sdk==0.2.136v0.2.135
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.227
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.135/
pip install claude-agent-sdk==0.2.135v0.2.134
Internal/Other Changes
- Updated bundled Claude CLI to version 2.1.226
PyPI: https://pypi.org/project/claude-agent-sdk/0.2.134/
pip install claude-agent-sdk==0.2.134