Skip to content

Releases: anthropics/claude-agent-sdk-python

v0.2.128

Choose a tag to compare

@github-actions github-actions released this 25 Jul 01:49

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.220

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

pip install claude-agent-sdk==0.2.128

v0.2.127

Choose a tag to compare

@github-actions github-actions released this 24 Jul 17:27

Bug Fixes

  • Fixed premature stdin closure when background tasks are in flight: query() no longer closes stdin on the first result frame when background tasks (e.g. run_in_background: true subagents) are still running. Previously, closing stdin too early caused SDK-MCP tool calls from background tasks to fail with "Stream closed" and silently bypassed PreToolUse hooks. Stdin now stays open until all in-flight tasks complete and the final result frame arrives (#1103)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.219

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

pip install claude-agent-sdk==0.2.127

v0.2.126

Choose a tag to compare

@github-actions github-actions released this 22 Jul 21:41

New Features

  • terminal_reason on ResultMessage: ResultMessage.terminal_reason now surfaces why the query loop ended ("completed", "max_turns", "aborted_streaming", "aborted_tools", etc.). A value of "aborted_streaming" or "aborted_tools" means the turn was cancelled via ClaudeSDKClient.interrupt(). Mirrors the TypeScript SDK's SDKResultMessage.terminal_reason (#1142)
  • Typed model_usage on ResultMessage: ResultMessage.model_usage is now typed as dict[str, ModelUsage] instead of dict[str, Any], with a new ModelUsage TypedDict that mirrors the TypeScript SDK's shape. Includes optional canonicalModel and provider fields for stable model identification across provider-specific aliases (#1143)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.218

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

pip install claude-agent-sdk==0.2.126

v0.2.125

Choose a tag to compare

@github-actions github-actions released this 21 Jul 21:48

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.217

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

pip install claude-agent-sdk==0.2.125

v0.2.124

Choose a tag to compare

@github-actions github-actions released this 20 Jul 22:28

Bug Fixes

  • Refused batch script CLI spawning on Windows: Blocked spawning .bat/.cmd CLI scripts (including npm's claude.cmd shim) on Windows to prevent command injection via cmd.exe metacharacter re-parsing (BatBadBut / CVE-2024-27980 class). Windows users relying on the npm shim should switch to the native installer, an explicit claude.exe path, or a platform wheel that bundles the CLI (#1127)
  • Windows cmd.exe metacharacter rejection: resume and session_id values containing cmd.exe metacharacters (& | < > ^ % ! ") or newlines now raise ValueError on Windows, preventing injection even if a cmd.exe hop is reintroduced. POSIX behavior is unchanged (#1127)
  • Dash-prefixed extra_args value binding: extra_args now uses --flag=value form when the value starts with -, preventing a dash-leading value from being misinterpreted as a separate CLI flag (#1127)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.216

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

pip install claude-agent-sdk==0.2.124

v0.2.123

Choose a tag to compare

@github-actions github-actions released this 19 Jul 03:08

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.215

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

pip install claude-agent-sdk==0.2.123

v0.2.122

Choose a tag to compare

@github-actions github-actions released this 18 Jul 01:33

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.214

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

pip install claude-agent-sdk==0.2.122

v0.2.121

Choose a tag to compare

@github-actions github-actions released this 17 Jul 00:39

Bug Fixes

  • Fixed argv flag injection via resume and session_id options: --resume and --session-id are now passed as single =-joined argv tokens (e.g. --resume=<value>) so that a dash-prefixed value is never misinterpreted as an independent CLI flag (#1123)

Internal/Other Changes

  • Hardened build scripts against command injection via CLAUDE_CLI_VERSION: Added version validation (_cli_version_validation.py) and eliminated shell interpolation in download_cli.py and update_cli_version.py so that a malformed version string cannot inject shell or Python code during builds (#1117)
  • CI now lints and typechecks scripts/ alongside src/ and tests/
  • CI CLI install steps now fail properly when curl errors (added shell: bash for pipefail)
  • Updated bundled Claude CLI to version 2.1.212

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

pip install claude-agent-sdk==0.2.121

v0.2.120

Choose a tag to compare

@github-actions github-actions released this 15 Jul 23:19

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.211

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

pip install claude-agent-sdk==0.2.120

v0.2.119

Choose a tag to compare

@github-actions github-actions released this 14 Jul 23:58

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.210

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

pip install claude-agent-sdk==0.2.119