awesome-agent-loops

agent
Security Audit
Warn
Health Pass
  • License — License: CC-BY-4.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 10 GitHub stars
Code Warn
  • Code scan incomplete — No supported source files were scanned during light audit
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A curated collection of the best /loop, /goal, and /schedule uses for Claude Code & Codex — real commands sourced from Twitter/X. The awesome-list of agent loops.

README.md

Awesome Agent Loops Awesome

License: CC BY 4.0

check out my latest work, and run /loop in first-tree free :D

Claude Code Loops ⚡️

The best /loop, /goal, and /schedule prompts — copy-paste commands from X power users who stopped prompting one step at a time and started running loops.

Three built-in ways to make a coding agent keep working on its own: /loop re-runs a prompt on an interval, /goal runs until a condition is true, /schedule runs in the cloud on a cron. No plugins, no harnesses. (/goal is also in Codex, but only tracks a target.)

Copy any prompt, swap in your repo / PR / condition, run it.

🔁 Don't want to remember any of these? This list is the library — loopable is the librarian. Install it once and your agent suggests the matching loop from this list the moment your conversation gets loop-shaped. Never auto-run; you stay in charge.

Why "loops"? Boris Cherny, who created Claude Code, put it this way: "I don't prompt Claude anymore. I create loops — and the loops do the work. My job is to create loops." (source) For the longer version, @shannholmberg wrote the best primer on what agent looping actually is.

Table of Contents

/loop — repeat on an interval

/goal — run until a condition is true

/schedule — cron in the cloud


A. /loop — repeat on an interval

/loop re-runs a prompt (or another slash command) on a time interval, then sleeps between runs. Press Esc to stop. (docs)

Kill flaky tests

/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

No interval — Claude self-paces and ends the loop itself once 5 green runs in a row is provably met. source

Watch tests

/loop 15m run the test suite, and if anything fails,
show me the failing tests and the error output

The shape is /loop <interval> <prompt>. Stops when you close the terminal — use /schedule for runs that survive. source

Babysit a PR

/loop 20m /review-pr 1234

The prompt can be another slash command. This is how Boris Cherny works now — he writes loops that prompt Claude, instead of prompting himself. source

Babysit many PRs

/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

A 15-minute watchdog over a labeled set of PRs. Popularized as the "PR Babysitter" loop (boris-cherny) in the loops! catalog. source

Wait for CI

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

Use /loop when you want to watch something on a clock, not drive an agent to a finish (that's /goal). source


B. /goal — run until a condition is true

/goal sets a completion condition; after each turn a fast model checks it, and if it's not met Claude keeps going. /goal <condition> to set, /goal to check, /goal clear to stop. (docs)

Fix tests + lint

/goal all tests pass and lint is clean

The most-shared /goal on X. One sentence, and the agent fixes bugs, runs checks, and ships clean — "literally a $200/hr QA engineer." source

Hit acceptance criteria

/goal the /users endpoint returns 200 with a
paginated JSON body, all tests pass, and lint is
clean — stop after 20 turns

"write /goals like acceptance criteria… you set a completion condition, the agent works until a fast evaluator confirms it's met."

source

Migrate an API

/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

"A SINGLE CODEX /goal RUN IS THE CLEAR WINNER. NO ORCHESTRATION… it completely destroyed the Opus orchestration setup."

Try one /goal with a clear finish line before reaching for a multi-agent harness. source

Ship a PR until green

/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

The most-copied loop in the loops! catalog — drives the whole implement → push → PR → fix-CI cycle. source

Reach coverage target

/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

A bounded /goal with a numeric end state. Swap in your own threshold. source

Get the build green

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

Iteratively clears compile and bundling errors until the production build passes. source

Clean up the slop

/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

The "De-Sloppify Pass" — second most-copied loop in the loops! catalog. Great after an agent leaves a mess. source

Apply DB migrations

/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

Keeps applying and repairing migrations until the status check comes back clean. source

Format until clean

/goal `npm run format` leaves no diff — run the
formatter, hand-fix anything it can't auto-fix, repeat
until `git diff` is empty

Runs the formatter on repeat and fixes whatever it can't auto-resolve. source

Refactor with subagents

/goal refactor the dialogue system to support
branching + emotion tags

"Set /goal… Claude spawned 3 subagents: one for parser, one for UI, one for tests. All three finished."

/goal fanning out across a module. source

Flash firmware

/goal the onboard LED blinks in the specified pattern

"I use /goal to define what the firmware should achieve… Claude writes the code and flashes it to the board via a J-Link debugger."

Not just for web — anything with a verifiable end state works. source


C. /schedule — cron in the cloud

/schedule saves a Routine — a prompt + repo + connectors that runs on Anthropic's cloud on a schedule (min 1 hour), so it keeps running with your computer off. (docs)

Morning issue triage

/schedule every weekday at 9am, label new issues from
the last 24h by area and priority, and post a
one-line summary on each

"Configure once — prompt + repo + connectors — and it runs 7×24 in the cloud, even with your computer off."

source

Keep docs in sync

/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

"Trigger agents on a schedule, from a GitHub event, or via API. Anthropic uses this internally for docs and backlog maintenance."

source


More loops

  • loops! by elorm — a searchable catalog of 40+ ready-to-copy loops for Claude Code, Cursor, and Codex.

Contributing

Got a great /loop, /goal, or /schedule use from X? Add it — one of these three commands, the actual command in a code block, the tweet as [source](url). See contributing.md.

CC BY 4.0 Licensed under CC BY 4.0.

Reviews (0)

No results found