ralph-loop

ralph-loop is a skill for Claude Code, Codex from changoo89/claude-pilot. It costs 23 tokens per session (1,736 once invoked), scanned A, original, MIT.

An automated code-checking loop for agent teammates that repeats testing, coverage, type-checking, and lint checks after a code change.

In plain words
What is it for?
Use it after the first code change when tests fail, coverage is low, type errors appear, or lint reports violations.
Why use it?
It reduces the need to manually rerun checks and fix failures one by one. It stops when the checks pass or escalates unresolved problems.

Skill for Claude CodeCodex

Part of the claude-pilot plugin — 32 skills, 11 commands, 14 agents, 2 MCP servers shipped together

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.

agentmods
npx agentmods add skills/changoo89/claude-pilot/ralph-loop
Any agent
npx skills add changoo89/claude-pilot --skill ralph-loop
Clone the repo
git clone --depth 1 https://github.com/changoo89/claude-pilot

Made for: Claude Code, Codex.

Or install claude-pilot, the plugin that ships this one along with the rest of its 32 skills, 11 commands, 14 agents, 2 MCP servers.

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/changoo89/claude-pilot/ralph-loop.svg)](https://agentmods.dev/skills/changoo89/claude-pilot/ralph-loop)
Your own site
<a href="https://agentmods.dev/skills/changoo89/claude-pilot/ralph-loop"><img src="https://agentmods.dev/badge/skills/changoo89/claude-pilot/ralph-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00023 $0.01736
Opus 5 $0.00012 $0.00868
Sonnet 5 $0.00005 $0.00347
Haiku 4.5 $0.00002 $0.00174

Measured 5d ago against content hash 9ce10a8dc891, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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.

.claude/skills/ralph-loop/SKILL.md · 206 lines

How it starts

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

SKILL: Ralph Loop

Purpose: Autonomous completion loop - iterate until all tests pass, coverage met, type-check clean Target: Coder, Tester, Validator teammates ⚠️ Teammates Only: This skill is for coder/tester teammates in Agent Teams. Team Lead spawns teammates who execute this loop autonomously.


Quick Start

When to Use This Skill

  • After first code change (Entry point)
  • Tests failing or coverage low
  • Type-check errors present
  • Lint violations found

Quick Reference

# Ralph Loop: Autonomous iteration
iteration=0
max_iterations=7
early_escalation=false

# Check for --early flag or architecture-related failure
if [[ "$*" == *"--early"* ]] || is_architecture_failure; then
  max_iterations=2
  early_escalation=true
fi

while [ $iteration -lt $max_iterations ]; do
  echo "Iteration $((iteration + 1))/$max_iterations"

  # Run verification
  if run_all_checks; then
    echo "✓ All quality gates passed"
    break
  fi

  # Fix failures
  fix_failures

  # Update state
  update_state "$SC" "in_progress" $((iteration + 1))
  ((iteration++))
done

# Complete or escalate
if [ $iteration -eq $max_iterations ]; then
  # Message Team Lead for GPT Architect escalation
  echo "Max iterations reached. Messaging Team Lead for GPT Architect escalation..."
else
  echo "<CODER_COMPLETE>"  # All checks pass
fi

Core Concepts

Entry Point

Trigger: Immediately after first code change

Detection:

  • Coder teammate makes first edit/write
  • Tests run and fail
  • Ralph Loop begins automatically
  • TeammateIdle hook prevents premature idle on quality check failure

Quality Gates

All must pass before completion:

  1. Tests: npm test - All tests pass
  2. Coverage: ≥80% overall, ≥90% core modules
  3. Type-check: npm run type-check or tsc --noEmit
  4. Lint: npm run lint - Zero violations
  5. TODOs: All SC TODOs must be [x] before <CODER_COMPLETE>
    • PLAN_PATH from execute-plan prompt OR auto-detect in .pilot/plan/in_progress/
    • grep -q "^- \[ \]" "$PLAN_PATH" must return false (no unchecked items)
  6. TaskCompleted Hook: Automatically verifies gates 1-5 when teammate marks task done

Read the full file on GitHub · 206 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 206 lines · 23 tokens per session scan A 9ce10a8dc891

Subscribe to this mod's changes

ralph-loop is a skill published in the GitHub repository changoo89/claude-pilot (20 stars, last pushed 6mo ago), licensed MIT. It adds 23 tokens to every session and 1,736 once invoked, about $0.0001 per session on Opus 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-08-30.

Related

Other skills, from other repositories

github-flow-for-claude-on-web

Complete GitHub workflow for Claude Code on the web. ALL GitHub operations MUST use REST API (never gh CLI). Includes branch naming (claude/-sessionId), push retry logic, PR/issue management via API, and complete workflows. Use for all GitHub interactions in Claude Code web environment.

shabaraba/vibing.nvim · 71 tokens

vibing-orchestrate

Run several independent tasks in parallel by creating worker vibing.nvim chats, handing each one a self-contained brief, and aggregating their results. Use when the user asks for parallel work ("do these three in parallel", "split this across separate chats", "並行でやって", "この2つを別々のチャットで").

shabaraba/vibing.nvim · 76 tokens

test-design

Automatically design comprehensive E2E test cases for newly implemented vibing.nvim features. Use immediately after completing feature implementation (Phase 5.4) and before running E2E tests. Generates test scenarios covering Happy paths, Error cases, Edge cases, and Integration points with priority ranking…

shabaraba/vibing.nvim · 82 tokens

vibing-chat-search

Use when the user wants to find a past vibing.nvim conversation by topic — phrases like "前に〜について聞いたことあったっけ", "did we talk about X before", "find that chat where I asked about Y". Searches every chat file under .vibing/chat/ (both User and Assistant content) for a natural-language query, narrows candidates with grep…

shabaraba/vibing.nvim · 116 tokens

remote-screenshot

Take a real screenshot of a running Neovim from inside the Claude Code on the web container, which has no X server. Use when asked to show what a UI change looks like, or to attach an image of the chat buffer, a split layout, an approval prompt or a picker. Requires CLAUDECODEREMOTE=true — on a local machine there is…

shabaraba/vibing.nvim · 92 tokens

vibing-worktree-attach

Attach the current or a new vibing.nvim chat to an already-existing git worktree via natural language — no separate UI. Use when the user wants to switch/attach a chat to an existing worktree ("let's go into the auth-fix worktree", "attach to worktree X", "continue in the feature-y worktree").

shabaraba/vibing.nvim · 77 tokens