Skip to content

Claude Code

Claude Code is ralph’s default agent.

Install the Claude Code CLI:

Terminal window
npm install -g @anthropic-ai/claude-code
{
"agent": "claude",
"model": "claude-sonnet-4-5-20250514"
}

The model field is optional — Claude Code uses its default model if omitted.

Ralph spawns Claude Code with:

Terminal window
claude -p "<boot prompt>" --output-format stream-json --max-turns N --model <model>
  • -p — print mode (non-interactive, single prompt)
  • --output-format stream-json — structured JSONL output for log capture
  • --max-turns — limits agent turns based on task complexity
  • --model — optional model override

Ralph’s loop prompt is self-contained — it does not generate or manage .claude/CLAUDE.md or any other agent-specific instructions file. All methodology content, roles, and behavioral rules are injected directly into the agent session.