Skip to content

fix(claude-code): add --verbose flag for stream-json output format#305

Open
f-liva wants to merge 1 commit intoRightNow-AI:mainfrom
f-liva:fix/claude-code-stream-verbose
Open

fix(claude-code): add --verbose flag for stream-json output format#305
f-liva wants to merge 1 commit intoRightNow-AI:mainfrom
f-liva:fix/claude-code-stream-verbose

Conversation

@f-liva
Copy link

@f-liva f-liva commented Mar 4, 2026

Summary

  • Claude CLI requires --verbose when using --output-format=stream-json with -p (print mode)
  • Without it, the CLI exits with code 1 and all streaming requests fail silently
  • Added the missing --verbose flag in the stream() method of ClaudeCodeDriver

Reproduction

$ claude -p "hello" --output-format stream-json
Error: When using --print, --output-format=stream-json requires --verbose

Test plan

  • Verified claude -p "hello" --output-format stream-json fails without --verbose
  • Verified claude -p "hello" --verbose --output-format stream-json works correctly
  • Tested full agent loop with streaming — messages are now processed successfully

Fixes #304

Claude CLI requires --verbose when using --output-format=stream-json
with -p (print mode). Without it, the CLI exits with code 1:

  Error: When using --print, --output-format=stream-json requires --verbose

This caused all streaming requests through the claude-code driver to
fail silently, returning empty responses.

Fixes RightNow-AI#304
egargale pushed a commit to egargale/openfang that referenced this pull request Mar 5, 2026
…w-AI#305)

The tool use protocol in channels/mod.rs was using <invoke> tags,
but the parser in agent/loop_.rs only recognizes <tool_call> tags.
This ensures consistency across all entry points.
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.

Claude Code driver: stream-json fails with exit code 1 (missing --verbose flag)

1 participant