Loop directory

228 loops match your filters.

Architect-builder cross-vendor loop

Loop/ralph

A two-vendor loop that pairs Claude as architect with Codex as builder, using the repo itself as shared memory: the architect writes specs, the builder implements one item per iteration, and the architect reviews the diffs on the next pass.

prompt
→ Claude
Claude as architect, Codex as builder, the repo as shared memory — architect writes plan/spec files, builder implements one item per iteration, architect reviews diffs next pass. Cap the run at 25 iterations; leave remaining work for the next session.
planningmedium riskclaude-code

Agent-Loop-Skills bundle — loop until it's better

Loop/ralph

Six verification-gated loops in one open-standard skill bundle — autoresearch, scientific writing, data analysis, code/SQL/prompt optimization, and red-teaming — portable across Claude Code, Codex, and Cursor. Use the red-teaming loop only against systems you own and are authorized to test.

prompt
→ Claude
"Loop until it's better" — verification-gated loops for autoresearch, scientific writing, data analysis, code/SQL/prompt optimization, red-teaming, packaged as open-standard Agent Skills portable across Claude Code, Codex, Cursor. Cap the run at 25 iterations; leave remaining work for the next session.
qualitymedium riskclaude-code

AutoLoop — metric-driven optimization loops

Loop/ralph

Agent-agnostic hill-climbing loops inspired by Karpathy's autoresearch: define a metric, let the agent propose a change, measure, keep it only if the number improved, and repeat.

