Reference

Ralph Loop

The Ralph loop is an autonomous coding technique pioneered by Geoffrey Huntley that breaks feature development into structured phases — plan, implement, test, verify, and PR review — each run as an independent agent loop with checkpoints. Wiggum CLI implements the Ralph loop as an open-source tool.

How the Ralph Loop Works

Instead of letting an AI agent freestyle through a feature, the Ralph loop imposes a structured execution cycle:

  1. Plan — The agent reads the spec and creates a step-by-step implementation plan
  2. Implement — Code gets written according to the plan
  3. Test — Automated tests are written and run against the implementation
  4. Verify — The agent checks its own work against the original specification
  5. PR — A pull request is created with a structured summary of changes

Ralph Loop with Claude Code

Wiggum CLI runs the Ralph loop using Claude Code (or any CLI-based coding agent) in three commands:

$ wiggum init    # scan your codebase
$ wiggum new    # AI interview → spec
$ wiggum run    # execute the Ralph loop
$ npm install -g wiggum-cli

Free and open source. Bring your own API keys.

Ralph Loop vs Bash Scripts

Bash Scripts Ralph Loop (Wiggum)
Execution Single retry loop 5 isolated phases
Spec quality Manual prompt AI-generated from codebase context
Error recovery Restart from scratch Phase-level retry
Monitoring Terminal output TUI with phase tracking
Agent support Hardcoded Any CLI agent

Deep dive: Wiggum CLI vs Ralph Wiggum Bash Scripts

Ralph Loop with Other AI Agents

The Ralph loop technique is agent-agnostic. Wiggum generates specs in plain markdown — any CLI-based coding agent can execute them:

FAQ

What is a Ralph loop in Claude Code?

A Ralph loop in Claude Code is an autonomous coding cycle where Claude Code executes structured phases — plan, implement, test, verify, and PR — without manual intervention. Wiggum CLI automates this by generating specs and managing the loop lifecycle.

Is the Ralph loop the same as the Ralph Wiggum technique?

Yes. "Ralph loop," "Ralph Wiggum loop," and "Ralph Wiggum technique" all refer to the same autonomous coding methodology pioneered by Geoffrey Huntley. The technique breaks feature development into structured agent phases with checkpoints.

Can I use Ralph loops with AI agents other than Claude?

Yes. The Ralph loop technique is agent-agnostic. Wiggum CLI generates specs in markdown that work with Claude Code, OpenAI Codex, Gemini CLI, OpenCode, or any CLI-based coding agent.

How is a Ralph loop different from a bash script loop?

Bash scripts run agents in a single undifferentiated retry loop. A Ralph loop separates execution into distinct phases — plan, implement, test, verify, PR — each with independent checkpoints, error handling, and retry logic. Full comparison here.

Start running Ralph loops

Install Wiggum, scan your codebase, and run your first autonomous loop in minutes.