claude-code-sdk-python is the Python SDK for Claude Code, Anthropic’s agentic coding system. It provides abstractions to easily query Claude Code (with streaming support) and conduct interactive sessions. The SDK includes core client classes, asynchronous query functions, and support for custom tools and hooks within Claude sessions. It is designed to integrate with local Python workflows and allow developers to embed Claude Code capabilities directly in their applications or scripts. The repo is MIT-licensed and includes documentation and installation instructions (requires Python 3.10+, Node installation of Claude Code). Example usage shows how to stream responses, parse structured message blocks, or create persistent client sessions.
Features
- Async query interface (query()) returning streamed response messages
- ClaudeSDKClient class supporting interactive conversations with tools and hooks
- Message and content classes (e.g. AssistantMessage, TextBlock) to parse responses
- Support for embedding tool calls inside agent workflows
- Integration support for local Python applications, pipelines, or agents
- Documentation, example usage, and MIT licensing
Categories
AI ModelsLicense
MIT LicenseFollow Claude Code SDK Python
Other Useful Business Software
MongoDB Atlas runs apps anywhere
MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Claude Code SDK Python!