ralph-loop

ralph-loop is a skill for Claude Code from mnzralee/claude-multi-agent-architecture. It costs 87 tokens per session (10,405 once invoked), scanned B, original, MIT.

A controlled method for pursuing a large software goal through repeated work, checks, and reviews across several iterations.

In plain words
What is it for?
Use it for goals requiring more than a few work packages, extended implementation, production refactoring, or repeated acceptance checks.
Why use it?
It preserves progress between iterations and adds escalation when problems persist, reducing the risk of losing direction during long or high-risk work.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions subagents; names the ExitPlanMode tool.

Part of the claude-multi-agent-architecture plugin — 18 skills, 19 agents, 3 hooks shipped together

Good fit Use it for goals requiring more than a few work packages, extended implementation, production refactoring, or repeated acceptance checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mnzralee/claude-multi-agent-architecture/ralph-loop
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mnzralee/claude-multi-agent-architecture --skill ralph-loop
Clone the repo
git clone --depth 1 https://github.com/mnzralee/claude-multi-agent-architecture

Made for: Claude Code.

Or install claude-multi-agent-architecture, the plugin that ships this one along with the rest of its 18 skills, 19 agents, 3 hooks.

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/skills/mnzralee/claude-multi-agent-architecture/ralph-loop.svg)](https://agentmods.dev/skills/mnzralee/claude-multi-agent-architecture/ralph-loop)
Your own site
<a href="https://agentmods.dev/skills/mnzralee/claude-multi-agent-architecture/ralph-loop"><img src="https://agentmods.dev/badge/skills/mnzralee/claude-multi-agent-architecture/ralph-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,405 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.00087 $0.10405
Opus 5 $0.00044 $0.05202
Sonnet 5 $0.00017 $0.02081
Haiku 4.5 $0.00009 $0.01040

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

Security

Grade B, and why

ralph-loop scanned grade B with 2 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 8d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -sf -X POST $ENDPOINT/quote -d '{"name":"example"}' | jq -e '.tier and .amount' # Criterion 2

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| **ENV-RO** | Read-only deployment-environment query (a state snapshot or read call against a running environment) | `<query command> | grep -q expected` OR `curl -X POST $ENDPOINT ...` | No |
.claude/skills/ralph-loop/SKILL.md · 784 lines

How it starts

The opening of the file, as written. The whole thing — 784 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ralph-Loop Skill

The engineering discipline for endless iteration toward a goal. Bounded iteration with rigor, not non-stop execution. Synthesized from a 9-agent review-board pattern, cluster-of-failures investigation, and execution-and-reversal experience on long-arc work.


When to Use This Skill

Invoke /ralph-loop (or expect auto-surface) when:

  • Multi-iteration goals (any goal requiring more than 3 distinct work packages)
  • Long-arc execution (more than 3h wall-clock OR risk of context degradation)
  • High-stakes work where mistakes or assumptions are costly (infrastructure mutations, deployment-environment operations, production-grade refactors)
  • "Get to X/X" goals (10/10 production-ready, full module close, acceptance-gate sweep)
  • When the user invokes /multi-agent-orchestration for a multi-day scope
  • When the user says "non-stop", "marathon", "endless work", "complete everything"

Do NOT use for: single-work-package fixes, one-shot operations, anything under 1h. Use the lighter /multi-agent-orchestration skill for those.


Core Philosophy: Bounded Iteration, Not Non-Stop Execution

The single most important reframe: "non-stop autonomous marathon" framings are structurally unviable per industry consensus.

Sources (the evidence base for this reframe):

  • Anthropic, "Effective context engineering for AI agents" (2026): context degrades past 50% utilisation
  • arxiv 2603.24755 "SlopCodeBench": empirical anti-pattern accumulation in long-horizon coding tasks
  • Alibaba Cloud, "From ReAct to Ralph Loop" (2025): 15-25% premature-completion rate without external verification chain
  • Stark Insider, "Claude Code Autonomous Coding Time Hack" (2026): the "Dumb Zone" past 100K-150K tokens
  • Anthropic Claude Code best-practices: /clear cadence canonical
  • m.academy, "Clear the context window in Claude Code"

The Ralph-Loop pattern reframes long-arc work as:

A chain of 12-15 bounded iterations of 60-120 min each, separated by /clear and persistent state. Each iteration owns ONE work package with explicit FAIL_TO_PASS + PASS_TO_PASS acceptance commands. Between iterations, in-context memory is cleared; persistent state in .claude/progress/current-module.json carries the handoff.

Read the full file on GitHub · 784 lines

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. 8d ago First seen · 784 lines · 87 tokens per session scan B dc57e35f12b1

Subscribe to this mod's changes

ralph-loop is a skill published in the GitHub repository mnzralee/claude-multi-agent-architecture (5 stars, last pushed 1mo ago), licensed MIT. It adds 87 tokens to every session and 10,405 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

coordinate-agents

Route Codex-native multi-agent orchestration in a Git repository through a local-first, recoverable Agent Bus. Use for role-based planning, task execution, review, recovery, adapters, and human-gated release workflows. The plugin supports Codex CLI, Google Antigravity CLI, Claude, and other configured coding agents.…

hogancv/coordinate-agents · 87 tokens

coordinate-task

Run a Coordinate Agents Task from requirement clarification through planning, implementation, review, and the human release gate. Hide Agent Bus transport details behind the durable Task API.

hogancv/coordinate-agents · 35 tokens

coordinate-recover

Diagnose and safely resume Coordinate Agents Tasks after executable failure, non-zero exit, timeout, stale claim, processing message, or Implementer ERROR. Recovery is explicit and never an automatic retry loop.

hogancv/coordinate-agents · 43 tokens

coordinate-setup

Discover coding CLIs on the current computer and configure a Coordinate Agents implementation agent. Use for setup, executable checks, registered agents, user-level configuration, and project-over-user precedence.

hogancv/coordinate-agents · 40 tokens

coordinate-review

Review a Coordinate Agents implementation as the Codex Reviewer. Verify the real commit, diff, tests, validation evidence, and specification without modifying the Implementer's product code.

hogancv/coordinate-agents · 36 tokens

antigravity-agents

This document manages all domain-specific .agents/skills/ /SKILL.md files.

rafaelghif/antigravity-agents · 0 tokens