Run the autonomous ralph loop for mechanical stories. Iterates with fresh context until all tasks pass.
Run the autonomous iteration loop for mechanical (machine-verifiable) stories.
# Run with defaults (10 iterations)
./scripts/ralph.sh
# Run with custom max iterations
./scripts/ralph.sh 20
# Run in an isolated worktree
./scripts/ralph.sh 15 --worktree
# Run on a specific branch
./scripts/ralph.sh 10 --branch feature/my-feature --worktree
Before running, ensure:
prd.json exists in the project root (use /prd to generate)shared-contracts.md exists with defined contracts (use /build-feature to generate)jq is installed (brew install jq)Each iteration:
prd.json to find the highest-priority incomplete storyclaude -p (clean context)progress.txt for the next iteration| Flag | Description |
|---|---|
--worktree | Run in an isolated git worktree (recommended for parallel execution) |
--branch <name> | Create/use a specific branch for the work |
For parallel execution on independent modules:
# Terminal 1: Frontend stories
./scripts/ralph.sh 10 --branch feature/frontend --worktree &
# Terminal 2: Backend stories
./scripts/ralph.sh 10 --branch feature/backend --worktree &
# Wait for both
wait
IMPORTANT: Only parallelize loops that work on completely different files. Never run two loops on overlapping files.