ralph-loop
Skill1 starsChanged 2 months agoMITView on GitHub
use this when a ticket queue must be worked across sessions — run the self-verifying Ralph loop: one item per iteration, gate outside the worker, commit only from a verified tree on a topic branch
- Reads credentials
16 other projects use a version of this.
Adopted by
Most recently taken up by
- mnzralee/claude-multi-agent-architecturetheir own version, first seen Oct 3, 2026
- yylo-dev/yylotheir own version, first seen Sep 20, 2026
- shyamsridhar123/kevin-copilottheir own version, first seen Aug 23, 2026
- harness-mini/harness-minitheir own version, first seen Aug 11, 2026
- zrosenfield/sharepoint-ai-skillstheir own version, first seen Aug 4, 2026
- carinyadigital/skillstheir own version, first seen Jul 19, 2026
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- mikeyobrien/ralph-orchestrator★ 3.2ksame name
- zrosenfield/sharepoint-ai-skills★ 96same name
- yylo-dev/yylo★ 63same name
- belumume/claude-skills★ 47same name
- regression-io/coder-config★ 47same name
- xfstudio/skills★ 9same name
- mnzralee/claude-multi-agent-architecture★ 8same name
- shyamsridhar123/kevin-copilot★ 7same name
- carinyadigital/skills★ 2same name
- Endogen/ralph-loop★ 2same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- claude-code-habitsSkill
- codex-habitsSkill
- compactSkill
- copilot-habitsSkill
- cursor-habitsSkill
- gemini-cli-habitsSkill
- grill-execute-clearSkill
- handoffSkill
- kill-context-bloatSkill
- learn-codebaseSkill
- quality-loopSkill
- ralph-planSkill
- ralph-swarmSkill
- reviewSkill
- session-hygieneSkill
- steering-push-vs-pointSkill
- to-specSkill
- unix-compoundSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 10 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 24
When a grill-execute-clear feature outgrows one session, graduate its mini-spec to to-spec, then run the resulting tickets here.
- Distinctive: line 48
Never let the worker verify its own work.
- Very specific: line 51
Read .ralph/loop.md, items.json, plan.md, prompt.md, progress.md.
- Distinctive: line 60
When the worker returns:
- Distinctive: line 62
Run the saved baseline gate and the current gate outside the worker, in a detached worktree of that exact tree.
- Distinctive: line 71
Do not leave a dirty default branch behind.
- Very specific: line 72
If the worker claims blocked: true, judge the claim before honoring it.
- Distinctive: line 74
After each iteration decide continue vs stop.
- Very specific: line 83
Run the gate. Require exit 0 and final line ALL GATES PASS.
- Very specific: line 84
Never set passes: true. The engine sets it after both gates pass.
- Distinctive: line 88
Do not commit, switch branches, merge, rebase, reset, or push.
- Very specific: line 89
Do not edit .ralph/loop.md.
- Distinctive: line 90
No generated-by attribution in code or commits.
- Very specific: line 91
Never commit secrets, tokens, or .env files.
- Distinctive: line 109
Commit only from the verified tree, hook-free.
- Distinctive: line 110
Never push, merge, force-push, or change the default branch.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ralph-loop
Execute a queue of vertical tickets across sessions with a self-verifying
loop. Live agent context is disposable. Durable state lives in .ralph/
(plan, items, prompt, loop state, progress log). One iteration completes
exactly one item.
When
- A to-spec ticket queue (or any discrete item list) must be worked to done across sessions without losing state.
- ralph-plan produced the verified plan and items; this loop executes them.
- Each item needs independent verification before it lands.
- When a grill-execute-clear feature outgrows one session, graduate its mini-spec to to-spec, then run the resulting tickets here.
Durable files
| File | Owns |
.ralph/plan.md | objective + invariants |
.ralph/items.json | ordered items + runtime_contract |
.ralph/prompt.md | worker contract for each fresh agent |
.ralph/loop.md | run state — engine only |
.ralph/progress.md | append-only evidence |
runtime_contract must declare: verification_gates, branch (topic),
protected_paths, require_one_item_per_iteration, require_commit,
require_progress_append, never_push_without_owner_ok.
Each item declares allowed_paths, passes, blocked.
Plan first: replacing the plan and items resets loop.md and
progress.md. Do not start a loop against a stale plan.
The loop (engine protocol)
You are the engine. A fresh subagent is the worker for each item. Never let the worker verify its own work. Re-read all durable state before every iteration.
- Read
.ralph/loop.md,items.json,plan.md,prompt.md,progress.md. - Confirm you are on the contract topic branch. If not, stop. Never touch the default branch.
- Optionally run a work-select gate. Review means the engine picks. Gate
error means FIFO (
passes:false,blocked:false) stands. - Take the lock (
.git/ralph.lock). Do not auto-reclaim a stale lock — inspect and remove it only after the recorded process has stopped. Mark the item running. Stop if nothing actionable remains. - Spawn ONE fresh worker for that item only, with the worker contract below.
- When the worker returns:
- Save the candidate as an immutable Git tree.
- Run the saved baseline gate and the current gate outside the worker, in a detached worktree of that exact tree.
- Scope-check the diff against
allowed_paths. Rejectprotected_paths. - Acceptance: exit 0 and final line
ALL GATES PASS. - On pass: commit hook-free from that same verified tree (Git plumbing,
not
git committhat hooks can rewrite). Setpasses: true. Append an engine progress entry. Release the lock. - On fail or stop: write
refs/ralph/recovery/<item>-<timestamp>, restore the last verified branch state, record the stop reason, release the lock. Do not leave a dirty default branch behind.
- If the worker claims
blocked: true, judge the claim before honoring it. Send-back means respawn with a hint. Owner-only access → stop and report. - After each iteration decide continue vs stop. Thrashing → escalate.
Worker contract
Hand the worker these rules. The engine also enforces them after the fact.
- Complete exactly one selected item.
- Change only that item's
allowed_pathsplus one progress append. - Work only on
runtime_contract.branch. - Run the gate. Require exit 0 and final line
ALL GATES PASS. - Never set
passes: true. The engine sets it after both gates pass. blocked: trueonly for a real external blocker.- Append exactly one timestamped progress entry (item id, summary, gate
result,
Outcome: PASSorOutcome: BLOCKED). - Do not commit, switch branches, merge, rebase, reset, or push.
- Do not edit
.ralph/loop.md. - No generated-by attribution in code or commits.
- Never commit secrets, tokens, or
.envfiles.
Kill the whole worker process group when the iteration ends or times out (SIGTERM, then SIGKILL). Do not leave orphaned children.
Optional judgment gates
Small semantic questions (select, verify, triage, blocker, continue) can be asked by a judgment helper so the frontier model doesn't have to. Code owns the workflow; the helper only supplies judgments. Gate exits: 0 acted, 1 review (engine decides), 2 escalate to the owner, 3 gate error — on error fall back to the pre-helper behavior and say so. Branch only on typed answers, never on free-form text.
Rules
- One item per iteration. No batching, no drive-bys.
- Two gates: baseline + current. Both outside the worker.
- Commit only from the verified tree, hook-free.
- Never push, merge, force-push, or change the default branch.
- Failed verification is a failed iteration plus a recovery ref.
Anti-patterns
- Letting the worker verify its own work.
- Committing the worker's output without the engine-side gate rerun — the engine re-runs baseline + current gates outside the worker before any commit.
- Spawning a worker without handing it the worker contract.
git commiton a dirty index so hooks can rewrite the tree you gated.- Auto-deleting
.git/ralph.lockbecause it "looks stale." - Linked worktrees that share a Git dir with another lane.
- Starting the next iteration while the lock is still held.
- Touching
main/masterbecause the topic branch "is almost done."
Related
ralph-plan (verified plans + items, the upstream) · to-spec · ralph-swarm · grill-execute-clear · handoff · compact · quality-loop
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

