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.

prompt
→ Claude
Optimize the test suite to run as quickly as possible without reducing coverage or changing behavior.
testingmedium risk

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.

prompt
→ Claude
Build sanitized, production-scale local data under production-like settings. Inventory every user-facing feature, role, route, button, input, modal, state, and workflow; define documented acceptance criteria and finite risk-based edge cases for each. Test as a real user, logging every bug with reproduction evidence. Review findings for shared causes and dependencies; implement coherent fixes with regression tests, then rerun the full inventory. Stop at a clean pass or blocked handoff. Ask before production, sensitive data, or destructive actions.
evaluationhigh risk

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.

prompt
→ Claude
Test realistic scenarios. When one fails, document it, add regression and benchmark coverage, fix it, and restart the streak. Stop after [N] successful cases in a row.
evaluationmedium risk

Keep the changelog current nightly

/scheduleForward Futurenew

Review yesterday's changes each night and keep user-facing release history complete and accurate.

prompt
→ Claude
Each night, review changes from the previous day and update the changelog with anything users should know.
docshigh risk

Add the logs you're missing

Audit the important code paths, add useful structured logs, and prove success and failure events fire with tests.

prompt
→ Claude
Review the system's logging and add missing coverage until every important path produces useful, tested logs.
testingmedium risk

Close your search-visibility gaps

Fix the highest-impact crawl, indexation, intent, citation, and answer-readiness gaps first, in priority order.

prompt
→ Claude
Run an SEO/GEO audit across crawlability, indexation, page intent, titles, internal links, structured data, source citations, and answer-first content. Rank the gaps by expected impact, fix the highest-leverage issue, then rerun the same crawl and target-query benchmark across search engines and AI answer engines. Repeat until no critical technical issues remain, every priority query maps to a clear answer-ready page, and the benchmark shows no high-impact gap left to fix.
contentlow risk

Drive coverage to 100%

Find uncovered behavior, add tests that actually matter, and stop when the full suite passes at 100%.

prompt
→ Claude
Add tests until we have 100% test coverage.
testingmedium risk

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.

prompt
→ Claude
Review our production logs for errors. If you find an actionable issue, trace it to its root cause, fix it, verify the fix, and open a pull request. If no actionable errors are present, stop without making changes.
debugginghigh risk

Get every page under 50 ms

Benchmark each page with one repeatable measure and keep optimizing until every target loads under the threshold.

prompt
→ Claude
Continue optimizing the code for speed. After each significant change, measure page-load performance across every page under the same repeatable test conditions. Continue until every page loads in under 50 ms.
performancemedium risk

Refactor in tested checkpoints

Reshape the architecture in small, independently reviewed steps — live-test, commit a checkpoint, and log progress each pass.

prompt
→ Claude
Refactor until you are happy with the architecture. After each significant step, live-test the system, run autoreview, and commit. Track progress in /tmp/refactor-{projectname}.md.
testingmedium risk
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 →

Fix doc drift, ship a PR

/scheduleForward Futurenew

Compare every doc against the current code, fix what's stale, verify commands and links, and open a reviewable PR.

prompt
→ Claude
Whenever a documentation pass is needed, review the codebase in full and make sure all documentation reflects the current implementation. Update stale documentation, verify the changes, then open a pull request.
docslow risk

Weekdays at 9am: review open PRs assigned to you

/schedulenew

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.

prompt
→ Claude
/schedule weekdays at 9am: review open PRs assigned to me, leave a first-pass
reviewhigh risk

Check whether the deploy finished and summarize what changed

/loopnew

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.

prompt
→ Claude
/loop 5m check whether the deploy finished and summarize what changed
devopshigh risk

Content operations monitor via custom loop.md

/loopnew

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.

prompt
→ Claude
/loop 15m (Save the following as .claude/loop.md so the bare /loop picks it up as its playbook.) # .claude/loop.md — Content Operations Monitor Check the following every iteration: 1. Pull the latest GA4 data for kokasexton.com. If any post dropped more than 30% in organic traffic week-over-week, flag it with the URL and the percentage drop. 2. Scan GSC for new queries where we rank positions 4-15 and impressions grew >20% week-over-week. List the top 3 opportunities. 3. Check the WordPress admin for any posts with broken internal links or missing meta descriptions. Fix silently if fewer than 5 issues. Report if more. 4. If everything is green, reply with one line: "Content ops clean — nothing needs attention."
automationmedium risk

Custom loop.md — Project-Level Default for Bare /loop

/ralphnew

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.

prompt
→ Claude
Put a `loop.md` in the project root to replace the built-in maintenance prompt when a user runs bare `/loop` — e.g., "run lint + typecheck + tests; fix anything red; update CHANGELOG; stop when clean." Every teammate's bare `/loop` now runs your loop.
automationmedium risk

Codex App Automations (Scheduled Agent Runs)

