ralph-loop Plugin
Plugin Claude Code Development Claude Code Customization & WorkflowThe explanation below is AI-generated. Please verify it against the sources.
ralph-loop is a Claude Code plugin that implements the "Ralph Wiggum technique": it repeatedly feeds Claude the same task prompt via a Stop hook that blocks normal session exit, so Claude keeps iterating on files (seeing its own prior work and git history) until a specified completion phrase appears or a maximum iteration count is reached. It is started with the /ralph-loop command and can be cancelled with /cancel-ralph. According to the README, it works well for well-defined tasks with automatic verification (tests, linters) but is not suited to tasks needing human judgment, one-shot operations, or unclear success criteria. The README also notes a Windows compatibility issue where the bash-based Stop hook can fail if the wrong bash (WSL instead of Git Bash) is used, with a documented workaround.
Overview
A Claude Code plugin (not a standalone SaaS) that adds a Stop hook and slash commands to Claude Code, enabling self-referential AI development loops in which Claude repeatedly retries the same task until a completion condition is met.
What you can do with ralph-loop
- Start a loop with /ralph-loop "" --max-iterations --completion-promise "" so Claude repeatedly works on the same task until it outputs the completion phrase or hits the iteration limit
- Stop an active loop at any time with /cancel-ralph
- Let Claude iteratively refine work (e.g., implement code, run tests, fix failures, repeat) since previous work persists in files and git history across iterations
- Set --max-iterations as a safety net to avoid infinite loops on tasks that may be impossible to complete
- Follow README-documented prompt-writing practices (clear completion criteria, incremental goals, self-correction steps) to improve loop outcomes
- Apply the Windows-specific workaround (editing hooks/hooks.json to point to Git Bash) if the Stop hook fails due to WSL bash being resolved instead of Git Bash
Sources
Original description (English)
Interactive self-referential AI loops for iterative development, implementing the Ralph Wiggum technique. Claude works on the same task repeatedly, seeing its previous work, until completion.
History of ralph-loop
- Plugin Added ralph-loop