mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
## Summary - Add stderr callback option to ClaudeCodeOptions to capture CLI subprocess stderr output - Matches TypeScript SDK's stderr callback behavior for feature parity - Useful for debugging and monitoring CLI operations ## Changes - Added `stderr: Callable[[str], None] | None` field to `ClaudeCodeOptions` - Updated `SubprocessCLITransport` to handle stderr streaming with async task - Added example demonstrating stderr callback usage - Added e2e tests to verify functionality ## Test plan - [x] Run e2e tests: `python -m pytest e2e-tests/test_stderr_callback.py -v` - [x] Run example: `python examples/stderr_callback_example.py` - [x] Verify backward compatibility with existing `debug_stderr` field - [x] All linting and type checks pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| agents.py | ||
| hooks.py | ||
| include_partial_messages.py | ||
| mcp_calculator.py | ||
| quick_start.py | ||
| setting_sources.py | ||
| stderr_callback_example.py | ||
| streaming_mode.py | ||
| streaming_mode_ipython.py | ||
| streaming_mode_trio.py | ||
| system_prompt.py | ||
| tool_permission_callback.py | ||