Skip to content

Commit 478bb5b

Browse files
Add project README with usage guide and Ralph Wiggum technique overview
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb4ae39 commit 478bb5b

1 file changed

Lines changed: 95 additions & 0 deletions

File tree

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Ralph
2+
3+
Ralph is an implementation of the [Ralph Wiggum technique](https://ghuntley.com/ralph/) — an autonomous, iterative coding loop that runs AI coding agents continuously until your tasks are done.
4+
5+
The core insight is simple: **iteration beats perfection**. Ralph repeatedly feeds an AI agent a prompt, lets it work in an isolated git worktree, commits and pushes the results, then starts the next iteration. Progress lives in your files and git history, not in the LLM's context window. Given enough iterations, modern LLMs reliably converge on correct solutions.
6+
7+
Ralph comes as both a **CLI tool** and a **desktop GUI** (built with Tauri + React).
8+
9+
## Prerequisites
10+
11+
- **Git** installed and available in your PATH
12+
- **At least one supported AI backend CLI** installed:
13+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
14+
- [GitHub Copilot CLI](https://github.com/github/copilot-cli) (`copilot`)
15+
- [Cursor](https://www.cursor.com/) (`cursor`)
16+
- [Codex](https://github.com/openai/codex) (`codex`)
17+
- **A git-enabled project** with one or more `PROMPT-<mode>.md` files in the project root
18+
- **Rust toolchain** (to build from source)
19+
- **Node.js 16+** (only needed for the desktop GUI)
20+
21+
## Prompt files
22+
23+
Ralph discovers what to do by scanning your project root for files matching the pattern `PROMPT-<mode>.md`. Each file defines a *mode* — a set of instructions the AI agent receives on every iteration.
24+
25+
For example, a file named `PROMPT-refactor.md` creates a mode called `refactor`. Write your task description, acceptance criteria, and any constraints in this file. The AI reads it fresh on each iteration and uses git history to understand what has already been done.
26+
27+
## Usage
28+
29+
### CLI
30+
31+
```bash
32+
# Run the "refactor" mode (reads PROMPT-refactor.md)
33+
ralph refactor
34+
35+
# Specify a custom branch name
36+
ralph refactor --branch my-refactor-branch
37+
38+
# Use a different AI backend and model
39+
ralph refactor --backend codex --model o3
40+
41+
# Disable automatic semver tagging
42+
ralph refactor --no-tag
43+
44+
# Add a preamble to the prompt
45+
ralph refactor --preamble "Focus on the src/api directory only"
46+
```
47+
48+
**Options:**
49+
50+
| Flag | Short | Default | Description |
51+
|------|-------|---------|-------------|
52+
| `--branch` | `-b` | `ralph-<mode>` | Branch name for the worktree |
53+
| `--main-branch` | `-m` | `main` | Main/trunk branch to rebase from |
54+
| `--backend` | `-B` | `claude` | AI backend (`claude`, `copilot`, `cursor`, `codex`) |
55+
| `--model` | `-m` | *(backend default)* | Model override (e.g. `sonnet`, `opus`, `o3`) |
56+
| `--preamble` | `-p` | *(empty)* | Text prepended to the prompt |
57+
| `--no-tag` | `-T` | `false` | Disable automatic semver tagging |
58+
59+
Press **Ctrl+C** once to stop gracefully after the current iteration. Press it twice to abort immediately.
60+
61+
### Desktop GUI
62+
63+
```bash
64+
# Development mode
65+
npm run tauri dev
66+
67+
# Production build
68+
npm run tauri build
69+
```
70+
71+
The desktop app lets you run multiple sessions concurrently, monitor live AI output, and manage sessions with start/stop/resume controls.
72+
73+
## How it works
74+
75+
Each iteration follows this loop:
76+
77+
1. **Checkout** — create or reuse an isolated git worktree for the session branch
78+
2. **Rebase** — pull latest changes from the main branch
79+
3. **Run AI** — invoke the AI backend with your prompt file
80+
4. **Push** — commit and push the AI's changes
81+
5. **Tag** — optionally apply a semver tag
82+
6. **Repeat** — start the next iteration
83+
84+
Ralph handles crash recovery, rate limiting (automatic pause/resume), and git conflicts (stash and retry) so the loop can run unattended for hours.
85+
86+
## Building from source
87+
88+
```bash
89+
# CLI only
90+
cargo build --release -p ralph-cli
91+
92+
# Desktop app
93+
npm install
94+
npm run tauri build
95+
```

0 commit comments

Comments
 (0)