ralph

ralph is a skill for Claude Code, Codex from Q00/ouroboros. It costs 13 tokens per session (3,178 once invoked), scanned A, original, MIT.

A background loop that repeatedly runs workflow steps until quality checks pass, the work converges, an ending action occurs, someone cancels it, or it reaches its generation limit.

In plain words
What is it for?
Use it for requests such as “keep going” or “until it works,” using a validated workflow lineage. It can run locally or delegate the loop to a plugin session.
Why use it?
It handles repeated attempts for tasks that need continued progress instead of stopping after one run.

Skill for Claude CodeCodex

Part of the ouroboros plugin — 22 skills, 21 agents, 3 hooks, 1 MCP server shipped together

About the project

Q00/ouroboros is an Agent OS for running coding agents through interviews, staged evaluation, and repeated improvement cycles. It helps developers turn vague requests into tested code across multiple agent runtimes. Its catalogue add-ons provide workflows, agents, hooks, instructions, and integrations for operating those processes.

Q00/ouroboros · 5,765 stars · on GitHub

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/q00/ouroboros/ralph
Any agent
npx skills add Q00/ouroboros --skill ralph
Clone the repo
git clone --depth 1 https://github.com/Q00/ouroboros

Made for: Claude Code, Codex.

Or install ouroboros, the plugin that ships this one along with the rest of its 22 skills, 21 agents, 3 hooks, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/q00/ouroboros/ralph.svg)](https://agentmods.dev/skills/q00/ouroboros/ralph)
Your own site
<a href="https://agentmods.dev/skills/q00/ouroboros/ralph"><img src="https://agentmods.dev/badge/skills/q00/ouroboros/ralph.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,178 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.00013 $0.03178
Opus 5 $0.00006 $0.01589
Sonnet 5 $0.00003 $0.00636
Haiku 4.5 $0.00001 $0.00318

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

Security

Grade A, and why

ralph 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 2d 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.

skills/ralph/SKILL.md · 262 lines

How it starts

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

/ouroboros:ralph

MCP-owned Ralph loop around background evolve_step jobs. "The boulder never stops."

Usage

ooo ralph --lineage-id <lineage_id>
/ouroboros:ralph --lineage-id <lineage_id>

# For a plain natural-language request, run `ooo interview` + `ooo seed` first,
# then call the MCP tool with a fresh lineage_id and the validated Seed YAML.

Trigger keywords: "ralph", "don't stop", "must complete", "until it works", "keep going"

How It Works

Ralph is owned by the ouroboros_ralph MCP tool. In non-plugin runtimes, the tool starts one background Ralph job, runs repeated evolve_step generations inside that job, and stops only when QA passes, convergence is reached, a terminal evolution action occurs, cancellation is requested, or max_generations is reached. In OpenCode plugin mode, the MCP tool returns a delegated_to_plugin envelope with job_id=None; the bridge plugin dispatches a child Task session that owns the loop instead of creating a local JobManager job.

The client skill should not reimplement the loop. Deterministic frontmatter dispatch is limited to the router's named --lineage-id option so raw trailing text is never treated as lineage identity. Raw natural-language ooo ralph "<request>" input must flow through the validated Seed path before any mutating Ralph loop starts. Until a lineage id and optional Seed YAML are prepared, ouroboros_ralph returns structured input guidance instead of starting a job. Once the inputs are prepared, start the MCP-owned Ralph surface once, then follow either the returned job tools path or the OpenCode Task widget path.

Instructions

When the user invokes this skill:

Load MCP Tools (Required first)

The Ouroboros MCP tools are often registered as deferred tools that must be explicitly loaded before use. Do this before preparing input or calling Ralph:

  1. Use the active runtime's tool-discovery capability to find and load the Ralph/job MCP tools:
    tool discovery query: "+ouroboros ralph job"
    
  2. The loaded tools may be exposed under plugin-prefixed names such as mcp__plugin_ouroboros_ouroboros__ouroboros_ralph. Use the actual tool names returned by runtime tool discovery; the bare names below are the canonical MCP tool names for documentation.
  3. Confirm that ouroboros_ralph and the job tools (ouroboros_job_wait, ouroboros_job_status, ouroboros_job_result, and ouroboros_cancel_job) are callable. If the tools are unavailable, stop and tell the user that Ralph requires the Ouroboros MCP runtime.

Read the full file on GitHub · 262 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. 2d ago Changed · +35 lines c44e47021a8d
  2. 5d ago First seen · 227 lines · 13 tokens per session scan A 05fcdd108089

Subscribe to this mod's changes

ralph is a skill published in the GitHub repository Q00/ouroboros (5,765 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 3,178 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.