Loop directory
149 loops match your filters.
Runaway-Bill Guardrail Loop (Watchdog Beside the Worker)
A cost-safety pattern that pairs every overnight loop with a second, dumber loop whose only job is stopping the first: spend alerts, a hard iteration cap, and a cron check that kills the worker when token burn spikes or the same command keeps repeating.
Issue-to-Merge GitHub-Native Loop (Engineer the Reload)
A full-lifecycle loop where every piece of workflow state lives in GitHub — issues, labels, PR comments — and repo files, so each cold-start session rehydrates from GitHub rather than a conversation. Built on the official claude-code-action.
Stop-Hook Ralph (Deterministic Loop Without Bash)
A Ralph variant that lives inside a single Claude Code session: a stop hook re-injects the task prompt whenever the agent tries to end its turn, trading the bash while-loop's fresh context for a persistent session.
Cursor "Iterate Until Tests Pass, Never Touch the Tests"
First-party Cursor guidance for the iterate-until-green loop, with the key anti-reward-hacking clause: the agent may never modify the tests it is trying to satisfy. Works in Cursor, Claude Code /goal, and Codex.
Loop cost guardrails pattern
The four-part cost guardrail every agent loop should ship with: a hard iteration cap, a stop-after-N-turns clause in the goal text, a budget limit on SDK loops, and a /cost check inside the loop body.
Architect-builder cross-vendor loop
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.
Agent-Loop-Skills bundle — loop until it's better
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.
AutoLoop — metric-driven optimization loops
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.
Multi-repo autonomous dev team loop
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.
Deterministic backlog loop for Codex CLI
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.
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 →Looper — design-review your loop before running it
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.
Verification-gated self-running loop skill
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.
Boris Cherny loop methodology + agent-loop skill
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.
loop-init, loop-audit, loop-cost CLI patterns
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.
claude-loop — iterative sessions with cost tracking
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.
Continuous Claude — PR-gated Ralph loop
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.
Ralph with circuit-breaker exit detection
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.
The nested perfect loop
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.
Keep docs in sync with main
On every push to main, check whether changed code drifted from the docs in /docs and open a PR fixing anything out of date.
Apply database migrations cleanly
Run migrations, fix schema or SQL errors, and repeat until prisma migrate status reports clean, capped at 6 turns.
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 →Clean up the slop
Review your recent diff for debug code, dead branches, and bad names, then fix with minimal edits until lint and tests pass.
Get the build green
Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.
Reach a coverage target
Add focused tests for the least-covered files and re-measure each turn until coverage hits 80 percent or the turn cap.
Ship a PR until green
Implement a change, open the PR with gh, then keep fixing CI failures until every check passes, all in one goal loop.
Migrate an API import by import
Sweep a codebase from a legacy API to its v2 replacement with tests and typecheck as the safety net, capped at 30 turns.
Hit acceptance criteria
Drive a feature to done against explicit acceptance criteria: a working paginated endpoint, passing tests, clean lint, and a hard turn cap.
Wait for CI so you don't have to
Poll gh pr checks every 10 minutes and get told when the PR is ready to merge, or a summary of which checks failed and why.
Babysit many PRs at once
Keep every PR labeled codex-watch healthy: fix CI failures, rebase behind-main branches, and nudge pending reviewers on a 15-minute cadence.
Kill flaky tests
Run your test suite repeatedly, collect every intermittent failure, and fix or quarantine flaky tests until you get five consecutive green runs.