@QingQ77: 一份精选列表,收录 Twitter/X 上 Claude Code 和 Codex 用户分享的最佳 /loop、/goal、/schedule 实战命令,可直接复制使用。

X AI KOLs Timeline 工具

摘要

一份精选列表,收录了 Claude Code 和 Codex 的实用 /loop、/goal 和 /schedule 命令,由 X/Twitter 上的高级用户分享,整理在 awesome-list GitHub 仓库中,可直接复制使用。

一份精选列表,收录 Twitter/X 上 Claude Code 和 Codex 用户分享的最佳 /loop、/goal、/schedule 实战命令,可直接复制使用。 https://t.co/8iV5J2aZD7
查看原文
查看缓存全文

缓存时间: 2026/06/16 17:40

这是一份精选列表,收录了 Twitter/X 上 Claude Code 和 Codex 用户分享的最佳 /loop/goal/schedule 实战命令,可直接复制使用。https://t.co/8iV5J2aZD7


serenakeyitan/awesome-agent-loops

来源: https://github.com/serenakeyitan/awesome-agent-loops

Awesome Agent Loops

Awesome (https://awesome.re) 许可证: CC BY 4.0

  • 点击此链接 (https://cloud.first-tree.ai/login?utm_source=github&utm_medium=readme&utm_campaign=awesome-loops-app) 即可免费使用 first-tree 🌳 (https://first-tree.ai/?utm_source=github&utm_medium=readme&utm_campaign=awesome-loops-site) —— 这是 循环加满你的工程工作 的最高效方式 :D
  • 懒得记循环?请使用 loopable (https://github.com/serenakeyitan/loopable),它在你聊天时自动建议循环,但绝不会自动运行 :)

完美循环的形态

嵌套循环: /loop 30m 包裹 /goal/goal 包裹 /review 技能。

计时器在外,条件在内,技能在最内层。 /loop 按计划重新触发,/goal 定义“验证完成”状态以确保不提前停止,技能完成实际工作:

/loop 30m /goal all PR review comments resolved via /review, stop after 10 turns

Claude Code 循环 ⚡️

最佳的 /loop/goal/schedule 提示——X 平台高级用户分享的即用命令,他们不再一步步提示,而是开始运行循环。

三种内置方式让编码代理持续自动工作:

  • /loop 按时间间隔重复运行一条提示
  • /goal 持续运行直到条件满足
  • /schedule 在云端按 cron 计划运行

无需插件,无需框架。(/goal 也存在于 Codex 中,但仅追踪目标。)

复制任意提示,替换为你自己的仓库 / PR / 条件,然后运行。

为什么“循环”? Claude Code 的创建者 Boris Cherny 这样表述:“我不再向 Claude 发起提示。我创建循环——循环完成工作。我的工作就是创建循环。” (来源 (https://x.com/0xMovez/status/2064047579499770218))

更详细的版本请见 @shannholmberg (https://x.com/shannholmberg/status/2063924108535197842),她写了关于代理循环究竟是什么的最佳入门文章。

目录

/loop —— 按时间间隔重复

/goal —— 持续运行直到条件满足

/schedule —— 云端 cron


A. /loop —— 按时间间隔重复

/loop 按时间间隔重新运行一条提示(或另一个斜杠命令),然后间隔休眠。按 Esc 停止。(文档 (https://code.claude.com/docs/en/scheduled-tasks))

消灭不稳定测试

/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

无间隔 —— Claude 自我调整节奏,并在连续 5 次完全绿色运行被明确满足时自行结束循环。来源 (https://x.com/ericzakariasson/status/2064122350866682100)

监控测试

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

格式为 /loop <间隔> <提示>。关闭终端时停止 —— 如需持久运行请使用 /schedule。来源 (https://x.com/cnemalek/status/2062977991328583923)

照看 PR

/loop 20m /review-pr 1234

提示可以是另一个斜杠命令。这就是 Boris Cherny 现在的工作方式 —— 他编写循环来提示 Claude,而不是自己进行提示。来源 (https://x.com/0xAndros/status/2064063929517777147)

照看多个 PR

/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

对一组标记的 PR 每 15 分钟进行一次看护。在 loops! (https://loops.elorm.xyz/loops) 目录中被推广为“PR 保姆”循环 (boris-cherny)。来源 (https://loops.elorm.xyz/loops)

等待 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

当你希望按时钟 观察 某些东西,而不是驱动代理到达终点时(那是 /goal 的用途),请使用 /loop。来源 (https://x.com/louiswharmby/status/2063962089819869227)


B. /goal —— 持续运行直到条件满足

/goal 设置一个完成条件;每次操作后,一个快速模型会检查该条件,如果未满足,Claude 继续运行。使用 /goal <条件> 设置,/goal 检查,/goal clear 停止。(文档 (https://code.claude.com/docs/en/goal))

修复测试 + 代码检查

/goal all tests pass and lint is clean

X 上分享最多的 /goal。一句话,代理就能修复 bug、运行检查并交付干净的代码——“简直是时薪 200 美元的质量工程师”。来源 (https://x.com/RodmanAi/status/2054975035639812170)

满足验收标准

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

“像写验收标准一样编写 /goal……你设置一个完成条件,代理持续工作,直到一个快速评估器确认该条件被满足。”来源 (https://x.com/akshay_pachaar/status/2055208848609460525)

迁移 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

“单个 CODEX /goal 运行是明确的赢家。无需编排……它彻底击败了 Opus 编排方案。”在尝试多代理框架之前,先试试一个有明确终点的 /goal。来源 (https://x.com/KingBootoshi/status/2060068980728184842)

发布 PR 直至变绿

/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

在 loops! (https://loops.elorm.xyz/loops) 目录中被复制最多的循环 —— 驱动整个实现 → 推送 → PR → 修复 CI 的循环。来源 (https://loops.elorm.xyz/loops)

达到覆盖率目标

/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

一个带数值终点的有界 /goal。替换为你自己的阈值。来源 (https://loops.elorm.xyz/loops)

让构建变绿

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

迭代地清除编译和打包错误,直到生产构建通过。来源 (https://loops.elorm.xyz/loops)

清理垃圾

/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

“去垃圾化处理” —— 在 loops! (https://loops.elorm.xyz/loops) 目录中被复制第二多的循环。当代理留下一堆杂乱代码后非常有用。来源 (https://loops.elorm.xyz/loops)

应用数据库迁移

/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

持续应用并修复迁移,直到状态检查返回干净。来源 (https://loops.elorm.xyz/loops)

格式化至无差异

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

重复运行格式化工具,并手动修复它无法自动解决的内容。来源 (https://loops.elorm.xyz/loops)

带子代理重构

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

“设置 /goal……Claude 生成了 3 个子代理:一个负责解析器,一个负责 UI,一个负责测试。三个都完成了。” /goal 在模块中展开工作。来源 (https://x.com/hui1231123/status/2064147531194642525)

烧录固件

/goal the onboard LED blinks in the specified pattern

“我使用 /goal 来定义固件应该达到的效果……Claude 编写代码并通过 J-Link 调试器烧录到开发板。”不仅限于 Web —— 任何具有可验证结束状态的事物都适用。来源 (https://x.com/EitanRevach/status/2064135652288217093)


C. /schedule —— 云端 cron

/schedule 保存一个 Routine —— 一个提示 + 仓库 + 连接器,按计划(最小间隔 1 小时)在 Anthropic 的云端运行,即使关闭电脑也能持续运行。(文档 (https://code.claude.com/docs/en/routines))

早晨问题分类

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

“配置一次——提示 + 仓库 + 连接器——然后它就在云端 7×24 运行,即使电脑关机也不例外。”来源 (https://x.com/chenchengpro/status/2044212236881932637)

保持文档同步

/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

“按计划、从 GitHub 事件或通过 API 触发代理。Anthropic 内部使用此功能进行文档和待办事项维护。”来源 (https://x.com/starmexxx/status/2044653921629606204)


更多循环

  • loops! (https://loops.elorm.xyz/loops) 由 elorm (https://elorm.xyz) 创建 —— 一个可搜索的目录,收录了 40 多个可直接复制的 Claude Code、Cursor 和 Codex 循环。

贡献

你有一个来自 X 的精彩的 /loop/goal/schedule 用法?添加它 —— 这三个命令之一、代码块中的实际命令、以及作为 [source](url) 的推文。请参阅 contributing.md

CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) 根据 CC BY 4.0 许可证授权。

相似文章

@aronhouyu: https://x.com/aronhouyu/status/2063561548145275255

X AI KOLs Following

介绍了一个名为awesome-codex-skills的开源仓库,收录了上千个针对Codex(以及Claude Code、Gemini CLI等)的预设技能(Skills),涵盖开发、数据、协作等场景,并提供了安装和使用指南,帮助用户复用工作流。