Ship working code while you sleep.
A comprehensive guide to the Ralph Wiggum Loop - an autonomous AI coding methodology created by Geoffrey Huntley.
Ralph is a deceptively simple approach to autonomous AI coding that uses a for loop instead of complex orchestration systems. While the AI industry builds increasingly complex agent swarms, meshes, and orchestrators, Ralph achieves better results with basic iteration.
#!/bin/bash
for i in {1..N}; do
claude --print "Pick ONE incomplete item from plans/prd.json and implement it.
Run tests. If they pass, commit. Update the PRD passes field."
doneThe key insight: simplicity beats complexity.
The name comes from The Simpsons character Ralph Wiggum, known for his comedic simplicity - it looks almost too simple to work, but it does.
Traditional AI coding approaches suffer from:
- Context Rot - AI loses track of earlier context in long conversations
- Compaction - Context window fills with irrelevant information
- Complexity - Agent swarms introduce failure points
- Human Dependencies - Workflows requiring human intervention break autonomy
Ralph solves these by starting fresh for each task, using focused specifications, and removing humans from the loop entirely.
- Set up your project with tests, linting, and type checking
- Create a PRD (Product Requirements Document) in JSON format
- Configure agents.md with project context and commands
- Run the loop and wake up to working code
See the Implementation Guide for detailed setup instructions.
| Document | Description |
|---|---|
| 01 - Overview | What is Ralph and why it matters |
| 02 - Core Concepts | Fundamental principles and terminology |
| 03 - How Ralph Works | Technical implementation details |
| 04 - Back Pressure | The key to successful autonomous coding |
| 05 - Specifications | How to structure work for Ralph |
| 06 - agents.md Guide | Configuration best practices |
| 07 - Implementation | Setting up and running Ralph |
| 08 - Economics | The changing economics of software |
| 09 - Resources | Videos, articles, and further reading |
| 10 - Claude Code Workflow | Matt Pocock's practical workflow |
- Simplicity Over Complexity - A for loop beats elaborate orchestration
- Fresh Context Per Task - Start each task with a clean context
- Small, Atomic Changes - Keep changes small enough to verify independently
- Robust Feedback Loops - Invest heavily in automated testing
- No Human Tool Calls - True autonomy means no human intervention
- Fast Feedback - Optimize for quick iteration cycles
"Software development now costs $10.42 US an hour. It's less than you would pay a fast food retail worker." — Geoffrey Huntley
Ralph fundamentally changes development economics. Running 24/7, you can achieve weeks of traditional development work overnight.
This knowledge repository documents the work of:
- Geoffrey Huntley - Creator of the Ralph methodology
- Matt Pocock - Practical implementation guides and workflows
- Ralph by Geoffrey Huntley - Original article
- The Ralph Wiggum Loop from 1st principles - Geoffrey Huntley
- Ship working code while you sleep - Matt Pocock
See Resources for the complete list of sources.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This repository is licensed under the MIT License.
"There's a better way. Find it."