LOOPS

The graded index of
agent loops for Claude Code & Codex.

Every entry scored A–F for safety, for Claude Code and Codex. Search, grade, and generate 148 agent loops without leaving your terminal.

install.loop
# connect in Codex, Cursor, or any MCP client
https://mcp.looprepo.dev/mcp
# or one line in Claude Code
claude mcp add --transport http looprepo https://mcp.looprepo.dev/mcp
  1. 1. install once
  2. 2. search or generate in-agent
  3. 3. run only what passes the gate
148loops
148safe picks (A/B)
23categories
A–Fevery loop graded

Curated from Forward Future, GitHub, X, Hacker News & community submissions — deduped, attributed, and safety-graded.

Not a developer? Start with Claude Intake →

/loopiteration budgetexit conditionhandoff.mdsafety Bstop when greenObserveActCheckcheck passesdone
A loop observes, makes one bounded change, and runs a fixed check — repeating only while progress and the iteration budget hold, then stopping the moment the check passes.
Not sure which loop?
newClaudeClaude CodeCoworkMCP

Turn any Claude workflow into the right loop

Paste a read-only intake prompt into someone's Claude context, capture the evidence, then call looprepo MCP to return ranked real loops, safety checks, and a harness-ready goal for that specific use case.

Recently added

Fix code review blockers until convergence

Loop/goalGitHubBnew

Run a full review pass inline, apply validated blocking findings at their owning layer, re-run fresh until the gate clears or blockers plateau—capped at 3 rounds with escalation.

prompt
→ Claude Code
/goal why-review fix-loop convergence: repeatedly run the full-mode /why-review pass INLINE over {target}. After each review, apply only VALIDATED findings that block the current round (all open severities in round 1 — Round-1 LOW closure; CRITICAL/HIGH/MEDIUM from round 2) at their owning layer, then re-run a FRESH full review pass over the CHANGED target. If the current round's blocking findings >0 → apply fixes and run another round; if a fresh full review pass clears the current bar (round 1: zero open findings; round 2: zero CRITICAL/HIGH/MEDIUM, LOW deferred) → CONVERGED, clear the gate. Do NOT open another round for LOW-only findings from round 2. Cap at {N=3} review rounds; a failing test gate is outside the cap and the no-progress rule — keep fixing and re-running until the tests pass, never forcing green; if review blockers do not shrink across 2 consecutive rounds or increase, or the review budget (round 3) is spent with review blockers still open → STOP and escalate via AskUserQuestion. Never loop open-ended
reviewmedium risk

Loop operator: watch an autonomous run and escalate on stall

Loop/loopGitHubAnew

A second, read-only loop that babysits a first one. Every ten minutes it reads the run's state file and latest log, runs the test suite so its evidence is an exit code rather than a self-report, and applies four explicit escalation triggers (no progress across two checks, repeated identical stack trace, budget exceeded, merge-queue conflict). On any trigger it prints ESCALATE and stops so a human looks; it never restarts, edits, merges, or pushes. Exits when the state file reports PASS or DONE, and after twelve checks regardless. Adapted from ECC's loop-operator agent (affaan-m/ECC, MIT), which lists the same triggers but has no cadence, cap, check command, or exit.

prompt
→ Claude Code
/loop every 10 minutes act as the loop operator for the autonomous run in this repo: run `cat state/loops/*.md`, `tail -100 logs/latest.log`, and `npm test` each pass, then report the active loop pattern, current phase, last successful checkpoint, the npm test exit code, failing checks, and cost drift against the budget in the state file. Print ESCALATE and stop this loop if any of these is true: no progress across two consecutive checks, the same stack trace repeats, cost exceeds the budget, or a merge conflict is blocking the queue — escalate to me, never fix it yourself. Otherwise print CONTINUE with one line of evidence. Report-only: never edit code, never restart or kill processes, never merge or push — any PR the run opens waits for me. Exit when the state file says Status: PASS or DONE. Stop after 12 checks regardless.

Fifteen-minute verification report while you work

Loop/loopGitHubAnew

A recurring six-phase check (build, types, lint, tests with coverage, secret and debug-log grep, diff size) that prints one fixed-format report every fifteen minutes so you catch drift before the PR, not in review. It is strictly read-only: the loop reports, you decide what to fix. It exits when the tests pass and the report reads READY twice running, escalates instead of retrying when the same check fails three times, and stops after eight checks no matter what. Adapted from ECC's verification-loop skill (affaan-m/ECC, MIT), whose 'continuous mode' names the cadence but has no turn cap, exit, or failure path; all three are added here.

