Agent skill

Ouroboros Ralph Loop

by Q00 in Q00/ouroboros

Runs a persistent Ouroboros loop that repeats background evolve_step generations on a lineage until QA passes, evolution converges, or you cancel.

MITAuto-check passedAgent Workflows

Install Ouroboros Ralph Loop

skills CLI
$ npx skills add Q00/ouroboros --skill ralph -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Q00/ouroboros ralph --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Q00/ouroboros.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ralph .claude/skills/ralph && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ralph
GitHub stars
6.2k
Token cost
~3.5k tokens
SKILL.md length
1,781 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Runs a persistent Ouroboros loop that repeats background evolve_step generations on a lineage until QA passes, evolution converges, or you cancel.

  • Works in 3 steps: Use the active runtime's tool-discovery… → The loaded tools may be exposed under… → Confirm that ouroboros_ralph and the job…
  • Keeping an Ouroboros lineage evolving until its QA checks pass
  • SKILL.md covers Usage, How It Works, Instructions and Tool Mapping, plus 2 more sections
  • Calls cursor

What it does

The skill fronts the `ouroboros_ralph` MCP tool, which owns the loop. In most runtimes the tool starts one background job and runs repeated `evolve_step` generations inside it. The loop ends when QA passes, convergence is reached, evolution reaches a terminal action, you ask for cancellation, or `max_generations` is hit. In OpenCode plugin mode the tool hands the loop to a child task session instead of creating a local job.

The agent first loads the Ouroboros MCP tools, including the job wait, status, result and cancel tools, and stops with a message if they are unavailable. It then prepares a lineage id and optional Seed YAML before starting anything. Plain natural-language requests go through the validated Seed path first, and the skill does not reimplement the loop itself.

When your agent uses it

  • Keeping an Ouroboros lineage evolving until its QA checks pass
  • Running a long-lived loop that should not stop at the first attempt
  • Checking on, waiting for or cancelling a background Ralph job

Example prompts

  • “Start ralph on lineage orders-api-v2 and keep going until it works.”
  • “Run /ouroboros:ralph for my current lineage and report when QA passes.”
  • “What is the status of the running Ralph job? Cancel it if convergence has been reached.”

