Loop directory

228 loops match your filters.

N+1 query hunt

Loop/goallooprepo

Instrument the test suite with query logging, find endpoints issuing N+1 queries, and fix them with eager loading or batching until the hot paths are clean.

prompt
→ Claude
/goal no endpoint in the integration test suite issues more than 10 SQL queries per request — enable query logging in the test environment, find the worst N+1 offender, fix it with eager loading or a batched query, verify the count dropped and tests still pass, then move to the next; stop after 12 turns
databasemedium riskclaude-codecodex

Upgrade dependencies one at a time

Loop/goallooprepo

Walk through outdated dependencies one package per turn, upgrading, running the full check suite, and pinning back anything that breaks.

prompt
→ Claude
/goal `npm outdated` lists no minor or patch updates — upgrade exactly one package per turn, run tests, lint, and build after each, commit if green, and pin the previous version with a note in UPGRADE-BLOCKERS.md if it fails; stop after 20 turns
maintenancemedium riskclaude-codecodexcursor

Dead code elimination

Loop/goallooprepo

Hunt down unreferenced exports, unused files, and unreachable branches, deleting them in small verified steps until the analyzer reports clean.

prompt
→ Claude
/goal `npx knip` reports no unused files or exports — remove one cluster of dead code at a time, run the full test suite and typecheck after each removal, and revert any deletion that breaks them; stop after 15 turns
refactoringmedium riskclaude-codecodexcursor

TODO burn-down

Loop/looplooprepo

Chip away at the oldest TODO comments in the codebase, one per pass: either resolve it properly or convert it into a tracked issue.

prompt
→ Claude
/loop 30m find the oldest TODO or FIXME comment in the codebase, and either implement it (with a test) if it takes under 50 changed lines, or open a GitHub issue capturing its context and delete the comment; report which TODO you handled; stop when none remain
maintenancemedium riskclaude-codecodexcursor

Rebase train conductor

Loop/looplooprepo

Keep a stack of feature branches rebased in order as their parents merge, resolving trivial conflicts and flagging risky ones for a human.

prompt
→ Claude
/loop 15m for each branch listed in .rebase-train (in order), rebase it onto its updated parent, resolve only trivial conflicts (imports, formatting, lockfiles), run the test suite, and push with `--force-with-lease`; if a conflict touches logic, stop that branch and leave a summary comment on its PR instead
gitmedium riskclaude-codecodex

Guardrails that learn from failure

A Ralph-style loop that writes its own rules: when a check fails the same way twice, the failure pattern gets appended to a guardrails file that every later iteration reads first.

prompt
→ Claude
/loop read .ralph/guardrails.md before doing anything, then run the full check suite and fix the first failure; if a check fails twice with the same error, append the failure pattern and a one-line rule for avoiding it to .ralph/guardrails.md before retrying; stop when all checks pass or after 15 turns
automationmedium riskclaude-codecodex

The nested perfect loop

Loop/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.

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

Keep docs in sync with main

Loop/schedule

On every push to main, check whether changed code drifted from the docs in /docs and open a PR fixing anything out of date.

prompt
→ Claude
/schedule on every push to main, check whether the changed code drifted from the docs in /docs, and open a PR fixing anything out of date
docshigh riskclaude-codecodex

Apply database migrations cleanly

Loop/goal

Run migrations, fix schema or SQL errors, and repeat until prisma migrate status reports clean, capped at 6 turns.

prompt
→ Claude
/goal all database migrations apply cleanly — run them, fix schema or SQL errors, repeat until `npx prisma migrate status` is clean; stop after 6 turns
databasemedium riskclaude-codecodex

Clean up the slop

Loop/goal

Review your recent diff for debug code, dead branches, and bad names, then fix with minimal edits until lint and tests pass.

prompt
→ Claude
/goal the recent diff is clean and convention-aligned — review it for debug code, dead branches, and bad names, fix with minimal edits until `npm run lint && npm test` passes; stop after 4 turns
qualitylow 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 →

Get the build green

Loop/goal

Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.

prompt
→ Claude
/goal `npm run build` exits 0 — run the build, fix the first error, repeat until it succeeds; stop after 10 turns

Reach a coverage target

Loop/goal

Add focused tests for the least-covered files and re-measure each turn until coverage hits 80 percent or the turn cap.

prompt
→ Claude
/goal test coverage is at least 80% with all tests passing — add focused tests for the least-covered files, re-run coverage each turn, stop at the threshold or after 12 turns
testingmedium riskclaude-codecodexcursor

Ship a PR until green

Loop/goal

Implement a change, open the PR with gh, then keep fixing CI failures until every check passes, all in one goal loop.

prompt
→ Claude
/goal a PR is open for this change and every CI check passes — implement it, test locally, push, open the PR with `gh pr create`, then keep fixing failures (re-check with `gh pr checks`) until green; stop after 10 turns
gitmedium riskclaude-codecodex

Migrate an API import by import

Loop/goal

Sweep a codebase from a legacy API to its v2 replacement with tests and typecheck as the safety net, capped at 30 turns.

prompt
→ Claude
/goal every file importing from `./legacy-api` now imports from `./v2-api`, all tests pass, and `npm run typecheck` is clean — stop after 30 turns
refactoringmedium riskclaude-codecodexcursor

Hit acceptance criteria

Loop/goal

Drive a feature to done against explicit acceptance criteria: a working paginated endpoint, passing tests, clean lint, and a hard turn cap.

prompt
→ Claude
/goal the /users endpoint returns 200 with a paginated JSON body, all tests pass, and lint is clean — stop after 20 turns
testingmedium riskclaude-codecodex

Wait for CI so you don't have to

Loop/loop

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.

prompt
→ Claude
/loop 10m run `gh pr checks 1234`; if all pass, tell me it's ready to merge; if any fail, summarize which and why

Babysit many PRs at once

Loop/loop

Keep every PR labeled codex-watch healthy: fix CI failures, rebase behind-main branches, and nudge pending reviewers on a 15-minute cadence.

prompt
→ Claude
/loop 15m check every open PR labeled `codex-watch` and keep each healthy: fix CI failures, rebase when behind main, and nudge if a review is pending
cihigh riskcodexclaude-code

Kill flaky tests

Loop/loop

Run your test suite repeatedly, collect every intermittent failure, and fix or quarantine flaky tests until you get five consecutive green runs.

prompt
→ Claude
/loop run my test suite 20 times, collect every intermittent failure, fix or quarantine the flaky ones, and don't stop until you get 5 consecutive fully-green runs
testinghigh riskclaude-codecursor