Claude Agent SDK for Python
4 hours ago
- #Python SDK
- #Claude Agent
- #Async Programming
- Python SDK for Claude Agent requires Python 3.10+ and Node.js.
- Installation is done via pip and npm for Claude Code.
- The SDK provides async functions like `query()` for interacting with Claude.
- Custom tools can be defined in-process with the `@tool` decorator.
- Hooks allow deterministic processing and automated feedback for Claude.
- Supports both SDK (in-process) and external MCP servers.
- Includes various message types and content blocks for interaction.
- Error handling includes specific exceptions like `CLINotFoundError`.
- Comprehensive examples available for quick start and advanced usage.
- Upgrading from older versions involves breaking changes detailed in CHANGELOG.md.