mirror of
https://github.com/anthropics/claude-agent-sdk-python.git
synced 2025-10-06 01:00:03 +03:00
3.7 KiB
3.7 KiB
Changelog
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