agent-tooling / library
Claude Agent SDK for Python
Capability: Claude Agent SDK for Python
Use it when
- You want a Python application to run an agent that can read, write, edit files and execute shell commands without building your own agent loop, tool executor, and permission system from scratch
- Your embedded agent keeps using tools you did not intend and you need an allowlist, disallowed_tools, and PreToolUse hooks that deterministically deny specific commands before they run
What it solves
Not the fit when
- Simple single-shot Claude API calls without tool use, where a plain API client is enough
- Long-term memory across sessions, which is not a documented feature
- Non-Python applications (this package targets Python 3.10+)
- no-cross-session-recall
- multi-model-routing
- cost-per-call-too-high
Install
pip install claude-agent-sdk
Invoke
from claude_agent_sdk import query, ClaudeAgentOptions; async for message in query(prompt='...', options=ClaudeAgentOptions(allowed_tools=['Read','Write','Bash'], permission_mode='acceptEdits')): ...
Alternatives
No reviewed alternatives recorded yet.