claude -p produces empty output despite model responding (v2.1.83)
Resolved 💬 3 comments Opened Mar 25, 2026 by vp275 Closed Apr 19, 2026
Bug Description
claude -p (print/non-interactive mode) produces no output. The model responds correctly (visible in streaming output), but the final result field is empty, so nothing gets printed to stdout.
Steps to Reproduce
claude -p "say hello"
# No output, exit code 0
claude -p "say hello" --output-format json
# result field is empty: "result":""
Expected Behavior
The model's response should be printed to stdout.
Actual Behavior
No output. Exit code 0. The JSON output shows "result":"" with 13 output tokens consumed.
Diagnosis
Using --output-format stream-json --verbose reveals the model IS responding:
{"type":"assistant","message":{"content":[{"type":"text","text":"\n\nHello! How can I help you today?"}]}}
But the final result object has an empty result field:
{"type":"result","subtype":"success","is_error":false,"result":"","stop_reason":"end_turn",...}
The response exists in the stream but is not captured into the result field.
Additional details
- Tested with both Opus and Sonnet, same behavior
- Tested from different directories (
~/.claude,/tmp), same behavior - Tested with
--output-format textand--output-format json, same behavior - Exit code is always 0
Environment
- Claude Code version: 2.1.83 (latest as of 2026-03-26)
- Platform: macOS (Darwin 24.6.0)
- Shell: zsh
- Plugins installed: oh-my-claude-sisyphus, frontend-design, claude-notifications-go (disabled)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