ralph-loop

ralph-loop is a skill for Codex from zacharygcook/agent-skills. It costs 58 tokens per session (1,920 once invoked), scanned A, original, MIT.

A resumable system for running long coding tasks as ordered implementation sprints. It keeps plans, progress, notes, and validation results so work can continue after interruption.

In plain words
What is it for?
Use it to set up, run, inspect, and review repository changes in bounded sequential chunks. It helps manage specifications, sprint state, validation commands, and post-sprint checks.
Why use it?
It prevents a long agent task from becoming a one-shot prompt with unclear progress or lost lessons. It also separates finished code from unfinished reviews, tests, and documentation.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Claude Code; mentions Codex; $skill-name invocation.

Good fit Use it to set up, run, inspect, and review repository changes in bounded sequential chunks. It helps manage specifications, sprint state, validation commands, and post-sprint checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zacharygcook/agent-skills/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 zacharygcook/agent-skills --skill ralph-loop
Clone the repo
git clone --depth 1 https://github.com/zacharygcook/agent-skills

Made for: Codex.

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/zacharygcook/agent-skills/ralph-loop/github.svg)](https://agentmods.dev/skills/zacharygcook/agent-skills/ralph-loop)
Your own site
<a href="https://agentmods.dev/skills/zacharygcook/agent-skills/ralph-loop"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/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/skills/zacharygcook/agent-skills/ralph-loop"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/ralph-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,920 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.00058 $0.01920
Opus 5 $0.00029 $0.00960
Sonnet 5 $0.00012 $0.00384
Haiku 4.5 $0.00006 $0.00192

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

The scan reads SKILL.md. This mod also ships 11 executable files (assets/templates/monorepo/format-codex-stream.py, assets/templates/monorepo/format-stream.py, assets/templates/multi-repo/format-codex-stream.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/ralph-loop/SKILL.md · 138 lines

How it starts

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

Ralph Loop

Operate an autonomous implementation loop as a resumable state machine, not a one-shot prompt. Preserve negative knowledge, make progress machine-readable, and distinguish completed implementation chunks from completed review/documentation/test hooks.

First-use operator journey

When a user asks how to start, preflight the repository instead of explaining sprint internals first:

  1. Confirm a Git repository; Bash, Git, jq, and Python 3; an explicit harness, model, and reasoning choice (or a fully owned custom command); positive sprint and per-chunk turn budgets; an explicit tracked-or-local state choice; a durable SPEC.md or equivalent; and credible fast chunk plus comprehensive sprint validation commands.
  2. Read repository agent instructions and the spec before choosing commands or planning work.
  3. Ensure just is available and install the project recipe import without overwriting an existing justfile; then initialize or upgrade the deterministic runtime with reviewed choices.
  4. Break the spec into dependency-ordered sprints, create only the first sprint under .ralph/sprints/, set CURRENT_SPRINT, and validate the complete setup.
  5. Tell the operator what to review and stop before running. Invoking .ralph/loop.sh starts the autonomous loop; do not add or require a redundant authorization boolean.

Do not ask the operator to hand-build .ralph/ or sprint files. Use $ralph-loop for the complete lifecycle or ambiguous Ralph requests. Prefer $ralph-sprint, $ralph-status, or $ralph-review when the requested operation is already clear; all four skills share this runtime and its invariants.

Deterministic runtime

Use the already installed package's scripts/ralph launcher. It owns the versioned runtime templates and selects Python 3.11+ from either the python3 or python command. Skill installation and updates remain a separate operator-approved package-management step; the runtime never downloads or executes replacement instructions.

Read the full file on GitHub · 138 lines

Files

What ships with it

49 files 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. 9d ago First seen · 138 lines · 58 tokens per session scan A d1d33e06ce22

Subscribe to this mod's changes

ralph-loop is a skill published in the GitHub repository zacharygcook/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 58 tokens to every session and 1,920 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

git-ai-search

Search and restore AI conversation context from git history.

git-ai-project/git-ai · 13 tokens

immune

Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning. Triggers on: "scan for errors", "immune scan", "check output quality", "antibody scan". NOT for PR review (use pr-review) or repo audits (use repo-sentinel).

Mathews-Tom/armory · 73 tokens

usage-audit

Audit a Claude Code setup for token waste and context bloat. Checks MCP servers, CLAUDE.md, skills, and settings against bloat filters. Triggers on: "audit my context", "usage audit", "token audit", "context bloat". NOT for codebase audits.

Mathews-Tom/armory · 63 tokens

brain-page

Operating manual for reading and writing a project's brain — every read and write goes through the bundled zero-dependency brain CLI; never hand-edit brain files. Read it before creating or modifying any page or root page.

mindmuxai/brain.md · 47 tokens

brain-bootstrap

Seed a freshly-scaffolded brain with real project knowledge — on an existing (brownfield) project read the code, docs, and git log to draft the six root pages and capture key historical decisions; on a near-empty (greenfield) project interview the user. Every write goes through the brain CLI. Run it after brain-setup.

mindmuxai/brain.md · 74 tokens

brain-ingest

The process for digesting a conversation, document, or research result, classifying it, and writing it down as brain content (a root-page update or a new/updated page) through the brain CLI.

mindmuxai/brain.md · 48 tokens