Plugin Ecosystem

ralph-wiggum

Iterative refinement loops using the Ralph Wiggum technique — continuous self-referential AI loops for task completion.

New

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

CommandDescriptionWhen to Use
/ralph-loopStart a Ralph Wiggum iterative loop in the current sessionWhen you want Claude to iterate on a task until completion
/cancel-ralphCancel an active Ralph loopWhen you want to stop an iterative loop
/helpShow ralph-wiggum usage informationWhen 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

  1. You provide a prompt — A file describing what you want Claude to accomplish, including what "done" looks like (the completion promise).
  2. Ralph starts looping/ralph-loop launches a bash loop that repeatedly invokes Claude with your prompt file.
  3. Each iteration, Claude works — Claude reads the prompt, examines the current state of the codebase, makes changes, and exits.
  4. The loop continues — The next iteration starts fresh. Claude reads the (now modified) codebase, the same prompt, and continues improving.
  5. Completion — When Claude determines the completion promise has been met, the loop exits.

Common Workflows

Iterative Refinement

When a task requires many small iterations:

  1. Write a prompt file — Create a file describing the task, constraints, and what "done" means. Be specific about the completion criteria.
  2. Start the loop — Run /ralph-loop with your prompt file and optionally set --max-iterations to prevent infinite loops.
  3. Watch or walk away — Ralph runs unattended. Each iteration picks up where the last left off because Claude reads the current file state.
  4. Cancel if needed — Run /cancel-ralph to 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-iterations to 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