Requirements

  • The Ouroboros MCP runtime with its `ouroboros_ralph` and job tools
  • A lineage id and optional Seed YAML

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Use the active runtime's tool-discovery capability to find and load the Ralph/job MCP tools
  2. The loaded tools may be exposed under plugin-prefixed names such as
  3. Confirm that ouroboros_ralph and the job tools (ouroboros_job_wait,

What it can do on your machine

Read from SKILL.md and the folder at commit 0df5b98. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cursor

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ouroboros Ralph Loop loads about 3.5k tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 1,781 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Q00/ouroboros at commit 0df5b98, republished under its MIT licence (© Q00). 1,781 words, ~3,476 tokens.

Download SKILL.mdSave it as .claude/skills/ralph/SKILL.md (or your agent's skills folder).
name
ralph
description
MCP-owned Ralph loop around background evolve_step jobs
mcp_tool
ouroboros_ralph
mcp_args.lineage_id
$lineage_id

/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.
Ralph Flow
  1. Prepare lineage input:

    • If the user provides an existing lineage_id and explicitly wants to continue it, reuse that lineage_id and omit seed_content unless they explicitly provide an updated Seed.
    • If the user provides Seed YAML for a new Ralph run, use it as seed_content and generate a fresh lineage_id for this run. Keep lineage_id separate from Seed, interview, and session IDs so separate Ralph runs over the same Seed do not collide.
    • If the user provides only a plain natural-language request, do not treat it as a direct ooo ralph "<request>" command, do not freehand Seed YAML, and do not pass raw text as seed_content. Route through the authoritative Seed path first: ooo interview to capture requirements, then ooo seed / ouroboros_generate_seed to produce validated Seed YAML with the normal ambiguity gate. After Seed generation, call the MCP tool with a fresh lineage_id and that validated Seed YAML as seed_content; do not use the raw request text. If an interview/seed session already exists in context, reuse that validated Seed output instead of regenerating it.
  2. Start Ralph by calling ouroboros_ralph with:

    • lineage_id: existing lineage id for an explicit continuation, otherwise a freshly generated stable id for this Ralph run, such as ralph-<short-slug>-<uuid>; do not use a Seed/interview id by itself
    • seed_content: valid Seed YAML for generation 1 when starting a new lineage
    • execute: default true
    • parallel: default true
    • skip_qa: default false
    • project_dir: explicit target project directory when known
    • max_generations: default 10 unless the user requests a tighter bound
  3. Handle the start response:

    • If response.meta.job_id is present, report it concisely and retain the job cursor from response.meta.cursor:

      [Ralph] Started background loop: <job_id>
      Lineage: <lineage_id>
      Live view: <dashboard_url, or `ouroboros tui open`>
      
      A read-only observer will post meaningful progress, attention, and terminal
      events here. This conversation remains available for other safe work.
    • If response.meta.job_observer is unavailable, recover it from the final <!-- ouroboros-job-observer-v1 base64 ... --> content sentinel. Fail closed unless the bounded payload passes canonical v1 validation and its job identity matches the visible start receipt. Use that ID only as an identity anchor, never to reconstruct tools or arguments. Reject validation failure or any mismatch between structured and inline surfaces.

    • If the structured or recovered job_observer is present and the host supports an independent child session, spawn exactly one read-only observer and pass that contract unchanged. The observer exclusively owns job wait/result calls and the cursor. The main session retains only user conversation, explicit on-demand status, and cancellation when the user requests it. The main session must not poll the same job while the observer is active. It may refine requirements, perform read-only review, or work in an unrelated isolated worktree; check active-worker conflicts before writing to Ralph's workspace. On Codex, call spawn_agent exactly once with task_name="run_observer"; wait is not a spawn, and do not claim an observer until a live child ID/path is returned. Once acknowledged, keep the parent turn open with wait_agent calls of at most 60 seconds while the observer is active. Child send_message calls only enqueue mailbox events and cannot revive an ended parent turn. Relay meaningful updates and wait again until terminal. On OMP, submit exactly one native Task child named RunObserver, require its live agent/job ID, and use the host wait/inbox relay until terminal. User input may interrupt the wait; handle it and resume waiting while observation remains active unless the user asks to stop live observation or replaces the active request. Then end only the relay loop, keep the durable job running, and offer next-turn or explicit-status catch- up. If the observer child fails, is cancelled, or exits before a terminal summary, use that same fallback instead of waiting indefinitely. This relay loop must not poll the Ouroboros job or take cursor ownership. If spawn fails, do not promise live proactive relays: the detached worker continues after the stdio turn, and the main session catches up from durable events on the next interaction or explicit status request. Keep the main turn open in the fallback polling loop only when the user asked for live watching.

    • If response.meta.status == "delegated_to_plugin" and response.meta.job_id is None, report that OpenCode plugin mode delegated the loop to a child Task session. Do not call ouroboros_job_wait, ouroboros_job_result, or ouroboros_cancel_job without a job id; follow the host Task widget/session lifecycle instead.

  4. Monitor non-plugin job progress in the polling owner when a job_id exists.

    The delegated observer is the default owner. Use the main-session loop below only when no independent child session exists and the user explicitly asked for live watching; otherwise catch up on the next parent turn. Never run both loops:

    • ouroboros_job_wait(job_id, cursor, timeout_seconds=120, stream="linked", wait_for="attention_or_ac_change") for long polling; after every wait/status response, update cursor = response.meta.cursor
    • ouroboros_job_status(job_id) for a quick status check
    • ouroboros_job_result(job_id) when the job is terminal
    • ouroboros_cancel_job(job_id) if the user says stop/cancel

    Observer events are concise: relay phase/progress changes in 1-2 lines, surface attention_required immediately, present terminal as the final result, distinguish Synapse queued from runtime-proven applied, surface rejected/uncertain delivery immediately, and suppress unchanged heartbeats or raw tool output. Render every relay in the user's current conversation language; preserve raw event codes only when exact diagnostics help. Interpret structured subtypes: report run configuration, total ACs and dependency/parallel levels, first scheduled ACs, bounded Discover targets, current model/harness changes, level transitions, and verified AC completion. Say "currently running with" because later generations may escalate or switch harnesses. Never forward raw commands or model reasoning.

    When a new generation starts, do not just report the generation number — lineage.generation.started carries an ac_focus block (active_ac_indices, frozen_ac_indices, active_ac_descriptions, reason). Report WHAT the generation is redoing, e.g. "Gen 7: 2/5 AC 재작업 — 'CSV export writes summary.csv', 'CLI exits 0 on --help' (3 AC는 이전 PASS 증거로 frozen)". When ac_focus is absent or every AC is active with reason "initial/full generation", say the full AC graph is being executed. Never quote verify commands or expected outputs — descriptions only.

    When the user asks a live AC a read-only question or provides additive intent, reload +ouroboros session signal, call ouroboros_session_signal_targets for the observed execution, and select the semantically relevant AC without asking for internal IDs. Use mode="inform" for assurance/questions and omit fallback_mode in that mode. For implementation refinement use contract_effect="additive", source="user", mode="redirect", and explicit fallback_mode="after_turn" with the exact discovered guards. Shared goal/AC/ constraint/non-goal changes require an approved shared successor.

  5. On non-plugin job termination, the polling owner fetches ouroboros_job_result(job_id) and summarize the final job result and next step:

    • Success / convergence: summarize the final generation output, QA verdict, and any worktree_path / worktree_branch returned in job metadata. Do not present ooo evaluate as an automatic next step for Ralph results: the Ralph job contract preserves the evolution lineage_id, but it does not reliably preserve a separate execution session_id for the evaluate workflow. If a valid execution session_id is explicitly available from a separate run result, keep it distinct from the Ralph lineage_id and follow the ooo evaluate <session_id> contract; otherwise state that formal evaluation needs a real execution session and should not be invoked from the Ralph lineage id alone.
    • Max generations / failure: summarize the stop reason and suggest ooo unstuck, ooo interview, or a narrower Ralph retry
    • Cancelled: confirm cancellation and preserve the job id for later inspection
  6. On OpenCode plugin delegation, rely on the child Task result as the terminal surface. Summarize the Task completion/error state and lineage id; do not claim a local Ralph job can be polled or cancelled.

Show full SKILL.md (240 more words)Show less
Active Conductor decision policy

For attention_required, use at most one short-lived read-only verifier. If the host has no verifier primitive, surface the evidence and do not mutate. Otherwise VERIFY → DECIDE from recommended_host_actions → LOG selected with ouroboros_record_conductor_decision → ACT only a menu-listed registered tool → LOG exactly one completed, failed, or declined outcome. Ralph may apply a conductor directive only to the first and sole bounded successor generation (max_generations=1), and only when it is deterministic and non-relaxing. Never silently retry or weaken the approved shared contract.

These are English canonical host instructions. Render them naturally in the user's conversation language.

Tool Mapping

Skill actionMCP tool
Start Ralph loopouroboros_ralph
Wait for progressouroboros_job_wait
Fetch final resultouroboros_job_result
Cancel loopouroboros_cancel_job
Inspect current statusouroboros_job_status

The Boulder Never Stops

This is the key phrase. Ralph does not give up:

  • Each failure is data for the next attempt.
  • Verification drives the loop.
  • Only success, convergence, terminal failure, cancellation, or max-generation limits stop it.

Your final response MUST end with exactly one breadcrumb footer line:

◆ <current state> → next: <recommended action>

Derive <current state> from live session state via ouroboros_session_status when that MCP projection is available; otherwise derive it from this skill's actual outcome. Never use a linear Step N of M footer because Ouroboros is an evolutionary loop. When the next action is genuinely a choice, list 2-3 honest options in the next: clause. The breadcrumb line must be the last line of the response.

© Q00, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/ralph of Q00/ouroboros.

Open the folder on GitHubat commit 0df5b98

Compare with similar skills

Ouroboros Ralph Loop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ouroboros Ralph Loop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ouroboros Ralph Loop this skillQ00/ouroboros6.2k—~3.5kAutomated safety check: PassMIT
Hermes Mission ControlTh0rgal/sandboxed.sh515—~8.6kAutomated safety check: PassNone
Agent Native Architecturesandgardenhq/sgai137—~2kAutomated safety check: PassCustom licence
Peer Review Loophashgraph-online/awesome-codex-plugins1.2k—~2.3kAutomated safety check: PassApache-2.0
Improving MCP ToolsPostHog/posthog-foss721—~1.5kAutomated safety check: PassMIT
Strandsstrands-agents/harness-sdk8.7k—~1kAutomated safety check: PassApache-2.0

Similar skills

  • Hermes Mission Control

    Th0rgal/sandboxed.sh

    Teaches Hermes to monitor and steer long-running sandboxed.sh missions: spot where a model is stuck, switch backends or models between turns, and send targeted hints.

    515 GitHub stars~8.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agent Native Architecture

    sandgardenhq/sgai

    Build AI agents using prompt-native architecture where features are defined in prompts, not code.

    137 GitHub stars~2k tokensUpdated 16 days ago
    Agent WorkflowsAuto-check passed
  • Peer Review Loop

    hashgraph-online/awesome-codex-plugins

    Peer Review Ralph Loop — combines Cavekit kits with a Ralph Loop and true cross-model peer review using Codex (OpenAI).

    1.2k GitHub stars~2.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Improving MCP Tools

    PostHog/posthog-foss

    Official

    Run an improve-my-MCP campaign: an autoresearch-style loop that measures the MCP agent experience with the eval harness, picks the highest-impact tool problem from production data, makes one bounded…

    721 GitHub stars~1.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Strands

    strands-agents/harness-sdk

    Build, extend, evaluate, or migrate applications with Strands Agents in Python or TypeScript.

    8.7k GitHub stars~1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Peer Review

    hashgraph-online/awesome-codex-plugins

    Patterns for using a second AI agent or model to challenge the primary builder agent's work.

    1.2k GitHub stars~5.8k tokensUpdated today
    Research & ScienceAuto-check passed

More from Q00/ouroboros

All 23 skills in this repo
  • Triages and works through GitHub issues and pull requests in the Q00/ouroboros repo as a maintainer, within a stated review boundary and clear limits on what it may change.

    6.2k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Runs a guided product-manager interview that classifies each question automatically and produces a Product Requirements Document.

    6.2k GitHub stars~5.7k tokensUpdated today
    Auto-check passed
  • Scans a directory for existing git repositories and worktrees, then registers and manages which ones serve as default context during interviews.

    6.2k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Scores an agent's finished work with a three-stage pipeline: free mechanical checks, an advisory semantic review, and an optional multi-model consensus vote.

    6.2k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Starts, monitors or rewinds an evolutionary development loop that refines an ontology and acceptance criteria generation by generation until it converges, using the Ouroboros MCP tools.

    6.2k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Opens or drives the Ouroboros settings GUI, picking a browser, TUI or chat-based approach depending on whether the user can reach a browser window.

    6.2k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Categories

Questions about Ouroboros Ralph Loop

What does Ouroboros Ralph Loop do?

Runs a persistent Ouroboros loop that repeats background evolve_step generations on a lineage until QA passes, evolution converges, or you cancel. The skill fronts the `ouroboros_ralph` MCP tool, which owns the loop. In most runtimes the tool starts one background job and runs repeated `evolve_step` generations inside it.

When should I use Ouroboros Ralph Loop?

Ouroboros Ralph Loop fits situations like: keeping an Ouroboros lineage evolving until its QA checks pass; running a long-lived loop that should not stop at the first attempt; checking on, waiting for or cancelling a background Ralph job.

How do I install Ouroboros Ralph Loop in Claude Code?

Run `npx skills add Q00/ouroboros --skill ralph -a claude-code`. Or copy the skill folder (skills/ralph in Q00/ouroboros) into .claude/skills/ralph in your project. Claude Code loads it when a task matches its description.

How do I install Ouroboros Ralph Loop in Codex?

Run `npx skills add Q00/ouroboros --skill ralph -a codex`. Or copy the skill folder (skills/ralph in Q00/ouroboros) into .agents/skills/ralph in your project. Codex loads it when a task matches its description.

Can I use Ouroboros Ralph Loop in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Q00/ouroboros --skill ralph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ralph, .gemini/skills/ralph, .github/skills/ralph and .opencode/skills/ralph in your project.

What does Ouroboros Ralph Loop need to run?

Going by SKILL.md and its folder, Ouroboros Ralph Loop needs the command-line tools its instructions call (cursor). Our summary lists: The Ouroboros MCP runtime with its `ouroboros_ralph` and job tools; A lineage id and optional Seed YAML.

Does Ouroboros Ralph Loop access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ouroboros Ralph Loop safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ouroboros Ralph Loop use?

Ouroboros Ralph Loop is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ouroboros Ralph Loop use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ouroboros Ralph Loop?

Skills that share tags, products or a category with Ouroboros Ralph Loop: Hermes Mission Control (Th0rgal/sandboxed.sh, 515 stars), Agent Native Architecture (sandgardenhq/sgai, 137 stars), Peer Review Loop (hashgraph-online/awesome-codex-plugins, 1.2k stars) and Improving MCP Tools (PostHog/posthog-foss, 721 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ouroboros Ralph Loop?

Q00 (a GitHub user) maintains it in Q00/ouroboros, which has 6,189 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 6, 2026.

Source: Q00/ouroboros on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.