prompt
→ Claude
Iterative optimization loops (inspired by Karpathy's autoresearch): define a metric, agent proposes change, harness measures, keep if improved, repeat. Works with Claude Code, Codex, Cursor, Gemini CLI. Cap the run at 25 iterations; leave remaining work for the next session.
performancemedium riskclaude-code

Multi-repo autonomous dev team loop

Loop/ralph

The fleet pattern: run agent loops across multiple repos in parallel, each isolated in its own git worktree, with a pluggable vendor layer spanning Claude Code, Codex, Cursor CLI, and OpenCode.

prompt
→ Claude
Register repos, run loops across them in parallel, each loop in its own git worktree; pluggable vendor layer (claude-code, codex, cursor-cli, opencode) — plan, review, fix, ship on a loop. Cap the run at 25 iterations; leave remaining work for the next session.
automationmedium riskclaude-code

Deterministic backlog loop for Codex CLI

Loop/ralph

A Codex-first autonomous runner that pulls exactly one task per iteration from a JSON backlog with fresh context each run and a JSONL audit log for full traceability.

prompt
→ Claude
Autonomous runner: exactly one task per iteration pulled from a JSON backlog, fresh context each run, JSONL audit log for traceability; optional Claude Code interleaving. Cap the run at 25 iterations; leave remaining work for the next session.
automationmedium riskclaude-code

Looper — design-review your loop before running it

Loop/ralph

A plan-the-loop-first skill: it interviews you about the automation idea, previews the flow as ASCII art, and only writes final loop artifacts after you confirm — a safe on-ramp for loop beginners.

prompt
→ Claude
Skill interviews you about the automation idea, writes loop artifacts to `looper-output/`, shows an ASCII flow preview, and only finalizes after you confirm — design the loop before any runner touches files. Cap the run at 25 iterations; leave remaining work for the next session.
planningmedium riskclaude-code

Verification-gated self-running loop skill

Loop/ralph

A drop-in Claude Code skill that keeps looping until an external verifier passes — not the model's own self-report — making it a strong anti-reward-hacking pattern for autonomous coding.

prompt
→ Claude
Drop-in Claude Code skill: self-running agent loop with a "real, un-foolable verification gate" — loop continues until an external verifier (not the model's self-report) passes.
testingmedium riskclaude-code

Boris Cherny loop methodology + agent-loop skill

Loop/ralph

A fact-checked knowledge base of Claude Code creator Boris Cherny's loop methodology, packaged as a runnable agent-loop skill you can drop straight into Claude Code.

prompt
→ Claude
Fact-checked knowledge base of Cherny's loop methodology for running Claude Code, shipped as a runnable `agent-loop` skill in `skill/agent-loop/`. Cap the run at 25 iterations; leave remaining work for the next session.
planningmedium riskclaude-code

loop-init, loop-audit, loop-cost CLI patterns

Loop/ralph

Three starter CLI tools that turn loop design into a repeatable workflow: scaffold a loop with a goal, budget, and verify step; audit an existing loop design; and estimate cost before you run.

prompt
→ Claude
Starter CLI tools: `loop-init` scaffolds a loop (goal, budget, verify step), `loop-audit` reviews an existing loop design, `loop-cost` estimates spend before running. Cap the run at 25 iterations; leave remaining work for the next session.
planningmedium riskclaude-code

claude-loop — iterative sessions with cost tracking

Loop/ralph

An automation harness that runs repeated Claude Code sessions while tracking cost and tokens per iteration — the reference answer to the number-one objection to agent loops: runaway spend.

prompt
→ Claude
Automation toolkit running repeated `claude` sessions with per-iteration cost and token monitoring; inspired by Dex Horthy's context-engineering talk. Cap the run at 25 iterations; leave remaining work for the next session.
automationmedium 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 →

Continuous Claude — PR-gated Ralph loop

Loop/ralph

The Ralph loop for teams: every iteration ships as a pull request that must pass CI before merging, giving each cycle a verifiable checkpoint. Keep branch protection and human PR approval enabled rather than letting it auto-merge to main unattended.

prompt
→ Claude
Run Claude Code in a continuous loop that opens a PR per iteration, waits for CI checks, and merges when green, then starts the next iteration. Cap the run at 25 iterations; leave remaining work for the next session.
cimedium riskclaude-code

Ralph with circuit-breaker exit detection

Loop/ralph

A safe Ralph variant that solves runaway loops with circuit-breaker heuristics: it halts automatically when iterations stop producing file changes or keep hitting the same error.

prompt
→ Claude
Ralph loop wrapped with exit heuristics: no file changes for 3 consecutive iterations = no progress → stop; same error 5 consecutive loops = stuck → stop. Cap the run at 25 iterations; leave remaining work for the next session.
automationmedium riskclaude-code

Official Ralph Wiggum plugin (Anthropic)

Loop/ralph★ Anthropic

Anthropic's first-party take on the Ralph loop: a Claude Code plugin that runs the iterate-fresh-context pattern with a managed stop and iteration mechanism built in.

prompt
→ Claude
Install the `ralph-wiggum` plugin from the anthropics/claude-code repo; it wraps the Ralph loop with a managed stop/iteration mechanism inside Claude Code. Guardrails: Stop when the goal is verifiably met, or stop after 15 iterations, whichever comes first. Verify each pass by running the relevant tests or checks — self-reported success does not count. Keep changes minimal and never touch files outside the task’s scope.
automationmedium riskclaude-code

The original Ralph Wiggum loop

The canonical Ralph Wiggum loop by Geoffrey Huntley: a bash while-loop that feeds Claude Code one fresh-context iteration at a time, using the filesystem and git as memory. Run it only in a sandboxed environment with permissions configured — never with permission checks disabled.

prompt
→ Claude
`while :; do cat PROMPT.md | claude -p ; done` — PROMPT.md holds the spec + "pick ONE task from the plan, implement, test, commit, exit." Fresh context every iteration; filesystem + git = memory. Guardrails: Stop when the goal is verifiably met, or stop after 15 iterations, whichever comes first. Keep changes minimal and never touch files outside the task’s scope.
automationmedium riskclaude-code

CI pipeline speedup

Loop/goallooprepo

Profile the CI pipeline and cut wall-clock time under a target by improving caching, splitting slow jobs, and removing redundant steps, verifying every run stays green.

prompt
→ Claude
/goal the CI pipeline completes in under 10 minutes on a typical PR — analyze the slowest recent runs with `gh run view`, apply one speedup per turn (better dependency caching, job parallelization, removing duplicated steps, trimming artifacts), push to a test branch, and confirm the workflow still passes; stop at the target or after 10 turns
cimedium riskclaude-codecodex

Upgrade to current Node LTS

Loop/goallooprepo

Move the project to the current Node LTS across .nvmrc, CI config, Dockerfiles, and engines, fixing deprecations until everything is green on the new runtime.

prompt
→ Claude
/goal the project runs on the current Node LTS — update .nvmrc, the engines field, CI workflow files, and any Dockerfile base images to the LTS version, then run install, build, lint, and the full test suite on it, fixing deprecation warnings and breakages one at a time; stop when all are green or after 15 turns
maintenancemedium riskclaude-codecodexcursor

Memory leak hunt

Loop/goallooprepo

Drive a suspected memory leak to ground: reproduce growth under a repeated workload, capture heap snapshots, and fix the retention until memory stays flat.

prompt
→ Claude
/goal heap usage stays flat (within 5%) across 500 repetitions of the failing workload in the leak-repro script — capture heap snapshots before and after, identify what is being retained and by which reference chain, fix the leak, and re-run the repro to confirm; stop after 10 turns
debuggingmedium riskclaude-codecodex

Commit message hygiene on a branch

Loop/goallooprepo

Rewrite the commit messages on your feature branch to conventional-commit format with meaningful bodies before opening the PR, leaving the code untouched.

prompt
→ Claude
/goal every commit on this branch (ahead of main) has a conventional-commit subject under 72 characters and a body explaining why — use interactive rebase to reword only (no code changes, no commits dropped), verify with `git log main..HEAD`, and confirm the diff against the original branch tip is empty; stop after 5 turns
gitlow riskclaude-codecodex

Ralph the bug backlog

Work a triaged bug list one fix per fresh-context iteration: reproduce first, fix minimally, prove it with a regression test, and log root-cause patterns to guardrails.

prompt
→ Claude
/loop fresh context each iteration: read bugs.json and .ralph/guardrails.md, take the top open bug, write a failing test that reproduces it before touching any code, then apply the smallest fix that makes the test pass with the rest of the suite green, and mark the bug fixed; if you cannot reproduce it, mark it needs-info with your findings instead; append recurring root-cause patterns to .ralph/guardrails.md; stop when bugs.json is clear or after 25 turns
debugginghigh riskclaude-codecodex

Ralph the docs backlog

Document one undocumented public module per fresh-context iteration, verifying every code sample compiles and accumulating style rules in guardrails so the docs read like one author wrote them.

prompt
→ Claude
/loop fresh context each iteration: read docs-backlog.json, docs/STYLE.md, and .ralph/guardrails.md; pick the top undocumented module, write its reference page with a runnable example, execute the example to prove it works, and mark the module done; add any style or structure decision to .ralph/guardrails.md; stop when the backlog is empty or after 20 turns
docsmedium riskclaude-codecodex
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 →

Ralph a refactor, module by module

Break a large refactor into a JSON backlog of modules and let fresh-context iterations convert one module per pass, with guardrails capturing every pattern decision so the result stays consistent.

prompt
→ Claude
/loop fresh context each iteration: read refactor-plan.json and .ralph/guardrails.md, take the next module not marked converted, migrate it to the target pattern described in PROMPT.md, run tests and typecheck, and mark it converted only when green; record every convention decision you make (naming, file layout, error handling) in .ralph/guardrails.md so later modules match earlier ones; stop when all modules are converted or after 30 turns
refactoringhigh riskclaude-codecodex

Ralph a test backlog

Iterate over a prioritized list of untested modules with fresh context each pass, writing real behavioral tests for one module at a time and banking lessons in a guardrails file.

prompt
→ Claude
/loop each iteration with fresh context: read .ralph/test-backlog.json and .ralph/guardrails.md, pick the top unfinished module, write behavioral tests for its public API (no snapshot-only tests), run the suite, and mark the module done only when its tests pass and coverage for it exceeds 80%; append any discovered testing gotcha (fixtures, mocking rules, async traps) to .ralph/guardrails.md; stop when the backlog is empty or after 25 turns
testinghigh riskclaude-codecodex

Ralph the PRD backlog

The canonical Ralph loop: each iteration starts fresh, reads the PRD and guardrails, ships exactly one backlog item end-to-end, and records what it learned.

prompt
→ Claude
/loop start each iteration with fresh context: read PROMPT.md, prd.json, and .ralph/guardrails.md; pick the single highest-priority item in prd.json not marked done, implement it with tests, run the full check suite, commit and mark it done only if green; if blocked or a check fails twice the same way, append the lesson to .ralph/guardrails.md and move on; stop when every item is done or after 30 turns
planninghigh riskclaude-codecodex

README freshness check

Loop/schedulelooprepo

Once a week, verify every command, path, and badge in the README actually works against the current codebase and open a PR fixing anything stale.

prompt
→ Claude
/schedule every Friday at 3pm, verify the README: run each documented setup and usage command in a clean checkout, check that referenced files and scripts exist, and open a PR correcting anything that fails or has drifted, with a note explaining each fix
docsmedium riskclaude-codecodex

Weekly dependency vulnerability audit

Loop/schedulelooprepo

Every Monday morning, run the dependency vulnerability audit, open one PR fixing what auto-fix can handle safely, and file issues for the rest.

prompt
→ Claude
/schedule every Monday at 8am, run `npm audit`, open a single PR applying only non-breaking fixes with tests passing, and file one issue per remaining high or critical advisory with its CVE link and affected paths
securitymedium riskclaude-codecodex

Changelog generation from commits

Loop/goallooprepo

Turn the commit history since the last release tag into a human-readable, categorized CHANGELOG entry ready for the next version.

prompt
→ Claude
/goal CHANGELOG.md has a complete entry for the next release — read every commit since the last version tag, group changes into Added, Changed, Fixed, and Removed, write user-facing descriptions (not commit messages), link PR numbers, and flag anything that looks like a breaking change; stop after 5 turns

Secrets scan until clean

Loop/goallooprepo

Run a secrets scanner over the working tree and drive the findings to zero: real secrets get flagged for rotation, false positives get baselined.

prompt
→ Claude
/goal `gitleaks detect --no-git` reports zero findings — for each finding, tell me whether it looks like a real credential (flag it for rotation and replace it with an env var lookup) or a false positive (add it to the baseline with a comment); never print the secret value itself; stop after 8 turns
securitylow riskclaude-codecodex

API contract test backfill

Loop/goallooprepo

Generate a contract test for every documented endpoint in the OpenAPI spec so the spec and the implementation can never silently drift.

prompt
→ Claude
/goal every path in openapi.yaml has a contract test asserting its status codes and response schema — add tests for one untested endpoint per turn, run the suite, and fix either the spec or the handler when they disagree (tell me which you chose); stop when all paths are covered or after 15 turns
testingmedium riskclaude-codecodex

Docker image slimming

Loop/goallooprepo

Iteratively shrink a Docker image under a size target using multi-stage builds, smaller base images, and layer cleanup, verifying the container still boots each turn.

prompt
→ Claude
/goal `docker images` shows the app image under 300 MB — apply one slimming change per turn (multi-stage build, slimmer base image, prune build deps, consolidate layers), rebuild, and verify the container starts and passes its healthcheck before the next change; stop at the target or after 8 turns
devopslow riskclaude-codecodex

Bundle size budget

Loop/goallooprepo

Shrink the production JavaScript bundle under a hard budget by attacking the largest modules with code-splitting, lighter imports, and dead-weight removal.

prompt
→ Claude
/goal the main production bundle is under 250 KB gzipped — run the build with the bundle analyzer, address the single largest contributor each turn (code-split it, replace it with a lighter import, or drop it), and confirm the build and tests stay green; stop at the budget or after 10 turns
performancemedium riskclaude-codecodexcursor
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 →