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.
npx agentmods add skills/okwinds/miscellany/loopbacknpx skills add okwinds/miscellany --skill loopbackgit clone --depth 1 https://github.com/okwinds/miscellanyWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00107 | $0.02263 |
| Opus 5 | $0.00053 | $0.01131 |
| Sonnet 5 | $0.00021 | $0.00453 |
| Haiku 4.5 | $0.00011 | $0.00226 |
Grade A, and why
loopback 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.
How it starts
The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Loopback 迭代开发循环
快速开始(推荐)
- 直接启动(默认会进入“向导模式”)
/loopback "修复 X。完成后输出 <promise>DONE</promise>。" --completion-promise "DONE" --max-iterations 10
说明:
- 如果当前环境支持交互式输入,
/loopback会默认进入向导:先展示全局步骤,再一步步帮你完善参数与契约 - 如果当前环境不支持交互式输入,
/loopback会输出步骤概览,并在缺少关键契约时直接失败(避免跑飞) - 如需跳过向导:加
--no-wizard
- 不确定怎么传参:先看参数说明(不会创建状态文件、不会启动循环)
/loopback --guide
- 参数看起来没问题:先用
--dry-run预演(不会创建状态文件、不会启动循环)
/loopback "修复 X。完成后输出 <promise>DONE</promise>。" --completion-promise "DONE" --max-iterations 10 --dry-run
- 正式启动
/loopback "修复 X。完成后输出 <promise>DONE</promise>。" --completion-promise "DONE" --max-iterations 10
什么是 Loopback?
Loopback 是一个基于 Ralph Loop 思想的迭代开发方法论,适配到 Codex CLI 环境。
核心概念:
while true; do
# 从 .codex/loopback.local.md 读取同一条 PROMPT
# 运行 Codex 一轮(例如:codex exec)
# 检查停止条件(max-iterations / completion-promise / cancel)
if is_complete; then break; fi
done
同样的提示词被反复发送给 Codex。Codex 通过以下方式"看到"自己的先前工作:
- 文件系统中的修改文件
- git 历史记录
- 之前生成的代码
⚠️ 注意:Codex CLI 本身不会“自动重复同一条 prompt”。Loopback 通过状态文件
.codex/loopback.local.md 持久化上下文,再由 driver 脚本反复调用 codex exec 来实现循环。
每次迭代:
- Codex 接收相同的提示词
- 在任务上工作,修改文件
- 尝试完成
- 检查完成条件
- 如果未完成,进入下一次迭代
- 看到之前的工作,逐步改进
- 直到完成或达到最大迭代次数
命令
/loopback [OPTIONS]
在当前 Codex 会话中启动 Loopback 循环。
用法:
/loopback "重构缓存层" --max-iterations 20
/loopback "添加测试" --completion-promise "TESTS COMPLETE"
/loopback "修复认证 bug" --dry-run
选项:
--max-iterations <n>- 最大迭代次数(默认:无限)--completion-promise <text>- 完成承诺短语(当该短语出现时停止)--guide- 输出轻量参数说明(不启动循环)--wizard- 强制启用向导流程(默认已启用;有些环境会自动降级为非交互预检)--no-wizard- 跳过默认向导(直接按原始参数运行)--allow-infinite- 允许缺少停止契约(危险:可能无限运行;不推荐)--dry-run- 仅显示计划,不执行--no-run- 仅创建状态文件,不启动 driver(用于手动运行 wrapper/调试)--reuse-session- 复用同一个 Codex session(默认,更像 Ralph Loop 的“同一对话”迭代)--fresh-session- 每轮启动新 Codex session(更隔离,但更不“自引用对话”)
/cancel-loop
取消活动的 Loopback 循环。
用法:
/cancel-loop
注意:不要把取消命令当成 prompt 传给 /loopback(例如 /loopback /cancel-loop)。取消应使用 /cancel-loop,或手动删除 .codex/loopback.local.md。
What ships with it
11 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- commands/cancel-loop.md 875 B
- commands/loopback.md 1.7 KB
- README.md 5.1 KB
- README.zh-CN.md 5.4 KB
- scripts/codex-loopback-wrapper.sh 12 KB runs code
- scripts/extract_codex_json.py 2.2 KB runs code
- scripts/loopback-manager.py 12 KB runs code
- scripts/setup-loopback.sh 22 KB runs code
- scripts/test_extract_codex_json.py 1.3 KB runs code
- scripts/test_loopback_manager.py 3.6 KB runs code
- scripts/test_setup_loopback.py 2.7 KB runs code
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.
- 2d ago First seen · 225 lines · 107 tokens per session scan A 389b9cf7ea03
loopback is a skill published in the GitHub repository okwinds/miscellany (50 stars, last pushed 3mo ago), licensed MIT. It adds 107 tokens to every session and 2,263 once invoked, about $0.0005 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-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…