ralph-wiggum
Iterative refinement loops using the Ralph Wiggum technique — continuous self-referential AI loops for task completion.
Implementation of the Ralph Wiggum technique — continuous self-referential AI loops for interactive iterative development. Run Claude in a while-true loop with the same prompt until task completion.
Source: claude-code-plugins marketplace Version: 1.0.0 Author: Daisy Hollman (Anthropic)
Key Commands
| Command | Description | When to Use |
|---|---|---|
/ralph-loop | Start a Ralph Wiggum iterative loop in the current session | When you want Claude to iterate on a task until completion |
/cancel-ralph | Cancel an active Ralph loop | When you want to stop an iterative loop |
/help | Show ralph-wiggum usage information | When learning how to use the plugin |
Skills
Ralph-wiggum has no auto-activating skills. It operates entirely through its commands.
Agents
Ralph-wiggum has no agents.
What Is the Ralph Wiggum Technique?
The Ralph Wiggum technique is a development methodology based on continuous AI agent loops. The core idea is simple: run Claude in a while true bash loop, feeding it the same prompt file repeatedly, allowing it to iteratively improve its work until completion.
The technique is named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks — keep trying, keep improving, and eventually the task gets done.
As Geoffrey Huntley describes it: "Ralph is a Bash loop."
How It Works
- You provide a prompt — A file describing what you want Claude to accomplish, including what "done" looks like (the completion promise).
- Ralph starts looping —
/ralph-looplaunches a bash loop that repeatedly invokes Claude with your prompt file. - Each iteration, Claude works — Claude reads the prompt, examines the current state of the codebase, makes changes, and exits.
- The loop continues — The next iteration starts fresh. Claude reads the (now modified) codebase, the same prompt, and continues improving.
- Completion — When Claude determines the completion promise has been met, the loop exits.
Common Workflows
Iterative Refinement
When a task requires many small iterations:
- Write a prompt file — Create a file describing the task, constraints, and what "done" means. Be specific about the completion criteria.
- Start the loop — Run
/ralph-loopwith your prompt file and optionally set--max-iterationsto prevent infinite loops. - Watch or walk away — Ralph runs unattended. Each iteration picks up where the last left off because Claude reads the current file state.
- Cancel if needed — Run
/cancel-ralphto stop the loop at any time.
Use Cases for Ralph Loops
- Large refactoring — Point Ralph at a refactoring task and let it work through files iteratively.
- Test coverage — Give Ralph a coverage target and let it write tests until the target is met.
- Documentation generation — Have Ralph iterate on documentation until it is complete.
- Code quality — Give Ralph a set of quality criteria and let it improve code until all criteria pass.
Tips
- Always set
--max-iterationsto prevent runaway loops. Start with a reasonable number (10-20) and increase if needed. - The completion promise is critical. Be specific about what "done" means, or the loop will run forever.
- Ralph works best for tasks where each iteration produces measurable progress. Vague tasks lead to circular loops.
- This plugin is from Anthropic and represents an officially recognized technique for iterative AI development.
See Also
- Implementing workflow — Alternative approach using superpowers' plan execution
- — All plugins overview