ralph-loop

ralph-loop is a command for Claude Code from Arthur742Ramos/ralph-wiggum-windows. It costs 9 tokens per session (555 once invoked), scanned A, a copy of ralph-loop, MIT.

A command that starts a Ralph Wiggum loop, repeatedly giving the same task to the coding agent so it can build on its earlier file changes.

In plain words
What is it for?
Use it for tasks such as refactoring a cache layer or adding tests, with an optional iteration limit or completion phrase.
Why use it?
It automates repeated attempts on a task instead of requiring you to restart the agent manually each time.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ralph-wiggum-windows plugin — 4 commands shipped together

Good fit Use it for tasks such as refactoring a cache layer or adding tests, with an optional iteration limit or completion phrase.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Arthur742Ramos/ralph-wiggum-windows
Claude Code
/plugin install ralph-wiggum-windows

Made for: Claude Code.

Or install ralph-wiggum-windows, the plugin that ships this one along with the rest of its 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ralph-loop

README.md
[![agentmods](https://agentmods.dev/badge/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop/github.svg)](https://agentmods.dev/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop)
Your own site
<a href="https://agentmods.dev/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop"><img src="https://agentmods.dev/badge/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ralph-loop

Your own site · 80×15
<a href="https://agentmods.dev/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop"><img src="https://agentmods.dev/badge/commands/arthur742ramos/ralph-wiggum-windows/ralph-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00009 $0.00555
Opus 5 $0.00005 $0.00278
Sonnet 5 $0.00002 $0.00111
Haiku 4.5 $0.00001 $0.00056

Measured 9d ago against content hash ffc6bb7b0c6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ralph-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to ralph-loop — 31 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

commands/ralph-loop.md · 44 lines

What it actually says

Ralph Loop Command

Execute the setup script to initialize the Ralph loop:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.ps1" $ARGUMENTS

# Extract and display completion promise if set
if (Test-Path .claude/ralph-loop.local.md) {
  $content = Get-Content .claude/ralph-loop.local.md -Raw
  if ($content -match 'completion_promise:\s*"([^"]+)"') {
    $promise = $Matches[1]
    Write-Host ""
    Write-Host "CRITICAL - Ralph Loop Completion Promise"
    Write-Host ""
    Write-Host "To complete this loop, output this EXACT text:"
    Write-Host "  <promise>$promise</promise>"
    Write-Host ""
    Write-Host "STRICT REQUIREMENTS (DO NOT VIOLATE):"
    Write-Host "  - Use <promise> XML tags EXACTLY as shown above"
    Write-Host "  - The statement MUST be completely and unequivocally TRUE"
    Write-Host "  - Do NOT output false statements to exit the loop"
    Write-Host "  - Do NOT lie even if you think you should exit"
    Write-Host ""
    Write-Host "IMPORTANT - Do not circumvent the loop:"
    Write-Host "  Even if you believe you're stuck, the task is impossible,"
    Write-Host "  or you've been running too long - you MUST NOT output a"
    Write-Host "  false promise statement. The loop is designed to continue"
    Write-Host "  until the promise is GENUINELY TRUE. Trust the process."
  }
}

Please work on the task. When you try to exit, the Ralph loop will feed the SAME PROMPT back to you for the next iteration. You'll see your previous work in files and git history, allowing you to iterate and improve.

CRITICAL RULE: If a completion promise is set, you may ONLY output it when the statement is completely and unequivocally TRUE. Do not output false promises to escape the loop, even if you think you're stuck or should exit for other reasons. The loop is designed to continue until genuine completion.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 44 lines · 9 tokens per session scan A ffc6bb7b0c6d

Subscribe to this mod's changes

ralph-loop is a command published in the GitHub repository Arthur742Ramos/ralph-wiggum-windows (7 stars, last pushed 8mo ago), licensed MIT. It adds 9 tokens to every session and 555 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to ralph-loop, differing in 31 lines, and is treated as a copy.