/ralph★ OpenAInew

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.

prompt
→ Claude
Define an Automation in the Codex app: a prompt + schedule that runs in the cloud on cadence (e.g., nightly dependency audit, morning triage of new issues), no terminal open.
automationmedium risk

Ralph Overnight Builds — Progressive Curriculum Entry

/ralphnew

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.

prompt
→ Claude
Staged path from basic prompt → PROMPT.md spec → overnight Ralph run: start with a single bounded task, add a spec file, add verification, only then remove the human from the loop.
planningmedium risk

Runaway-Bill Guardrail Loop (Watchdog Beside the Worker)

/ralphnew

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.

prompt
→ Claude
Pair every overnight loop with a watchdog: spend/usage alert thresholds, a hard `MAX_ITER`, and a cron check that kills the loop process if tokens-per-minute spikes or the same command repeats N times. The watchdog is a second, dumber loop whose only job is stopping the first one.
automationmedium risk

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.

prompt
→ Claude
Preamble rules embedded in CLAUDE.md that every loop iteration obeys: before ending a turn, re-read the goal, diff your changes against it, run the verification command, and explicitly state what remains — a self-check ritual that catches drift between iterations. (Community template descended from Andrej Karpathy's circulated CLAUDE.md rules.)
qualitymedium risk

Issue-to-Merge GitHub-Native Loop (Engineer the Reload)

/ralphnew

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.

prompt
→ Claude
Run Claude Code across the full lifecycle — issue intake → branch → implement → PR → review fixes → merge — with ALL workflow state externalized to GitHub (issues, labels, PR comments) and repo files. Each session starts cold and rehydrates from GitHub state; "the chat being gone doesn't cost you anything."
cimedium risk
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 →

Stop-Hook Ralph (Deterministic Loop Without Bash)

/ralphnew

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.

prompt
→ Claude
Use a Claude Code stop hook that re-injects the task prompt whenever the agent tries to end its turn, until a completion condition or hard iteration cap is met — Ralph semantics inside one session instead of a bash `while` wrapper.
automationmedium risk

Codex CLI as an MCP Tool Inside an Agents-SDK Loop

/ralph★ OpenAInew

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.

prompt
→ Claude
Wrap Codex CLI as an MCP server and drive it from an OpenAI Agents SDK orchestrator loop — the outer agent plans/verifies, the inner Codex call does one bounded code change per turn.
automationmedium risk

Codex CI Autofix Loop (Fix Failing GitHub Actions)

/ralph★ OpenAInew

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.

prompt
→ Claude
CI job: on workflow failure, run `codex exec` non-interactively with the failing logs + repo, have it generate and propose a fix (PR or patch artifact) automatically. `codex exec` runs one task and exits, so each CI failure is one bounded iteration.
cimedium risk

Codex Iterative Repair Loop (JSON-Schema Review → Repair)

/ralph★ OpenAInew

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.

prompt
→ Claude
Script alternates two `codex exec` calls: (a) review pass with a JSON schema output ("list remaining issues as machine-readable findings"), (b) repair pass fed those findings verbatim. Loop while findings remain, capped by max attempts. Stops for one of four reasons: validation passes, max attempts reached, remaining delta stops changing, or next decision needs human review.
reviewmedium risk

Cursor "Iterate Until Tests Pass, Never Touch the Tests"

/ralphnew

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.

prompt
→ Claude
"Write code that makes these tests pass. Do NOT modify the tests. Keep iterating — run the suite, fix failures, run again — until all tests pass." (paraphrase of Cursor's official agent best-practices guidance)
testingmedium risk

Loop cost guardrails pattern

/ralphnew

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.

prompt
→ Claude
Every loop gets: `MAX_ITER=20` hard cap, "or stop after N turns" in the /goal text, `max_budget_usd` on SDK loops, and a /cost check in the loop body.
automationmedium risk

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.

prompt
→ Claude
Design framework: choose schedule (when), goal (what done means), subagents (who does isolated pieces) — with worked examples in Claude Code and Codex.
planningmedium risk

/goal + Routines overnight combo

/scheduleSabrina Ramonovnew

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.

prompt
→ Claude
/schedule a Routine (runs on Anthropic cloud, laptop closed) for recurring unattended work, and use `/goal` for in-session iterate-to-done — the two-layer overnight pattern.
automationmedium risk

Spec-first Ralph (PLAN.md-driven)

/ralphHumanLayernew

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.

prompt
→ Claude
Ralph variant where the loop prompt is "read PLAN.md, pick highest-priority unchecked item, implement, check it off, commit, exit" — spec file evolves with the codebase.
planningmedium risk

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.

prompt
→ Claude
/loop every 2 minutes: check deploy status; when it's live, run the smoke test and summarize; if smoke test fails, report the failing check and stop
devopsmedium risk
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 →