Automated Claude Code workflow runner. Define tasks in a PRD, then let Claude work through them hands-free — one task per iteration, with git commits along the way.
git clone <repo-url> && cd ralph-cli
pnpm install && pnpm build
pnpm link --globalcd your-project
ralph init --name "My Project"
# Edit prd.json with your requirements
ralph runScaffolds three files in the current directory (skips existing):
prd.json— PRD template with example taskprogress.txt— empty progress logCLAUDE.md— instructions for Claude
Runs an automated loop (default: 10 iterations). Each iteration Claude:
- Picks the highest-priority incomplete task
- Implements it
- Updates
progress.txtand setspasses: truein the PRD - Makes a git commit
Stops early if Claude outputs <promise>COMPLETE</promise> (all tasks done).
ralph run # 10 iterations
ralph run 5 # 5 iterationsRuns Claude interactively for a single task with stdio: inherit. You can watch and intervene. Uses acceptEdits permission mode by default.
Shows PRD completion progress — no Claude invocation.
=== My Project — PRD Status ===
✔ TASK-001 high Set up project structure
○ TASK-002 medium Add authentication
1/2 complete (50%)
Available on run and once:
| Flag | Description | Default |
|---|---|---|
--sandbox |
Run via docker sandbox run claude |
off |
--model <model> |
Claude model (e.g. opus, sonnet) |
— |
--prd <path> |
PRD file path | prd.json |
--progress <path> |
Progress file path | progress.txt |
--permission-mode <mode> |
Permission mode | bypassPermissions (run) / acceptEdits (once) |
--max-budget <usd> |
Max budget per iteration | — |
Create ralph.config.json in your project root to set defaults (CLI flags override):
{
"model": "sonnet",
"sandbox": true,
"maxBudget": 3
}The PRD is a JSON file with this structure:
{
"projectName": "My Project",
"requirements": [
{
"id": "TASK-001",
"category": "Feature",
"priority": "high",
"description": "Short description",
"details": "Detailed implementation notes...",
"stepsToVerify": ["Step 1", "Step 2"],
"acceptanceCriteria": ["Criterion 1", "Criterion 2"],
"passes": false
}
]
}Set passes: true when a task is complete. Claude does this automatically during run/once.
- Node.js >= 18
- Claude Code CLI installed
- Docker (only if using
--sandbox)