ralph-loop

ralph-loop is a command for Claude Code from eddiebelaval/squire. It costs 17 tokens per session (824 once invoked), scanned A, original, MIT.

A work-verification command that checks whether recent development changes actually work before they are marked complete. It chooses checks based on what changed, such as pages, APIs, components, databases, builds, or links.

In plain words
What is it for?
Use it after implementing a feature, before committing significant changes, or between phases of a larger task to run relevant checks.
Why use it?
It catches missing tests, broken pages, build errors, and other obvious problems before unfinished work is treated as done.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it after implementing a feature, before committing significant changes, or between phases of a larger task to run relevant checks.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eddiebelaval/squire/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.

Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

Made for: Claude Code.

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/eddiebelaval/squire/ralph-loop/github.svg)](https://agentmods.dev/commands/eddiebelaval/squire/ralph-loop)
Your own site
<a href="https://agentmods.dev/commands/eddiebelaval/squire/ralph-loop"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/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/eddiebelaval/squire/ralph-loop"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/ralph-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 824 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 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.00017 $0.00824
Opus 5.5 $0.00007 $0.00330
Sonnet 5.5 $0.00003 $0.00165
Haiku 4.5 $0.00002 $0.00082

Measured 1mo ago against content hash afaa361c1e7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

commands/ralph-loop.md · 136 lines

How it starts

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

Ralph Loop - Work Verification

Named after Ralph Wiggum — catches the obvious mistakes before they embarrass you.

Purpose

Implements a feedback loop that confirms work was executed properly. Run after completing a chunk of work to verify it's actually working before moving on.

When to Use

  • After completing a feature or set of changes
  • Before marking a task as complete
  • Before committing significant changes
  • After each phase of a multi-phase implementation

Process

1. Identify What Changed

Check git diff for modified files and categorize them:

  • Pages/Routes — New or modified page components
  • API Routes — Backend endpoints
  • Components — UI components
  • Database — Migrations, schema changes
  • Config — Configuration files, environment

2. Run Appropriate Checks

Context Verification Method
New pages/routes Navigate with Playwright, check 200 status, no console errors
API routes Call endpoints, verify response shape
Database changes Run migration, verify schema
Components Check TypeScript, run relevant tests
Builds npm run build, verify no errors
Links Check all hrefs resolve
Types npm run typecheck or npx tsc --noEmit

3. Report Results

RALPH LOOP VERIFICATION
=======================

Context: [what was worked on]
Files Changed: [count]

Checks Performed:
  [x] TypeScript compilation
  [x] Build succeeds
  [x] Routes accessible
  [ ] Console errors (FAILED - see below)

Result: PASS / FAIL

Issues Found:
  - [specific issue with file:line if applicable]

Suggested Fixes:
  - [actionable fix]

4. Fix or Escalate

  • Auto-fix simple issues: Missing imports, type errors with obvious fixes
  • Report complex issues: For user decision or further investigation

Usage

After completing work:

/ralph-loop

With specific scope:

/ralph-loop pages
/ralph-loop api
/ralph-loop build
/ralph-loop types

Read the full file on GitHub · 136 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. 1mo ago First seen · 136 lines · 17 tokens per session scan A afaa361c1e7a

Subscribe to this mod's changes

ralph-loop is a command published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 2mo ago), licensed MIT. It adds 17 tokens to every session and 824 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.