← Back to all free guides

All 15 AI Loops
People Run

In the video I showed you my 3 favorites. As promised, here are all 15 from Matt van Horn’s roundup, each with a copy-paste command.

Matt van Horn pulled together the top 15 AI loops people are running right now. Here’s his original post on X, go give him a follow. I’ve put the full list here so you have every one in one place, and I rewrote each command into a fuller version you can paste.

What A Loop Even Is

Normally you ask, the AI answers once, and it’s done. A loop decides when and how long your agent keeps working, checking its own progress toward a finish line, for minutes or even hours.

These run in Claude Code, and most of the loops below start with one of these commands.

  1. /goal keeps Claude working, turn after turn, until a condition you set is true.
  2. /loop reruns a prompt on a timer (as often as every minute) while your session is open. It expires after 7 days. (Docs)
  3. /schedule creates a cloud scheduled task (formerly called a routine) that runs on Anthropic’s servers with your laptop closed. Pro, Max, Ultra, Team and Enterprise plans. Fastest interval is once an hour. (Docs)

A few entries are tools you install instead, and I’ve marked those.

The 11 From The Roundup

01

The Build-Test-Fix Pair

The most-demoed loop in Matt’s pull, from a creator named raycfu. One agent builds, a checker runs the tests, types and lint and reports exactly what broke, and they pass work back and forth until it’s clean. A one-shot agent ships its bugs. This one doesn’t.

/loop · build-test-fix
/loop Build the next unchecked item in PLAN.md. Then run the tests, the typecheck and the linter. Treat every failure as your next instruction: read the error, fix the cause (not the test), and run all three checks again. Each pass, append one line to LOOP-LOG.md: the item, what failed, what you changed. Rules: - Never delete, skip or weaken a test to make it pass. - If the same check fails 3 passes in a row, stop and tell me what you tried. Stop when all three checks are green and the item is checked off in PLAN.md. Then summarize what changed in 5 bullets or fewer.

02

Boris’s Verifier Loop

Boris Cherny, who created Claude Code, describes it as Claude Code plus a strong model plus a verifier, in a loop. The verifier is the part everyone skips. Without it you’re just trusting the agent.

/loop · verifier
/loop Work through TASKS.md one task at a time. After each task, start a separate verifier subagent that did not write the code. Give it the task, the spec and the diff. It checks the result against the spec and runs the tests, then answers PASS or FAIL with reasons. - PASS: mark the task done and move to the next one. - FAIL: fix what the verifier found and send it back for review. - Two FAILs on the same task: stop working on it, add it to BLOCKED.md with the verifier's notes, and move on. When the list is done, give me a table: task, verdict, number of verifier rounds, anything in BLOCKED.md.

03

The Loop-Engineer Starter

AI Jason (Jason Zhou) shared a free starter that wires up the build, observe, verify and stop plumbing for you. It now lives as a Claude Code plugin in AI-Builder-Club/skills. Run the harness setup inside your repo, then /new-loop to build your first loop. The fastest way to have one running tonight.

Install · Claude Code
/plugin marketplace add AI-Builder-Club/skills /plugin install skills@ai-builder-club # then, inside the code repo your agent works in: /setup-codebase-harness # and in the folder where your loop's memory should live: /new-loop

04

The Five-Minute Repo Maintainer

Peter Steinberger runs this one on a tight timer. Every five minutes the agent does one small, verified piece of upkeep, and the agent picks what to clean, not a hardcoded script.

/loop 5m · maintainer
/loop 5m Make ONE small, verified improvement to this repository. Pick it yourself from things like a flaky test, a stale comment, a missing type, or dead code. Prefer the smallest safe change you can find. Each run: 1. Make one change only. 2. Run the full test suite. If anything fails, revert your change. 3. If green, commit with a one-line message that starts with "chore(loop):". Never touch: auth, payments, database migrations, public APIs, or config files. If you can't find a safe improvement, do nothing and say "nothing safe this round".

05

Plan-Generate-Verify-Fix

From a creator named qbuilder. Plan, generate, verify, fix, repeat, with state saved to files and a hard cap of five passes. The cap is what makes it safe to walk away.

/goal · capped
/goal Complete this task: [describe the task]. Work in passes: plan, implement, verify against the tests, fix what failed. - Save your plan and the state of each pass to GOAL-STATE.md so a crash loses nothing. - Maximum 5 passes. - Stop at the first pass where every test passes, or when you hit pass 5. At the end, tell me which one happened, show the final test output, and list anything still broken. I only want to read the final version, not every attempt.

06

roborev, The Post-Commit Reviewer

An installed tool. roborev is free and open source. It adds a git hook so every commit gets a background code review, then an agent fixes the findings while the context is fresh. It works with Claude Code, Codex, Gemini CLI and more. Install with brew install roborev on a Mac, or see the repo for Linux and Windows.

Terminal · roborev
roborev init # installs a post-commit hook: every commit gets a background review roborev fix # an agent fixes the open review findings and commits them roborev refine # fix, re-review and repeat until the review passes

07

The Goal-Meta-Skill

Surfaced by evgenii.arsentev: before any work starts, the agent turns your vague ask into a real goal and checks it with you first. His line: your agent isn’t dumb, your instructions are vague.

/goal · sharpen first
/goal Before you do anything, rewrite my request below into a precise goal with these 4 parts: 1. End state: exactly what will be true when you're done. 2. Verification: the command, test or check that proves it. 3. Off limits: files, systems or behaviors you must not touch. 4. Stop condition: when you stop, including when to give up and ask me. Show me the 4 parts and wait for my OK. Once I confirm, work against that goal and nothing else. My request: [paste your vague ask here]

