loops

A command that helps choose and configure a repeatable-task recipe, such as a goal, scheduled job, or loop, with observable stopping conditions and safety checks.

In plain words
What is it for?
Use it to evaluate recurring tasks, fill in their real commands, create missing recipes, and prepare commands for local or scheduled automation without running them automatically.
Why use it?
It prevents unsuitable automation for infrequent or judgment-based work and makes repeated jobs stop based on measurable results rather than vague intentions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xcodethink/open-claude-code-skills/loops
Clone the repo
git clone --depth 1 https://github.com/xcodethink/open-claude-code-skills
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 738 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00738
Opus 5 $0.00015 $0.00369
Sonnet 5 $0.00006 $0.00148
Haiku 4.5 $0.00003 $0.00074

Measured 2d ago against content hash d06dc6eb0ea3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loops scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/loops.md · 35 lines

What it actually says

loops — 重复任务配方库(用户触发,零常驻成本)

用户输入 /loops $ARGUMENTS 时,按需加载配方库帮挑配方、填真实命令、过护栏。

立刻读取并完整加载

  • ~/.claude/loops/COVERAGE.md(覆盖地图:状态+缺口)
  • ~/.claude/loops/catalog.md(标准配方 A/B/C/D 四类)
  • ~/.claude/loops/my-loops.md(我的实例)
  • 决策理论如需细则 → ~/.claude/skills/21-任务执行纪律/循环工程-loop.md

执行

无参数 → 直接呈现 COVERAGE 覆盖地图(重点是"当前缺口"段),问用户要补哪个 / 跑哪个。

有参数(一个重复任务) → 按顺序:

  1. 过决策表四判据:终态能否一条命令判真假?"够好"客观还是主观?频率≥每周?——判 A(可 /goal)/ B(定时)/ C(别 loop)。
  2. 命中配方 → 从 catalog 取对应配方,把 <...> 换成用户项目的真实命令(要问就问,别猜命令)。
  3. 写停止条件:必须可观测(退出码/文件状态/计数),配 stop after N 兜底;不能是意图。
  4. 过护栏:proactive//schedule 上云前,逐条过进程爆炸铁律(嵌进程预算,fan-out≥4 先问)+ 云资源铁律 + 本地开发别推部署 → 先征用户同意再起
  5. 产出可粘贴命令/goal ... / /loop ... / cron),但不替用户执行——由用户敲,或明确让我跑才跑。
  6. 判为 C(别 loop)→ 直说别自动化,给"该怎么做"(/grill+HITL 等),不硬凑成 loop。

新任务无对应配方 → 先给 catalog 加一条标准配方,再实例化到 my-loops,再给命令。

用户要求加/改/补库("把 XX 也做成配方"/"改状态"/"加一类")→ ① 按 catalog 格式加配方 → ② 更新 COVERAGE 状态/缺口 + 最后更新日期 → ③ 需要时更新 my-loops。这是共建路径,见 COVERAGE「共建这个库」。

核心契约:库是菜谱、/goal 是开火——本命令只帮你选菜谱+配好料,不自动下厨;主观/低频/判断型的活明确劝退,不被"只写 loop"带偏。

参数: $ARGUMENTS

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 35 lines · 31 tokens per session scan A d06dc6eb0ea3

Subscribe to this mod's changes

loops is a command published in the GitHub repository xcodethink/open-claude-code-skills (2 stars, last pushed 27d ago), licensed MIT. It adds 31 tokens to every session and 738 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.