Everyone is raving about Ralph. What is it?
Ralph is an autonomous AI coding loop that ships features while you sleep.
Created by @GeoffreyHuntley and announced in his original post, it runs @AmpCode (or your agent of choice) repeatedly until all tasks are complete.
Each iteration is a fresh context window (keeping Threads nice and small). Memory persists via git history and text files.
I ran it for the first time and shipped a feature last night. I love it.
How It Works
A bash loop that:
Memory persists only through:
File Structure
ralph.sh
The loop:
Make executable:
Other agents:
prompt.md
Instructions for each iteration:
prd.json
Your task list:
Key fields:
progress.txt
Start with context:
Ralph appends after each story.
Patterns accumulate across iterations.
Running Ralph
Runs up to 25 iterations.
Ralph will:
Critical Success Factors
1. Small Stories
Must fit in one context window.
2. Feedback Loops
Ralph needs fast feedback:
Without these, broken code compounds.
3. Explicit Criteria
4. Learnings Compound
By story 10, Ralph knows patterns from stories 1-9.
Two places for learnings:
Before committing, Ralph updates AGENTS.md files in directories with edited files if it discovered reusable patterns (gotchas, conventions, dependencies).
5. AGENTS.md Updates
Ralph updates AGENTS.md when it learns something worth preserving:
6. Browser Testing
For UI changes, use the dev-browser skill by @sawyerhood. Load it with `Load the dev-browser skill`, then:
Not complete until verified with screenshot.
Common Gotchas
Idempotent migrations:
Interactive prompts:
Schema changes:
After editing schema, check:
Fixing related files is OK:
If typecheck requires other changes, make them. Not scope creep.
Monitoring
Real Results
We built an evaluation system:
Learnings compound. By story 10, Ralph knew our patterns.
When NOT to Use
For a great video walkthrough of how to use Ralph, checkout the video from @mattpocockuk ...