mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
Some checks are pending
Test / test (macos-latest, 3.10) (push) Waiting to run
Test / test (macos-latest, 3.11) (push) Waiting to run
Test / test (macos-latest, 3.12) (push) Waiting to run
Test / test (ubuntu-latest, 3.10) (push) Waiting to run
Test / test (ubuntu-latest, 3.11) (push) Waiting to run
Test / test (ubuntu-latest, 3.12) (push) Waiting to run
Test / test (ubuntu-latest, 3.13) (push) Waiting to run
Test / test (windows-latest, 3.10) (push) Waiting to run
Test / test (windows-latest, 3.11) (push) Waiting to run
Test / test (windows-latest, 3.12) (push) Waiting to run
Test / test (windows-latest, 3.13) (push) Waiting to run
Test / test-e2e (macos-latest, 3.11) (push) Blocked by required conditions
Test / test-e2e (macos-latest, 3.12) (push) Blocked by required conditions
Test / test-e2e (macos-latest, 3.13) (push) Blocked by required conditions
Lint / lint (push) Waiting to run
Test / test (macos-latest, 3.13) (push) Waiting to run
Test / test-e2e (macos-latest, 3.10) (push) Blocked by required conditions
Test / test-e2e (ubuntu-latest, 3.13) (push) Blocked by required conditions
Test / test-e2e (windows-latest, 3.10) (push) Blocked by required conditions
Test / test-e2e (windows-latest, 3.11) (push) Blocked by required conditions
Test / test-e2e (windows-latest, 3.12) (push) Blocked by required conditions
Test / test-e2e (ubuntu-latest, 3.10) (push) Blocked by required conditions
Test / test-e2e (ubuntu-latest, 3.11) (push) Blocked by required conditions
Test / test-e2e (ubuntu-latest, 3.12) (push) Blocked by required conditions
Test / test-e2e (windows-latest, 3.13) (push) Blocked by required conditions
Test / test-examples (3.10) (push) Blocked by required conditions
Test / test-examples (3.11) (push) Blocked by required conditions
Test / test-examples (3.12) (push) Blocked by required conditions
Test / test-examples (3.13) (push) Blocked by required conditions
This PR updates the version to 0.1.4 after publishing to PyPI. ## Changes - Updated version in `pyproject.toml` - Updated version in `src/claude_agent_sdk/_version.py` - Updated `CHANGELOG.md` with release notes ## Release Information - Published to PyPI: https://pypi.org/project/claude-agent-sdk/0.1.4/ - Install with: `pip install claude-agent-sdk==0.1.4` 🤖 Generated by GitHub Actions --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
5.9 KiB
5.9 KiB
Changelog
0.1.4
Features
- Skip version check: Added
CLAUDE_AGENT_SDK_SKIP_VERSION_CHECKenvironment variable to allow users to disable the Claude Code version check. Set this environment variable to skip the minimum version validation when the SDK connects to Claude Code. (Only recommended if you already have Claude Code 2.0.0 or higher installed, otherwise some functionality may break) - SDK MCP server tool calls can now return image content blocks
0.1.3
Features
- Strongly-typed hook inputs: Added typed hook input structures (
PreToolUseHookInput,PostToolUseHookInput,UserPromptSubmitHookInput, etc.) using TypedDict for better IDE autocomplete and type safety. Hook callbacks now receive fully typed input parameters
Bug Fixes
- Hook output field conversion: Fixed bug where Python-safe field names (
async_,continue_) in hook outputs were not being converted to CLI format (async,continue). This caused hook control fields to be silently ignored, preventing proper hook behavior. The SDK now automatically converts field names when communicating with the CLI
Internal/Other Changes
- CI/CD: Re-enabled Windows testing in the end-to-end test workflow. Windows CI had been temporarily disabled but is now fully operational across all test suites
0.1.2
Bug Fixes
- Hook output fields: Added missing hook output fields to match the TypeScript SDK, including
reason,continue_,suppressOutput, andstopReason. Thedecisionfield now properly supports both "approve" and "block" values. AddedAsyncHookJSONOutputtype for deferred hook execution and proper typing forhookSpecificOutputwith discriminated unions
0.1.1
Features
- Minimum Claude Code version check: Added version validation to ensure Claude Code 2.0.0+ is installed. The SDK will display a warning if an older version is detected, helping prevent compatibility issues
- Updated PermissionResult types: Aligned permission result types with the latest control protocol for better type safety and compatibility
Improvements
- Model references: Updated all examples and tests to use the simplified
claude-sonnet-4-5model identifier instead of dated version strings
0.1.0
Introducing the Claude Agent SDK! The Claude Code SDK has been renamed to better reflect its capabilities for building AI agents across all domains, not just coding.
Breaking Changes
Type Name Changes
-
ClaudeCodeOptions renamed to ClaudeAgentOptions: The options type has been renamed to match the new SDK branding. Update all imports and type references:
# Before from claude_agent_sdk import query, ClaudeCodeOptions options = ClaudeCodeOptions(...) # After from claude_agent_sdk import query, ClaudeAgentOptions options = ClaudeAgentOptions(...)
System Prompt Changes
- Merged prompt options: The
custom_system_promptandappend_system_promptfields have been merged into a singlesystem_promptfield for simpler configuration - No default system prompt: The Claude Code system prompt is no longer included by default, giving you full control over agent behavior. To use the Claude Code system prompt, explicitly set:
system_prompt={"type": "preset", "preset": "claude_code"}
Settings Isolation
- No filesystem settings by default: Settings files (
settings.json,CLAUDE.md), slash commands, and subagents are no longer loaded automatically. This ensures SDK applications have predictable behavior independent of local filesystem configurations - Explicit settings control: Use the new
setting_sourcesfield to specify which settings locations to load:["user", "project", "local"]
For full migration instructions, see our migration guide.
New Features
- Programmatic subagents: Subagents can now be defined inline in code using the
agentsoption, enabling dynamic agent creation without filesystem dependencies. Learn more - Session forking: Resume sessions with the new
fork_sessionoption to branch conversations and explore different approaches from the same starting point. Learn more - Granular settings control: The
setting_sourcesoption gives you fine-grained control over which filesystem settings to load, improving isolation for CI/CD, testing, and production deployments
Documentation
- Comprehensive documentation now available in the API Guide
- New guides for Custom Tools, Permissions, Session Management, and more
- Complete Python API reference
0.0.22
- Introduce custom tools, implemented as in-process MCP servers.
- Introduce hooks.
- Update internal
Transportclass to lower-level interface. ClaudeSDKClientcan no longer be run in different async contexts.
0.0.19
- Add
ClaudeCodeOptions.add_dirsfor--add-dir - Fix ClaudeCodeSDK hanging when MCP servers log to Claude Code stderr
0.0.18
- Add
ClaudeCodeOptions.settingsfor--settings
0.0.17
- Remove dependency on asyncio for Trio compatibility
0.0.16
- Introduce ClaudeSDKClient for bidirectional streaming conversation
- Support Message input, not just string prompts, in query()
- Raise explicit error if the cwd does not exist
0.0.14
- Add safety limits to Claude Code CLI stderr reading
- Improve handling of output JSON messages split across multiple stream reads
0.0.13
- Update MCP (Model Context Protocol) types to align with Claude Code expectations
- Fix multi-line buffering issue
- Rename cost_usd to total_cost_usd in API responses
- Fix optional cost fields handling