MCP.so
Sign In

Loops

Reusable prompts and step-by-step workflows that let coding agents self-pace through a task until it's done.

Featured

Testingmanual

Build Until Green

Run the production build, fix compile and bundling errors, and loop until the build succeeds.

CursorClaude Code
Qualitymanual

A11y Audit Until Clean

Run automated accessibility checks on changed routes, fix violations, and repeat until the audit is clean.

Cursor
Testingmanual

Coverage Until Threshold

Add focused tests until coverage meets your threshold (e.g. 80%), without changing production behavior unnecessarily.

Claude Code
CIinterval

CI Failure Watcher

Poll CI on an interval, investigate failures when checks go red, and push fixes until green.

CursorClaude Code
CIinterval

PR Babysitter

Every 15 minutes, inspect open PRs with a watch label: nudge reviewers, fix CI, rebase if behind main.

CodexCursor
Testingmanual

Flaky Test Triage

Run failing tests repeatedly, classify each failure as flaky or real, and fix only confirmed regressions.

Claude CodeCursor
Testingmanual

Format Until Clean

Run the formatter, fix any remaining style issues, and loop until the codebase formats cleanly with no diffs.

Cursor
Automationmanual

Ralph Story Executor

Fresh-context loop: pick one incomplete story from prd.json, implement it, run backpressure checks, commit, and update progress before the next iteration.

CursorClaude Code
Maintenancemanual

Docs Sync After Edits

After code changes, find affected docs and update README, API references, and inline comments to match.

Cursor
Testingevent

Pre-Commit Guard

Hook that runs tests before git commit commands to block commits when the suite is red.

Cursor
Reviewmanual

De-Sloppify Pass

After implementation, run a cleanup pass: remove debug code, tighten naming, delete dead branches, and align with project conventions.

Claude CodeCursor
DevOpsinterval

Deploy Verification Loop

On an interval, hit health and smoke endpoints after a deploy until all checks return healthy responses.

CodexCursor
Automationmanual

Guardrails Learning Loop

When a check fails twice the same way, append a guardrail sign to .ralph/guardrails.md so the next iteration avoids repeating it.

CursorClaude Code
CIinterval

PR Watch Loop

Poll open PRs labeled codex-watch every 15 minutes, review activity, and flag regressions or stale threads.

CodexCursor
Testingmanual

Autoloop TDD

Test-first loop: write a failing test, implement the minimum code to pass, refactor, and repeat.

Claude Code
APImanual

OpenAPI Sync Until Valid

Keep openapi.yaml valid and in sync with route handlers — lint the spec and fix drift each pass.

Cursor
Securitymanual

npm Audit Fix Loop

Fix high/critical npm audit findings one at a time with test verification — not a blind npm audit fix --force.

Cursor
Maintenancemanual

Knip Until Clean

Find and remove dead exports, unused files, and orphan dependencies — loop until knip reports clean.

Cursor
CImanual

Ship PR Until Green

Implement on a branch, run tests, push, open a PR, wait for CI, and loop until checks pass and the PR is ready to merge.

Claude CodeCursor
Testingmanual

Independent Verifier Pass

When implementation claims done, a separate verifier pass runs build, lint, and tests with no access to the implementer's rationale.

Claude Code
Docsmanual

Changelog Sync After Ship

After shipping a feature, loop until CHANGELOG.md has a user-facing entry and conventional commits are reflected.

Claude Code
Databasemanual

Migration Until Applied

Run database migrations, fix schema issues, and loop until migrations apply cleanly in dev.

Cursor
APImanual

API Contract Until Match

Loop until API responses match the OpenAPI or JSON Schema contract — catch drift between docs and implementation.

Cursor
Debuggingmanual

Reflexion Debug Loop

On each failed repro attempt, write a short reflection to disk, then retry with that memory — avoids repeating the same wrong fix.

Claude CodeCursor
CImanual

Fix CI Until Green

Fetch the latest failed CI run, reproduce the failure locally, fix it, and repeat until checks pass.

CursorClaude Code
Testingevent

Post-Merge Regression Guard

Hook that runs smoke tests after git merge or rebase to catch integration regressions immediately.

Cursor
Testingmanual

Lint and Typecheck Fix

Run lint and typecheck, fix reported issues, and loop until the codebase is clean.

Cursor
DevOpsmanual

Staging Smoke Test

Run a fixed smoke checklist against staging after deploy: auth, core flows, and error budgets.

Cursor
Testingevent

Post-Edit Test Guard

Hook-based loop that runs related tests after file edits to catch regressions early.

Cursor
Maintenanceinterval

Security Audit Weekly

Weekly npm audit scan, triage vulnerabilities by severity, and propose or apply safe patches.

Claude Code

Frequently asked questions

Common questions about reusable Loops for AI coding agents

1

What is a loop, exactly?

A loop is a reusable workflow for AI coding agents built around four parts: a goal, a check command that objectively verifies progress, an exit condition, and a max-iteration limit. Paste the kickoff prompt into your agent and it self-paces through the task, re-running the check command after each pass until the exit condition is met.

2

How is this different from writing a normal prompt?

A normal prompt is one instruction for one turn. A loop is the system around repeated turns — it tells the agent how to verify its own work and when to stop, so it can keep going without you re-prompting it after every attempt. This practice is known as loop engineering.

3

Which coding agents do these loops work with?

Most loops on this page are agent-agnostic — the kickoff prompt is plain text you can paste into Claude Code, Cursor, Codex, or any other coding agent. Each loop's page lists which agents it was specifically built and tested for.

4

When should I use an AI agent loop?

Use a loop when a task needs several revision passes and has an objective acceptance check, such as fixing tests, resolving CI failures, reviewing code, verifying a deployment, or completing a large refactor. One-off questions and tasks without a clear definition of done usually do not need a loop.

5

How should I design a check command and exit condition?

Choose a stable, repeatable check with a meaningful exit code, such as tests, type checking, linting, or a deployment health check. Define an observable completion state and set a maximum iteration count so the AI agent cannot retry forever.

6

Are AI coding loops safe to run?

A loop repeatedly executes prompts and commands, so restrict file, network, secret, and deployment access; run risky work in an isolated branch or sandbox; and keep iteration limits and human review. Never let an unreviewed loop run destructive commands.