claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] `stop_reason` is always `None`

Open notabene00 opened this issue 8 months ago • 1 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: <!-- output of claude --version -->1.0.10 (Claude Code)
  • Operating System: N/A
  • Terminal: N/A

Steps to Reproduce

  1. update to v1.0.10
  2. run claude -p "run ls" --output-format stream-json --verbose
  3. look at the ouput

Expected Behavior

tool_use/end_turn/etc values for stop_reason

notabene00 avatar Jun 04 '25 00:06 notabene00

Hey! This is a recent change, and was intentional, due to an implementation detail in the way streaming works. What were you relying on the stop_reason for, out of curiosity?

bcherny avatar Jun 04 '25 04:06 bcherny

@bcherny I created an app to notify on my macbook whenever stop_reason is end_turn. Can we have this back instead of null or None?

ml0-1337 avatar Jun 11 '25 05:06 ml0-1337

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 10 '25 14:08 github-actions[bot]