prompt
→ Claude Code
/loop every 15 minutes while I work: run `npm run build`, `npx tsc --noEmit`, `npm run lint`, and `npm test -- --coverage`, then grep src/ for `sk-`, `api_key`, and `console.log`, then `git diff --stat`. Print a VERIFICATION REPORT with Build / Types / Lint / Tests (X/Y passed, Z% coverage) / Security / Diff as PASS or FAIL and an overall READY or NOT READY for PR verdict, plus an Issues to Fix list. Report only — never edit files, never commit. Exit when `npm test` exits 0 and the report says READY twice in a row. If the same check FAILs on three consecutive passes, stop and escalate to me with the failing output instead of retrying. Stop after 8 checks regardless.

Dual-reviewer convergence gate before opening a PR

Loop/goalGitHubAnew

Two reviewers from different model families, each in a fresh context, must both pass an objective rubric before a PR is opened — the maker-checker split with real model diversity. Each failed round fixes only what was flagged and re-reviews with reviewers that have no memory of the last round, so nothing anchors on prior findings. Hard cap of three rounds, tests may never be edited to pass, and the loop ends by opening a PR rather than pushing. Adapted from ECC's /santa-loop (affaan-m/ECC, MIT), which auto-pushes on agreement and has no verifiable exit; this version adds the test-exit condition and the human merge gate.

prompt
→ Claude Code
/goal Ship the current diff only after two independent reviewers both PASS. Scope is `git diff --name-only HEAD` (or the path in $ARGUMENTS). First write a rubric with objective PASS/FAIL criteria: correctness, security (no secrets, injection, OWASP top 10), error handling, completeness, internal consistency, no regressions. Each round launch two reviewers in parallel with fresh context and no memory of earlier rounds: Reviewer A is a Claude subagent, Reviewer B is a different model via `codex exec --sandbox read-only` (fall back to a second Claude subagent and say so in the report). Both return a JSON verdict with per-criterion PASS/FAIL and critical issues. If either FAILs: fix only the flagged issues with minimal diffs, never modify the tests to make them pass, commit "fix: address review findings (round N)", run `npm test`, and re-review with fresh reviewers. Exit when both reviewers PASS and `npm test` exits 0 — then open a PR for me to merge; never push to main or merge. Stop after 3 rounds; if still failing, print the unresolved issues and escalate to me instead of shipping.

Work a task to completion, then open a PR

Loop/looplooprepoA

The generic persistent-task Ralph pattern: iterate on one named task until its acceptance criteria are met and the suite is green, bounded by a 15-turn cap and a no-progress stop. Anti-reward-hacking clauses keep it from editing tests to go green, and it hands off via a PR instead of merging. Swap the check command for your stack's.

prompt
→ Claude Code
/loop Work the named task to completion. Each turn: pick the next incomplete subtask, make the smallest change that advances it, then run `npm test && npm run lint` and fix whatever breaks before moving on. Stop when every acceptance criterion for the task is met and `npm test` exits 0 — or stop after 15 turns, whichever comes first. Never modify, skip, or weaken a test to make it pass, never delete a failing assertion, and keep each diff minimal and scoped to the named task. If two consecutive turns produce no progress, stop and report what is blocking. When the task is done, open a pull request for review — never merge it yourself.
automationmedium risk

Ship avatar endpoint to spec

Loop/goalGitHubB

Build and test a new /users/:id/avatar route until it passes tests, lint, and matches the OpenAPI schema.

prompt
→ Claude Code
/goal until grep -q "users/:id/avatar" src/routes/users.ts AND pnpm test -- tests/integration/users.avatar.spec.ts passes AND grep -q "/users/{id}/avatar" openapi.yaml AND pnpm lint passes, or stop after 15 turns
testingmedium risk

Top loops this week

Execute feature phases autonomously

Loop/ralphGitHubB

Run Claude Code through all planned phases of a feature until completion or max iterations.

prompt
→ Claude Code
/ralph-loop my-feature # Run until all phases complete (max 50 iterations
automationmedium risk
⧉ 1

Draft a sprint plan from the backlog

Loop/goallooprepoB

Turn the open issue backlog into a proposed two-week sprint plan with estimates, a dependency ordering, and an explicit cut line, written as a document for the team to edit.

prompt
→ Claude Code
/goal SPRINT-PLAN.md contains a proposed 2-week plan — read all open issues labeled `ready`, estimate each as S/M/L based on the code it touches, order them by dependency and value, draw a cut line at a realistic capacity, and list what falls below it with reasons; make no changes to the issues themselves; stop after 6 turns
planninglow risk
⧉ 1