08

The 15,000-Emails-A-Day Loop

A builder on r/LangChain shared the architecture of an agent that handles 15,000 hotel guest emails a day. It sorts the inbox, drafts the routine replies and escalates only what needs a human. My version only drafts, and it needs your inbox added as a connector on the task.

/schedule · hourly inbox
/schedule Every hour, check the shared inbox connected to this task for new guest emails. For each email: 1. Classify it: booking question, change request, complaint, refund, or other. 2. For routine questions, draft a reply in our tone using the FAQ file in this repo. Save it as a draft. Do not send. 3. Put anything about refunds, booking changes, complaints, legal or safety in a "needs Mariah" list. Log every email and the decision you made to triage-log.md. Never send an email, issue a refund, or change a booking. End each run with counts per category and the "needs Mariah" list.

09

The Anti-Spin Loop

A Claude Code skill shared on Reddit. It builds, audits and verifies until a machine-checkable contract passes, with hard stops for no progress, repeats, flip-flopping and budget.

/loop · anti-spin
/loop Build toward this contract: [paste a machine-checkable definition of done, e.g. "npm test passes and /health returns 200"]. Each pass: build, audit your own change, then verify against the contract. Anti-spin stops. End the loop and report if any of these happen: - No measurable progress for 2 passes in a row. - You are about to retry an approach you already tried. - You flip back to an approach you abandoned. - You hit [budget, e.g. 10 passes]. Never edit the tests or the contract to make them pass. Finish only when the contract passes, and show the proof.

10

Write Loops, Not Code

Boris Cherny has said he doesn’t write code by hand anymore. The shape here is a nightly cloud task that watches your pull requests and fixes what’s fixable while you sleep.

/schedule · nightly PRs
/schedule Every night at 2am, review my open pull requests in this repo. For each PR: - Build failing: find the cause, push a fix to the PR branch, confirm the build goes green. - Unanswered review comments: address each clear one in code and reply on the thread with what you changed. - Behind main: rebase it if the rebase is clean. Skip anything ambiguous, risky, or that needs a product decision, and list it for me instead. Never merge a PR or force-push to main. Finish with a short report: PR, what you did, what's waiting on me.

11

The Human Approval Queue

From the no-code crowd on r/n8n. The workflow runs, then pauses and asks you to approve, revise or skip. Same loop shape, but the stop condition is your yes instead of a passing test. You’ll need a messaging tool connected so it can reach you.

/loop · approval
/loop Work through the items in QUEUE.md one at a time. For each item: do the work, then pause and send me a summary through [the messaging tool you've connected, e.g. Slack or Telegram] with three options: APPROVE, REVISE, SKIP. - APPROVE: finish and ship it, then move on. - REVISE: take my note, redo it, and ask me again. - SKIP: leave it and move to the next item. Nothing goes out without my APPROVE. If I haven't answered in 2 hours, remind me once, then wait.
Bonus 4 From The Loop Library

The last four come from Matthew Berman’s Forward Future Loop Library, a free, curated catalog of loops that each come with a built-in check and a clear stopping point.

12

The Production Error Sweep

Reads your production logs, separates real errors from noise, fixes the real ones and opens a pull request. Tell it what counts as actionable or it chases ghosts. (Original)

/goal · error sweep
/goal Review the last 24 hours of production error logs. 1. Group repeated errors into incidents. 2. Separate actionable product bugs from noise: transient network blips, third-party outages, known issues in KNOWN-ISSUES.md. 3. For each actionable bug: trace the root cause, write the smallest fix, add a regression test, and open one pull request per fix. Never paste tokens, passwords or customer data into PRs or chat. If nothing is actionable, stop without changing anything. Done when every actionable error has a PR or a written reason it can't be fixed yet. End with a table: error, root cause, PR link or reason.

13

The Quality Streak Loop

It doesn’t stop at the first green run. Every failure becomes a regression test and resets the count. One green run is luck, a streak is reliability. (Original)

/goal · streak
/goal Test this product against realistic scenarios until it passes [10] in a row. Before you start, write the list of scenarios and the pass criteria to STREAK.md. Do not change them later to make the streak easier. Run one scenario at a time. When one fails: 1. Document the failure in STREAK.md. 2. Add a regression test for it. 3. Fix the cause and verify the fix. 4. Reset the streak to zero. Done only after [10] consecutive passes. Report the final streak and every failure you fixed along the way.

14

The Clodex Adversarial Review

An installed tool. Lukas Kucinski’s Clodex has Claude build and open a pull request, then Codex reviews it adversarially, and Claude fixes the findings and repeats. --max-iter 5 caps the rounds and --threshold medium sets the highest severity it will accept. You need the Clodex plugin and Codex set up first. (Original)

Claude Code · Clodex
/clodex [task] think hard --max-iter 5 --threshold medium

15

The Completion Contract

An installed skill for Codex, from 3goblack (@Dis_Trackted). Before work starts, it writes down what "done" means and the proof each requirement needs, then won’t call the work finished until every item is proved. Loop 7 is a no-install version of the same idea. (Original)

Codex · goal planner
$goal-planner-codex [task]
If You Only Steal Three
  1. The build-test-fix pair (01) for anything with a clear pass or fail.
  2. The goal-meta-skill (07) to kill vague asks before they waste a run.
  3. The human approval queue (11) for anything going out in your name.

You can stack all three on one job. One warning: loops keep spending your usage until they stop, so always give them a cap.

Full credit for this roundup goes to Matt van Horn on X.