Skip to content

Releases: anthropics/claude-agent-sdk-python

v0.1.58

09 Apr 01:51

Choose a tag to compare

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.97

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

pip install claude-agent-sdk==0.1.58

v0.1.57

09 Apr 00:22

Choose a tag to compare

New Features

  • Cross-user prompt caching: Added exclude_dynamic_sections option to SystemPromptPreset, enabling cross-user prompt cache hits by moving per-user dynamic sections (working directory, memory, git status) out of the system prompt (#797)
  • Auto permission mode: Added "auto" to the PermissionMode type, bringing parity with the TypeScript SDK and CLI v2.1.90+ (#785)

Bug Fixes

  • Thinking configuration: Fixed thinking={"type": "adaptive"} incorrectly mapping to --max-thinking-tokens 32000 instead of --thinking adaptive. The disabled type similarly now uses --thinking disabled instead of --max-thinking-tokens 0, matching the TypeScript SDK behavior (#796)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.96

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

pip install claude-agent-sdk==0.1.57

v0.1.56

04 Apr 00:57

Choose a tag to compare

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.92

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

pip install claude-agent-sdk==0.1.56

v0.1.55

03 Apr 00:38

Choose a tag to compare

Bug Fixes

  • MCP large tool results: Forward maxResultSizeChars from ToolAnnotations via _meta to bypass Zod annotation stripping in the CLI, fixing silent truncation of large MCP tool results (>50K chars) (#756)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.91

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

pip install claude-agent-sdk==0.1.55

v0.1.54

02 Apr 00:09

Choose a tag to compare


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

pip install claude-agent-sdk==0.1.54

v0.1.53

31 Mar 00:47

Choose a tag to compare

Bug Fixes

  • Setting sources flag: Fixed --setting-sources being passed as an empty string when not provided, which caused the CLI to misparse subsequent flags (#778)
  • String prompt deadlock: Fixed deadlock when using query() with a string prompt and hooks/MCP servers that trigger many tool calls, by spawning wait_for_result_and_end_input() as a background task (#780)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.88

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

pip install claude-agent-sdk==0.1.53

v0.1.52

29 Mar 02:41

Choose a tag to compare

New Features

  • Context usage: Added get_context_usage() method to ClaudeSDKClient for querying context window usage by category (#764)
  • Annotated parameter descriptions: The @tool decorator and create_sdk_mcp_server now support typing.Annotated for per-parameter descriptions in JSON Schema (#762)
  • ToolPermissionContext fields: Exposed tool_use_id and agent_id in ToolPermissionContext for distinguishing parallel permission requests (#754)
  • Session ID option: Added session_id option to ClaudeAgentOptions for specifying custom session IDs (#750)

Bug Fixes

  • String prompt in connect(): Fixed connect(prompt="...") silently dropping the string prompt, causing receive_messages() to hang indefinitely (#769)
  • Cancel request handling: Implemented control_cancel_request handling so in-flight hook callbacks are properly cancelled when the CLI abandons them (#751)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.87
  • Increased CI timeout for example tests and reduced sleep duration in error handling example (#760)

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

pip install claude-agent-sdk==0.1.52

v0.1.51

27 Mar 20:22

Choose a tag to compare

New Features

  • Session management: Added fork_session(), delete_session(), and offset-based pagination for session listing (#744)
  • Task budget: Added task_budget option for token budget management (#747)
  • SystemPromptFile: Added support for --system-prompt-file CLI flag via SystemPromptFile (#591)
  • AgentDefinition fields: Added disallowedTools, maxTurns, and initialPrompt to AgentDefinition (#759)
  • Preserved fields: Preserve dropped fields on AssistantMessage and ResultMessage for forward compatibility (#718)

Bug Fixes

  • Python 3.10 compatibility: Use typing_extensions.TypedDict on Python 3.10 for NotRequired support (#761)
  • ResultMessage errors field: Added missing errors field to ResultMessage (#749)
  • Async generator cleanup: Resolved cross-task cancel scope RuntimeError on async generator cleanup (#746)
  • MCP tool input_schema: Convert TypedDict input_schema to proper JSON Schema in SDK MCP tools (#736)
  • initialize_timeout: Pass initialize_timeout from env var in query() (#743)
  • Async event loop blocking: Defer CLI discovery to connect() to avoid blocking async event loops (#722)
  • Permission mode: Added missing dontAsk permission mode to types (#719)
  • Environment filtering: Filter CLAUDECODE env var from subprocess environment (#732)
  • Process cleanup: Added SIGKILL fallback when SIGTERM handler blocks in close() (#729)
  • Duplicate warning: Removed duplicate version warning and included CLI path (#720)
  • MCP resource types: Handle resource_link and embedded resource content types in SDK MCP tools (#725)
  • Stdin timeout: Removed stdin timeout for hooks and SDK MCP servers (#731)
  • Stdout parsing: Skip non-JSON lines on CLI stdout to prevent buffer corruption (#723)
  • MCP error propagation: Propagate is_error flag from SDK MCP tool results (#717)
  • Install script: Retry install.sh fetch on 429 with pipefail + jitter (#708)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.85

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

pip install claude-agent-sdk==0.1.51

v0.1.50

20 Mar 23:02

Choose a tag to compare

New Features

  • Session info: Added tag and created_at fields to SDKSessionInfo and new get_session_info() function for retrieving session metadata (#667)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.81
  • Hardened PyPI publish workflow against partial-upload failures (#700)
  • Added daily PyPI storage quota monitoring (#705)

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

pip install claude-agent-sdk==0.1.50

v0.1.49

20 Mar 18:08
7251630

Choose a tag to compare

New Features

  • AgentDefinition: Added skills, memory, and mcpServers fields (#684)
  • AssistantMessage usage: Preserve per-turn usage on AssistantMessage (#685)
  • Session tagging: Added tag_session() with Unicode sanitization (#670)
  • Session renaming: Added rename_session() (#668)
  • RateLimitEvent: Added typed RateLimitEvent message (#648)

Bug Fixes

  • CLAUDE_CODE_ENTRYPOINT: Use default-if-absent semantics to match TS SDK (#686)
  • Fine-grained tool streaming: Reverted the env-var workaround from 0.1.48; partial-message delivery is now handled upstream (#671)

Internal/Other Changes

  • Updated bundled Claude CLI to version 2.1.77
  • Added macOS x86_64 wheel to the published matrix (#661)
  • Upload wheel-check artifacts in CI (#662)
  • Docs: clarified allowed_tools as a permission allowlist (#649)

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

pip install claude-agent-sdk==0.1.49