[BUG] Sometimes missing result in --output-format stream-json

Status Closed — not planned
Maintainer reply None cached
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

View original on GitHub ↗

8 Comments

tjdammann · 1 year ago

+1 to this, I'm seeing a similar issue with --output-format json --print, without the --verbose flag. 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.

  • The third to last line is an assistant message with the content I'd expect to be returned
  • The second to last line is a tool call to TodoWrite
  • The last line is the result of the tool

When a successful result is returned the final line in the .jsonl file is an assistant message instead.

AlexeyEfimchik · 1 year ago

I have the same problem. What is the cause? Do you have a workaround or a fix date?

agb94 · 11 months ago

I encountered the same issue when using stream-json as the output format.
The last line of the output file appears as:

{"type": "result", "subtype": "success", "is_error": false, ..., "result": ""}

It occurs quite frequently; 36 out of 91 trials in my case.
For me, when this happens, the second to last line is always

{"type":"user","message":{"role":"user","content":[{"tool_use_id":"...","type":"tool_result","content":"Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable"}]},"parent_tool_use_id":null,"session_id":"...","uuid":"..."}
arjun810 · 11 months ago

Also seeing this issue frequently

github-actions[bot] · 10 months ago

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.

Dasio · 10 months ago

Still happening

github-actions[bot] · 9 months ago

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.

github-actions[bot] · 8 months ago

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.