@QingQ77: 一份精选列表,收录 Twitter/X 上 Claude Code 和 Codex 用户分享的最佳 /loop、/goal、/schedule 实战命令,可直接复制使用。
Summary
A curated list of practical /loop, /goal, and /schedule commands for Claude Code and Codex, shared by power users on X/Twitter, collected in an awesome-list GitHub repository for copy-paste use.
View Cached Full Text
Cached at: 06/16/26, 05:40 PM
一份精选列表,收录 Twitter/X 上 Claude Code 和 Codex 用户分享的最佳 /loop、/goal、/schedule 实战命令,可直接复制使用。
https://t.co/8iV5J2aZD7
serenakeyitan/awesome-agent-loops
Source: https://github.com/serenakeyitan/awesome-agent-loops
Awesome Agent Loops 
- use this link to use first-tree 🌳 for free!!! — the most efficient way to loopmaxx your engineering work :D
- too lazy to remember loops? loopable suggests them while you chat, never auto-runs :)
The shape of a perfect loop
Timer outside, condition inside, skill innermost. /loop re-arms it on a schedule, /goal defines verified-done so it can’t stop early, the skill does the work well:
/loop 30m /goal all PR review comments resolved via /review, stop after 10 turns
Claude Code Loops ⚡️
The best
/loop,/goal, and/scheduleprompts — 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.
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
- Kill flaky tests · until 5 green runs in a row
- Watch tests · re-run every 15m, report failures
- Babysit a PR · re-run
/review-pron a timer - Babysit many PRs · keep labeled PRs green & rebased
- Wait for CI, ping when green · poll a PR’s checks
/goal — run until a condition is true
- Fix tests + lint · the “$200/hr QA engineer”
- Hit acceptance criteria · endpoint behaves to spec
- Migrate an API · move every call site, keep green
- Ship a PR until green · implement → PR → fix CI
- Reach coverage target · add tests until 80%
- Get the build green · fix errors until build passes
- Clean up the slop · strip debug code, dead branches
- Apply DB migrations · run + fix until status clean
- Format until clean · run formatter until no diff
- Refactor with subagents · fan out across a module
- Flash firmware · loop until the hardware behaves
/schedule — cron in the cloud
- Morning issue triage · label + summarize daily
- Keep docs in sync · on every push to main
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.”
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
/goalRUN 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
/goalto 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.”
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.”
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.
Licensed under CC BY 4.0.
Similar Articles
@duange6099: If you're also looking to get started with Claude Code, I highly recommend bookmarking this collection of resources. Feel free to share your experiences and learn together. 1. Most comprehensive Chinese tutorial (recommended to read first) Covers from installation to hands-on projects https://github.com/shareAI-lab/le…
A Twitter user shared a carefully curated collection of Claude Code learning resources, including Chinese tutorials, command tips, skill libraries, etc., for beginners to get started.
@li9292: 我推荐这个网址: https://loops.elorm.xyz 收录了几十个大神的 loop engineering的思路
A curated collection of pre-built agent loops (closed-loop workflows) for coding agents like Claude Code and Cursor, including triggers, feedback gates, and exit conditions for self-paced task execution.
@aronhouyu: https://x.com/aronhouyu/status/2063561548145275255
Introduces an open-source repository called awesome-codex-skills, which contains thousands of preset skills for Codex (as well as Claude Code, Gemini CLI, etc.), covering development, data, collaboration, and other scenarios. It also provides installation and usage guides to help users reuse workflows.
@mvanhorn: https://x.com/mvanhorn/status/2068426104088748331
An article explaining the differences between goal, loop, and schedule commands in AI coding tools like Claude Code and Codex, and providing 15 practical loop examples for running automated tasks.
@akshay_pachaar: 50+ Claude Code commands. One sheet. Grouped by what you're actually trying to do: 1. Project setup & memory 2. Context…
A curated cheatsheet of 50+ Claude Code CLI commands organized by practical use-case categories for developers.