Dual-reviewer convergence gate before opening a PR

Loop/goalGitHubAnew

Two reviewers from different model families, each in a fresh context, must both pass an objective rubric before a PR is opened — the maker-checker split with real model diversity. Each failed round fixes only what was flagged and re-reviews with reviewers that have no memory of the last round, so nothing anchors on prior findings. Hard cap of three rounds, tests may never be edited to pass, and the loop ends by opening a PR rather than pushing. Adapted from ECC's /santa-loop (affaan-m/ECC, MIT), which auto-pushes on agreement and has no verifiable exit; this version adds the test-exit condition and the human merge gate.

prompt
→ Claude Code
/goal Ship the current diff only after two independent reviewers both PASS. Scope is `git diff --name-only HEAD` (or the path in $ARGUMENTS). First write a rubric with objective PASS/FAIL criteria: correctness, security (no secrets, injection, OWASP top 10), error handling, completeness, internal consistency, no regressions. Each round launch two reviewers in parallel with fresh context and no memory of earlier rounds: Reviewer A is a Claude subagent, Reviewer B is a different model via `codex exec --sandbox read-only` (fall back to a second Claude subagent and say so in the report). Both return a JSON verdict with per-criterion PASS/FAIL and critical issues. If either FAILs: fix only the flagged issues with minimal diffs, never modify the tests to make them pass, commit "fix: address review findings (round N)", run `npm test`, and re-review with fresh reviewers. Exit when both reviewers PASS and `npm test` exits 0 — then open a PR for me to merge; never push to main or merge. Stop after 3 rounds; if still failing, print the unresolved issues and escalate to me instead of shipping.
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Hit acceptance criteria

Loop/goalXB

Drive a feature to done against explicit acceptance criteria: a working paginated endpoint, passing tests, clean lint, and a hard turn cap.

prompt
→ Claude Code
/goal the /users endpoint returns 200 with a paginated JSON body, all tests pass, and lint is clean — stop after 20 turns

Build the user profile page

Loop/ralphGitHubB

Ralph autonomously constructs the user profile page and halts on completion promise signal.

prompt
→ Claude Code
/ralph-loop "Build the user profile page. Output <promise>DONE</promise> when complete." --completion-promise "DONE" --max-iterations 20
productmedium risk

Loop operator: watch an autonomous run and escalate on stall

Loop/loopGitHubAnew

A second, read-only loop that babysits a first one. Every ten minutes it reads the run's state file and latest log, runs the test suite so its evidence is an exit code rather than a self-report, and applies four explicit escalation triggers (no progress across two checks, repeated identical stack trace, budget exceeded, merge-queue conflict). On any trigger it prints ESCALATE and stops so a human looks; it never restarts, edits, merges, or pushes. Exits when the state file reports PASS or DONE, and after twelve checks regardless. Adapted from ECC's loop-operator agent (affaan-m/ECC, MIT), which lists the same triggers but has no cadence, cap, check command, or exit.

prompt
→ Claude Code
/loop every 10 minutes act as the loop operator for the autonomous run in this repo: run `cat state/loops/*.md`, `tail -100 logs/latest.log`, and `npm test` each pass, then report the active loop pattern, current phase, last successful checkpoint, the npm test exit code, failing checks, and cost drift against the budget in the state file. Print ESCALATE and stop this loop if any of these is true: no progress across two consecutive checks, the same stack trace repeats, cost exceeds the budget, or a merge conflict is blocking the queue — escalate to me, never fix it yourself. Otherwise print CONTINUE with one line of evidence. Report-only: never edit code, never restart or kill processes, never merge or push — any PR the run opens waits for me. Exit when the state file says Status: PASS or DONE. Stop after 12 checks regardless.

Every loop here carries a Safety Score

A library tells you what a loop says. looprepo tells you whether it's safe and likely to work. Each loop in the directory is graded A-F by the same default-fail evaluator that gates submissions: exit conditions, iteration budgets, verification commands, scoping, human gates. Paste any loop — yours or one you found anywhere — and get a full review — review my loop →

The only generator that ships the full harness — free

Anyone can hand you a prompt. The looprepo Builder ships the whole thing, for Claude Code or Codex: CLAUDE.md with PreToolUse safety hooks and slash commands — or AGENTS.md with a sandboxed codex-exec runner — plus a fresh-context evaluator that fails by default, handoff notes, a prd.json, stop conditions and an iteration budget. Safe loops, not runaway agents. Try it →

Loop of the Week, by email

One email a week. One-click unsubscribe, anytime.