Skip to content

Fix Cannot run Claude Code#46

Open
tkafka wants to merge 1 commit intoTh0rgal:masterfrom
tkafka:fix-claude-code
Open

Fix Cannot run Claude Code#46
tkafka wants to merge 1 commit intoTh0rgal:masterfrom
tkafka:fix-claude-code

Conversation

@tkafka
Copy link

@tkafka tkafka commented Feb 17, 2026

Root cause was the Claude CLI argument combination. Fixes #45.

  • ralph was invoking Claude with -p (--print) plus --output-format stream-json but without --verbose.
  • Claude requires --verbose with that combo, so every iteration failed immediately with exit code 1 and looped.
  • I updated Claude arg construction in ralph.ts:96 to include --verbose whenever streaming JSON is enabled. What changed:
  • ralph.ts:96
    • from: --output-format stream-json --include-partial-messages
    • to: --output-format stream-json --include-partial-messages --verbose

Validation:

  • Ran: bun ralph.ts "Say hello" --agent claude-code --max-iterations 1 --no-commit
  • Result: Claude executed successfully, returned output, and loop completed with Exit code: 0 and Completion promise: detected.

- ralph was invoking Claude with -p (--print) plus --output-format
  stream-json but without --verbose.
- Claude requires --verbose with that combo, so every iteration failed
  immediately with exit code 1 and looped.
- I updated Claude arg construction in ralph.ts:96 to include --verbose
  whenever streaming JSON is enabled.
  What changed:
- ralph.ts:96
  - from: --output-format stream-json --include-partial-messages
  - to: --output-format stream-json --include-partial-messages --verbose
    Validation:
- Ran: bun ralph.ts "Say hello" --agent claude-code --max-iterations 1
  --no-commit
- Result: Claude executed successfully, returned output, and loop
  completed with Exit code: 0 and Completion promise: detected.
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.

[Bug] Cannot run Claude Code

1 participant

Comments