New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Autonomous iterative loop mode that reruns Claude Code against a fixed prompt until explicit completion criteria pass.

skills.sh installs
211
GitHub stars
46
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the setup, completion methods, configuration, and safety controls for persistent unattended task execution
  • Defines a state file at .claude/ralph-loop.local.md with an active flag and an max_iterations cap, defaulting to 20
  • Supports completion via a [x] ALL_TASKS_COMPLETE marker in TODO.md or a matching completion_promise tag
  • Designed for well-defined refactors, migrations, and test-driven tasks; not for work needing design decisions

Install

$ npx -y skills add belumume/claude-skills --skill ralph-loop -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Ralph Wiggum Loop Mode

Named after the Simpsons character who "never stops despite being confused," this technique runs Claude Code in a loop where the prompt stays the same but the codebase accumulates changes. Each iteration reads previous work and continues until completion.

When to Use Ralph Mode

Ideal for:

  • Well-defined implementation tasks with clear completion criteria
  • Refactoring or migration work (e.g., React v16 to v19)
  • Test-driven development cycles (run until tests pass)
  • Batch processing or repetitive tasks
  • Overnight autonomous work sessions

Not ideal for:

  • Tasks requiring design decisions or human judgment
  • Exploratory work without clear end states
  • Tasks where requirements may change mid-execution
  • First-time implementations where you need to learn the code

Activation Protocol

Step 1: Validate Task Suitability

Before activating, confirm:

  • Task has clear, measurable completion criteria
  • Success can be verified programmatically (tests, build, specific file state)
  • The work is in a git-tracked directory
  • You understand what success looks like

Step 2: Create State File

Details

Repository
github.com/belumume/claude-skills
Categories
Agent Workflow & Planning, AI Agents & LLM Apps, Workflow Automation
First seen
Jun 3, 2026

Similar to Ralph Loop

More Agent Workflow & Planning