[BUG] Sometimes missing result in --output-format stream-json
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Sep 24, 2025 · closed Jan 11, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using --output-format stream-json, the final message with subtype: success returns an empty result field instead of containing the actual response content/output.
What Should Happen?
Result shouldn't be empty.
Error Messages/Logs
Steps to Reproduce
Not sure, happens randomly with the following arguments:
-p
--verbose
--mcp-config [mcpFile]
--output-format stream-json
--max-turns 100
Claude Model
Sonnet (default)
Is this a regression?
I don't know. But maybe, because when I started with claude code like 1.0.20? It never happened, and it seems it's getting worse over time
Last Working Version
_No response_
Claude Code Version
1.0.123
Platform
Google Vertex AI
Operating System
Other Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
Also sometimes happens, that final result_sucesss message is missing.
In previous messages I can see "type: message" that contains response that I would expect
8 Comments
+1 to this, I'm seeing a similar issue with
--output-format json --print, without the--verboseflag. The message has subtype success, but the result is an empty string.FWIW when this happens, the last line in the .jsonl file in the .claude/projects folder ends with a tool_result user message marking the final TODO complete.
When a successful result is returned the final line in the .jsonl file is an assistant message instead.
I have the same problem. What is the cause? Do you have a workaround or a fix date?
I encountered the same issue when using
stream-jsonas the output format.The last line of the output file appears as:
It occurs quite frequently; 36 out of 91 trials in my case.
For me, when this happens, the second to last line is always
Also seeing this issue frequently
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Still happening
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.