loopback

loopback is a skill for Claude Code, Codex from okwinds/miscellany. It costs 107 tokens per session (2,263 once invoked), scanned A, original, MIT.

An iterative coding workflow that repeatedly sends the same task to Codex, while preserving progress in files and Git history. It stops when a stated completion signal, iteration limit, or cancellation condition is reached.

In plain words
What is it for?
Use it for multi-step features, repeated bug fixing, self-correction, and gradual improvement of existing code.
Why use it?
It reduces the need to manually restart Codex for complex work that needs several rounds of implementation and correction. A guide mode and a dry run help check the task settings before starting.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; runs codex exec; mentions Codex.

Good fit Use it for multi-step features, repeated bug fixing, self-correction, and gradual improvement of existing code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okwinds/miscellany/loopback
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.

Any agent
npx skills add okwinds/miscellany --skill loopback
Clone the repo
git clone --depth 1 https://github.com/okwinds/miscellany

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for loopback

README.md
[![agentmods](https://agentmods.dev/badge/skills/okwinds/miscellany/loopback/github.svg)](https://agentmods.dev/skills/okwinds/miscellany/loopback)
Your own site
<a href="https://agentmods.dev/skills/okwinds/miscellany/loopback"><img src="https://agentmods.dev/badge/skills/okwinds/miscellany/loopback/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for loopback

Your own site · 80×15
<a href="https://agentmods.dev/skills/okwinds/miscellany/loopback"><img src="https://agentmods.dev/badge/skills/okwinds/miscellany/loopback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,263 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00107 $0.02263
Opus 5.5 $0.00043 $0.00905
Sonnet 5.5 $0.00021 $0.00453
Haiku 4.5 $0.00011 $0.00226

Measured 2mo ago against content hash 389b9cf7ea03, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/codex-loopback-wrapper.sh, scripts/extract_codex_json.py, scripts/loopback-manager.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

agent/skills/loopback/SKILL.md · 225 lines

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 迭代开发循环

快速开始(推荐)

  1. 直接启动(默认会进入“向导模式”)
/loopback "修复 X。完成后输出 <promise>DONE</promise>。" --completion-promise "DONE" --max-iterations 10

说明:

  • 如果当前环境支持交互式输入,/loopback 会默认进入向导:先展示全局步骤,再一步步帮你完善参数与契约
  • 如果当前环境不支持交互式输入,/loopback 会输出步骤概览,并在缺少关键契约时直接失败(避免跑飞)
  • 如需跳过向导:加 --no-wizard
  1. 不确定怎么传参:先看参数说明(不会创建状态文件、不会启动循环)
/loopback --guide
  1. 参数看起来没问题:先用 --dry-run 预演(不会创建状态文件、不会启动循环)
/loopback "修复 X。完成后输出 <promise>DONE</promise>。" --completion-promise "DONE" --max-iterations 10 --dry-run
  1. 正式启动
/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 来实现循环。

每次迭代:

  1. Codex 接收相同的提示词
  2. 在任务上工作,修改文件
  3. 尝试完成
  4. 检查完成条件
  5. 如果未完成,进入下一次迭代
  6. 看到之前的工作,逐步改进
  7. 直到完成或达到最大迭代次数

命令

/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。

Read the full file on GitHub · 225 lines

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. 2mo ago First seen · 225 lines · 107 tokens per session scan A 389b9cf7ea03

Subscribe to this mod's changes

loopback is a skill published in the GitHub repository okwinds/miscellany (50 stars, last pushed 5mo ago), licensed MIT. It adds 107 tokens to every session and 2,263 once invoked, about $0.0004 per session on Opus 5.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.

Related

loopback compared with skills from other repositories

loopback next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
loopbackokwinds/miscellanySkill505mo agoMITA107Claude Code, Codex
imagegenopenai/codexSkill133kyesterdayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill99kyesterdayApache-2.0A19Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k4d agoMITA200Claude Code, Codex
systematic-debuggingobra/superpowersSkill313k3d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143kyesterdayMITA95Claude Code
next-partial-prefetching-adoptionvercel/next.jsSkill143kyesterdayMITA103Claude Code