Iterative improvement loop — refine a target across multiple Algorithm cycles toward ideal state. USE WHEN loop, iterate, refine, multiple passes, keep improvin
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-loop-fa7400553579 ,按照其中的说明把「Loop」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
/loop runs the Algorithm as a loop — multiple full Algorithm cycles on the same target, each iteration building on the last. By default a human reviews and redirects between iterations. Unlike /optimize (an autonomous mutation loop), /loop runs full Algorithm passes with that human review in the seam.
Some work doesn't finish in one pass. A skill, a prompt, a diagram, a piece of writing gets meaningfully better each time you run a full cycle on it — but only if each cycle remembers what the last one learned and what it already tried. Run the cycles by hand and you lose that thread: you re-explore dead ends, forget which approaches got rejected, and have no record of whether the score actually moved. /loop carries ISC criteria and a dead-ends ledger across iterations so each pass starts from where the last one ended.
Each iteration is a full Algorithm cycle (OBSERVE → LEARN). The LEARN phase of one cycle feeds the OBSERVE phase of the next, the ISA tracks iteration count and cumulative improvements, and a human approves or redirects between iterations unless autoresearch mode is enabled.
/loop --target "path/to/target" --iterations 5
/loop --target "~/.claude/skills/Art/Workflows/TechnicalDiagrams.md" --goal "make diagrams more consistent"
/loop --resume # Resume a previous loop
/loop --status # Show iteration history
Each iteration is a full Algorithm cycle (articulate → climb → verify → learn) with:
| Argument | Required | Default | Description |
|---|---|---|---|
--target PATH | yes | What to improve (file, directory, skill) | |
--goal TEXT | inferred | What "better" means for this target | |
--iterations N | 3 | Maximum number of Algorithm cycles | |
--resume | Resume a previous loop | ||
--status | Show iteration history | ||
--autoresearch | off | Opt-in autonomous mode — see below |
The iteration field tracks cycle count. (mode: is retired — never write it.) Each cycle re-enters the Algorithm with accumulated context from prior iterations.
--autoresearch switches /loop from supervised multi-pass improvement to autonomous iteration, borrowing three patterns from pi-autoresearch (davebcn87, MIT):
--iterations reached, target met, or explicit interrupt.## Dead Ends section. Every failed iteration appends one line with the rejected approach and reason. Resumes read this to avoid retrying rejected paths.|delta|/MAD(iteration_scores) per cycle. Flag red (<1.0×) iterations as noise-floor and log marginal; do not update baseline. See LIFEOS/ALGORITHM/optimize-loop.md → Confidence Gating.Invocation:
/loop --target "path" --goal "X" --iterations 20 --autoresearch
Default /loop behavior is unchanged — autoresearch is opt-in only. Intended for overnight runs on targets where human-in-the-loop review between cycles is too slow.
/loop --target "~/.claude/skills/Research" --goal "improve output quality" --iterations 5
/loop --target "prompts/summarize.md" --goal "more concise, less filler"