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 143 agent loops without leaving your terminal.

install.loop
# connect in Codex, Cursor, or any MCP client
https://mcp.looprepo.dev/mcp
# one-line plugin for Claude Code & Cowork — coming soon
/plugin install looprepo@loopssoon
  1. 1. install once
  2. 2. search or generate in-agent
  3. 3. run only what passes the gate
143loops
143safe 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

Ship avatar endpoint to spec

Loop/goalGitHubBnew

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

prompt
→ Claude
/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 riskcursor

Get the build green, every time

Loop/goalGitHubBnew

Work through each task in .toh/plan.md, fix blockers, until the build command succeeds or you hit 40 turns.

prompt
→ Claude
/goal every task in .toh/plan.md is checked and the build command exits 0 — or stop after 40 turns . A Haiku evaluator judges the condition FROM THE TRANSCRIPT — one more reason the QC gate quotes actual output: unquoted results are invisible to the evaluator. |

Run pilot verdicts until rejection

Loop/goalGitHubBnew

Keep executing /flow-next:pilot until it returns PILOT VERDICT=NO WORK or 20 turns elapse, routing deferrals to /flow-next:land and parking async questions.

prompt
→ Claude
/goal keep running /flow-next:pilot until it prints PILOT VERDICT=NO WORK, or stop after 20 turns - note PILOT VERDICT=DEFERRED TO LAND is its own terminal (an all-done spec whose open PR land owns); route it to /flow-next:land , not a pilot re-run. In backlog mode the grammar also carries PILOT VERDICT=ASKED <id> (<n>) - a durable park, not a stop: the loop simply continues to the next item next tick, and the human answers async in the spec / tracker
productmedium riskcodex

Keep QA tests passing

Loop/loopGitHubBnew

Run pre-QA tests repeatedly, diagnose and fix failures, report only on blockers or green.

prompt
→ Claude
/loop 2m Read tasks/qa-config.md to get the pre-QA test command and log command. Run the pre-QA test command. If it fails or any infrastructure issue is detected: read logs using the log command, diagnose the root cause, fix it, and re-run. Report to the user only when something fails or when all checks pass clean. Do not interrupt QA for passing tests
testingmedium riskclaude-code

Ship infrastructure readiness gates

Loop/goalGitHubBnew

Shape and execute infrastructure readiness objectives by gathering evidence, seeking approval at decision boundaries, then validating provisioning, configuration, and rollback in non-production before production deployment.

prompt
→ Claude
/goal Use the installed shape-goal and goal-engine skills to discover, approve, and complete this repository's next Infrastructure / Deployment Readiness objective. During shaping, load shape-goal's required-input specification for Infrastructure / Deployment Readiness; exhaustively inspect repository instructions, Git state and history, infrastructure-as-code, environment and secret references, build artifacts, deployment workflows, health checks, runbooks, rollback paths, supported environments, prior incidents and goals, the project harness, and connected authoritative systems before asking the user. Resolve every material input from evidence where possible. Continue inside this /goal only when an already-approved Goal Contract or authoritative artifact resolves every owner decision. Otherwise create or resume SHAPING.md , save the unresolved decision and one recommended question, stop as Approval required, and tell the user to resume shape-goal outside /goal ; do not ask the question or take another autonomous turn, and do not make production changes before approval. Then hand off within this same goal to goal-engine to reconcile infrastructure and application assumptions, validate provisioning and configuration in approved non-production or simulated environments, verify artifact provenance, migrations, smoke and health gates, observability, failure handling, and rollback, and remove verified readiness blockers; apply relevant assurance overlays, repository-native verification, regression protection, independent review where warranted, durable progress state, and reusable closeout. Do not declare success when shaping is complete. Finish only when every approved readiness gate passes with surfaced evidence, environment differences and residual risks are documented, rollback remains viable, and no production deployment or mutation has occurred without explicit authority. Stop only for a contract-defined blocker, approval boundary, budget, material goal drift, or two consecutive no-progress cycles

Measure and ship performance gains

Loop/goalGitHubBnew

Discover and execute a benchmark optimization goal, freeze the protocol, compare candidates under identical conditions, and deploy only validated improvements with regression protection.

prompt
→ Claude
/goal Use the installed shape-goal and goal-engine skills to discover, approve, and complete this repository's next Measured Optimization / Benchmark objective. During shaping, load shape-goal's required-input specification for Measured Optimization / Benchmark; exhaustively inspect repository instructions, Git state and history, requirements, architecture, plans, tests and CI, runtime behavior, prior goal state, the project harness, and any connected authoritative sources before asking the user. Resolve every material input from evidence where possible; ask only unresolved owner decisions, one at a time with a recommended answer, and do not make production changes until the user approves a Goal Contract. Then hand off within this same goal to goal-engine to freeze the benchmark protocol, compare champion and challengers under identical conditions, and retain only meaningful improvements; apply relevant assurance overlays, repository-native verification, regression protection, independent review where warranted, durable progress state, and reusable closeout. Do not declare success when shaping is complete. Finish only when every approved acceptance and overlay gate passes with surfaced evidence and protected behavior has not regressed. Stop only for a contract-defined blocker, approval boundary, budget, material goal drift, or two consecutive no-progress cycles
performancemedium riskclaude-code

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
/ralph-loop my-feature # Run until all phases complete (max 50 iterations
automationmedium riskclaude-code

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
/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 riskclaude-codecodex

Pre-mortem loop

Loop/goalXB

Before committing, write the 'it's 12 months later and this failed' story so the failure modes are on the table now.

prompt
→ Claude
/goal for decision [X], write the pre-mortem: assume it's 12 months later and this failed, then enumerate the specific causes, ranked by likelihood, each with an early-warning signal and a mitigation. Done when: state-file premortem.md contains the failure narrative + a ranked cause table with signals and mitigations, and the top 3 causes each have a concrete owner/mitigation PASTED in. Paste the completed table as proof, or paste what's unfinished and stop. Budget: cap $[X]. Hard cap: stop after 1 iteration per run.
researchlow riskclaude-code
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 →

Interview five buyers, fix the copy

Interview recent buyers in batches, track recurring objections, and propose evidence-backed landing-page copy.

prompt
→ Claude
Improve [landing page or purchase page] using objections from recent buyers. Before contacting anyone, identify the approved buyer group, outreach channel, privacy rules, and message. Obtain explicit approval for the outreach. Interview buyers in batches of five, up to fifteen people total. Ask each person one question: What almost stopped you from buying? Record their exact words while protecting their identity and honoring any consent or communication requirements. After each batch, group repeated concerns and draft a proposed copy change for the point on the page where each concern is most likely to arise. Do not publish the copy without approval. Use the next batch to check whether the same concern still appears. Stop when the concern no longer repeats, fifteen interviews are complete, the outreach budget ends, or access is blocked. Finish with anonymized quotes, recurring concerns, proposed copy, evidence by batch, and the recommended page change.

The nested perfect loop

Loop/loopGitHubB

A loop wrapping a goal wrapping a review: every 30 minutes, drive all PR review comments to resolved via /review, 10 turns max per pass.

prompt
→ Claude
/loop 30m /goal all PR review comments resolved via /review, stop after 10 turns

Ship avatar endpoint to spec

Loop/goalGitHubBnew

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

prompt
→ Claude
/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 riskcursor

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.