ralph-run
v1.0.12
Published
Autonomous Claude Code runner that executes tasks from a backlog or feature plans
Maintainers
Readme
Ralph
Autonomous Claude Code runner for hands-off task execution.
Ralph runs Claude Code in a loop, working through backlog tasks or feature plans until complete, stuck, or max iterations reached.
Installation
npm install -g ralph-runRalph checks for updates on startup and notifies you when a new version is available.
Setup
In any project where you want to use Ralph:
ralph setupThis creates:
.ralph/backlog.json- Task backlog.ralph/state.json- Runner state.ralph/progress.txt- Progress log
Notifications (optional)
Set NTFY_URL in your environment to receive notifications when Ralph completes, errors, or gets stuck:
export NTFY_URL=https://ntfy.sh/your-topicUsage
Backlog Mode
Work through tasks in .ralph/backlog.json:
ralph backlog # Run loop until complete or max iterations
ralph backlog --once # Single iteration
ralph backlog --resume # Resume from last iteration
ralph backlog --max-iterations 100Feature Mode
Run a specific feature plan from .ralph/features/<name>/:
ralph feature <name>
ralph feature <name> --onceFeature directories contain:
plan.md- Feature plan and contexttasks.json- Task breakdownprogress.txt- Progress log
Other Commands
ralph status # Show current state
ralph cancel # Stop running session
ralph help # Show helpShell Completions
ralph completions bash >> ~/.bashrcBacklog Format
{
"tasks": [
{
"title": "Add user authentication",
"description": "Implement JWT-based auth with refresh tokens",
"acceptance": ["Login endpoint works", "Tokens refresh correctly"],
"branch": "feature/auth",
"passes": false
}
]
}How It Works
- Ralph spawns Claude Code with
--permission-mode acceptEdits - Claude reads the backlog/feature plan and works on the highest priority task
- Claude runs linting, type checking, and tests
- Claude commits and creates/updates a PR
- If Claude outputs
<promise>COMPLETE</promise>, Ralph exits successfully - If Claude outputs
<promise>I AM STUCK</promise>, Ralph exits with an error - Otherwise, Ralph starts the next iteration
Requirements
- Bun
- Claude Code CLI
- Graphite CLI (for PR workflows)
