Loop directory
212 published loops. Copy one, swap in your repo, run it.
Make the test suite fast
Cut test runtime under repeatable conditions without weakening coverage, assertions, isolation, or behavior.
Evaluate the whole product to a bar
Run realistic scenarios across every major capability, fix weak outcomes, and rerun until each clears the defined bar.
Turn every bug into a regression test
Test like a real user, convert each failure into documented regression coverage, and restart the streak after every fix.
Keep the changelog current nightly
Review yesterday's changes each night and keep user-facing release history complete and accurate.
Add the logs you're missing
Audit the important code paths, add useful structured logs, and prove success and failure events fire with tests.
Close your search-visibility gaps
Fix the highest-impact crawl, indexation, intent, citation, and answer-readiness gaps first, in priority order.
Drive coverage to 100%
Find uncovered behavior, add tests that actually matter, and stop when the full suite passes at 100%.
Sweep production errors to root cause
Trace actionable production errors to their root cause, verify the fix, open a PR, and stop cleanly when nothing needs action.
Get every page under 50 ms
Benchmark each page with one repeatable measure and keep optimizing until every target loads under the threshold.
Refactor in tested checkpoints
Reshape the architecture in small, independently reviewed steps — live-test, commit a checkpoint, and log progress each pass.
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 →Fix doc drift, ship a PR
Compare every doc against the current code, fix what's stale, verify commands and links, and open a reviewable PR.
Weekdays at 9am: review open PRs assigned to you
A scheduled Routine that runs each weekday at 9am to review the open pull requests assigned to you and leave a first-pass review on each, running in the cloud even with your computer off.
Check whether the deploy finished and summarize what changed
A 5-minute watch loop that polls whether a deploy has finished and, once it lands, summarizes what changed. It is a read-only status watcher rather than an agent driving toward a finish condition.
Content operations monitor via custom loop.md
A marketing-facing loop.md playbook that turns a bare /loop into a recurring content-ops sweep: checks GA4 for week-over-week organic traffic drops, scans GSC for position 4-15 query opportunities, and audits WordPress posts for broken internal links and missing meta descriptions — reporting one line when everything is green.
Custom loop.md — Project-Level Default for Bare /loop
A team-config pattern: a loop.md file in the project root overrides the built-in maintenance prompt, so any teammate running bare /loop gets your project's canonical loop — run lint, typecheck, and tests, fix anything red, stop when clean.
Codex App Automations (Scheduled Agent Runs)
Codex's native answer to scheduled agent loops: define a prompt plus a schedule in the Codex app and it runs in the cloud on cadence — nightly dependency audits, morning issue triage — with no terminal open. The Codex-side equivalent of Claude Code Routines.
Ralph Overnight Builds — Progressive Curriculum Entry
A graduated path to unattended Ralph runs: start with a single bounded task, add a PROMPT.md spec file, add verification, and only then remove the human from the loop for overnight builds.
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.
Karpathy-Style CLAUDE.md Self-Check Protocol for Loops
A self-check protocol embedded in CLAUDE.md that every loop iteration obeys before ending a turn: re-read the goal, diff the changes against it, run the verification command, and state what remains — a ritual that catches drift between iterations.
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.
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 →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.
Codex CLI as an MCP Tool Inside an Agents-SDK Loop
An outer-planner/inner-coder loop from an official OpenAI recipe: an Agents SDK orchestrator plans and verifies while Codex CLI, wrapped as an MCP server, performs one bounded code change per turn.
Codex CI Autofix Loop (Fix Failing GitHub Actions)
An event-triggered loop where a red GitHub Actions build invokes `codex exec` non-interactively with the failing logs and repo, and Codex proposes a fix as a PR or patch artifact — one bounded iteration per CI failure.
Codex Iterative Repair Loop (JSON-Schema Review → Repair)
OpenAI's first-party loop recipe: a script alternates a Codex review pass that emits machine-readable findings with a repair pass fed those findings verbatim, looping until validation passes, attempts run out, progress stalls, or a decision needs human review.
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.
Schedules + goals + subagents design framework
A design framework for AI agent loops built on three questions — when should it run (schedule), what does done mean (goal), and who does the isolated pieces (subagents) — with worked examples in Claude Code and Codex.
/goal + Routines overnight combo
The two-layer answer to how do I run this overnight: /goal drives in-session work to done, while a scheduled Routine keeps recurring unattended work running on Anthropic's cloud with your laptop closed.
Spec-first Ralph (PLAN.md-driven)
The spec-driven maturation of the Ralph loop: each fresh-context iteration reads PLAN.md, implements the highest-priority unchecked item, checks it off, and commits — so the spec file evolves alongside the codebase.
Deploy-poll loop
A hands-free ops loop that polls your deploy every two minutes, runs the smoke test the moment it goes live, and stops with a report if any check fails.
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 →