Skip to content

Conversation

@ashwin-ant
Copy link
Collaborator

  • Add conditional stderr routing in subprocess transport
  • When debug-to-stderr flag is set, Claude CLI debug output goes directly to Python's stderr
  • Keeps stdout clean for JSON message parsing while providing debug visibility
  • Simplifies implementation by removing temp file and background task complexity
  • Update examples to demonstrate debug-to-stderr usage

🤖 Generated with Claude Code

- Add conditional stderr routing in subprocess transport
- When debug-to-stderr flag is set, Claude CLI debug output goes directly to Python's stderr
- Keeps stdout clean for JSON message parsing while providing debug visibility
- Simplifies implementation by removing temp file and background task complexity
- Update examples to demonstrate debug-to-stderr usage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@blois
Copy link
Collaborator

blois commented Sep 5, 2025

Instead of a string arg, could there be something like an stderr file pointer that it pipes to if set? Then the caller can redirect as desired.

- Add debug_stderr field to ClaudeCodeOptions with sys.stderr as default
- Allows customers to route debug output to files, buffers, or custom streams
- Maintains backward compatibility while providing maximum flexibility
- Only routes debug output when both debug-to-stderr flag and debug_stderr are set

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ashwin-ant ashwin-ant merged commit 99d1371 into main Sep 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants