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 skills add cjhyy/codeshell --skill loop-modegit clone --depth 1 https://github.com/cjhyy/codeshellWrote 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.
[](https://agentmods.dev/skills/cjhyy/codeshell/loop-mode)<a href="https://agentmods.dev/skills/cjhyy/codeshell/loop-mode"><img src="https://agentmods.dev/badge/skills/cjhyy/codeshell/loop-mode/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.
<a href="https://agentmods.dev/skills/cjhyy/codeshell/loop-mode"><img src="https://agentmods.dev/badge/skills/cjhyy/codeshell/loop-mode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00080 | $0.01248 |
| Opus 5.5 | $0.00032 | $0.00499 |
| Sonnet 5.5 | $0.00016 | $0.00250 |
| Haiku 4.5 | $0.00008 | $0.00125 |
Grade A, and why
loop-mode 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 6d 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 — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Loop Mode
/loop 是独立的长时循环,不是 Goal 的别名。不得创建、更新、清除或借用 CodeShell Goal。循环靠“持久状态 + 有界轮次 + 下一次唤醒”续跑,不靠一个无限会话。
唯一入口
/loop <objective>:启动或继续一个 loop,并执行一个有界轮次。objective 含“夜间、无人、unattended”时使用 unattended;否则 attended。无人目标未给截止时间或最大轮数时,启动前只问这一个必要问题。- 裸
/loop:只读汇报当前 loop;没有 loop 时给出一句用法。 - loop 启动后,用户在同一 Session 直接说“暂停、继续、停止、看状态、审查结果”。将这些自然语言解析为对当前 loop 的控制,不要要求用户记子命令。
- 如果有多个非终态 loop 且指令对象不唯一,列出候选请用户选择,不要猜。
权威账本
先求主仓库绝对路径(git rev-parse --show-toplevel)。所有控制文件只在 <main-root>/.loop/<slug>/:
STATE.json:当前快照,单写者是协调者。RUNS.jsonl:追加式事件。ORCHESTRATION.md:角色、阶段、权限、闸门。PLAN.md、LESSONS.md、HANDOFF.md:计划、精炼经验、收尾。rounds/rNNN/:本轮worker.md、review.md、validation.md回执。
优先用本 skill 的状态脚本,不要手改 JSON:
node .code-shell/skills/loop-mode/scripts/loop-state.mjs init --root <main-root> --slug <slug> --objective <objective> --attendance attended|unattended --max-rounds <N>
node .code-shell/skills/loop-mode/scripts/loop-state.mjs transition --root <main-root> --slug <slug> --status ready|running|paused|waiting_review|completed|stopped|blocked --reason <text>
node .code-shell/skills/loop-mode/scripts/loop-state.mjs event --root <main-root> --slug <slug> --type <type> --message <text>
node .code-shell/skills/loop-mode/scripts/loop-state.mjs status --root <main-root> --slug <slug>
启动
- 从 objective 生成短 slug(小写英数加连字符),用脚本
init。 - 已有
ORCHESTRATION.md就校验后沿用;否则用loop-orchestration的默认模板直接生成。attended 的重大角色/范围分歧再问,unattended 取最保守可行值。 - 建
loop/<slug>/candidate候选分支,只将通过审查的提案合入它。永不自动 push 或合入 main。 - 一次
/loop只运行一个有界轮次。若要长时续跑,在轮次收尾创建或更新 heartbeat/automation,下次读STATE.json再续。
单轮状态机
ready -> running -> validating -> reviewing -> ready|waiting_review|completed|blocked。
- 开始前检查
status、deadline、maxRounds 和用户待批项。paused/stopped/completed/blocked不得派发。 - 从 candidate 建本轮分支
loop/<slug>/rNNN和独立 worktree。不复用上轮 worktree。 - 派 executor 时给完整 objective、绝对账本路径、本轮验收、worktree 和分支。executor 只改代码并 commit,不写共享账本。
- 协调者记
worker.md并跑定向验证,记validation.md。 - 派与 executor 不同的 reviewer 审 diff/测试,记
review.md。高风险变更不能 self-review。 - 验证和审查都通过才可合入 candidate;否则保留提案分支并进入下轮修复或
waiting_review。 - 协调者原子更新
STATE.json,追加事件,精炼LESSONS.md,然后判断闸门。
What ships with it
1 file 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.
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.
- 6d ago First seen · 65 lines · 80 tokens per session scan A d7f8ff42eec6
loop-mode is a skill published in the GitHub repository cjhyy/codeshell (65 stars, last pushed 2d ago), licensed MIT. It adds 80 tokens to every session and 1,248 once invoked, about $0.0003 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-10-14.
Other skills, from other repositories
merge-batch
Prepare and merge an owner-selected PR batch with contributor credit and exact-candidate admission. Use for a pasted PR list; combined focused validation is diagnostic, and every actual landing still requires its applicable checks and authorization.
prowler-commit
Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.
gh-auth-isolation
Safely manage multiple GitHub identities (EMU + personal) in agent workflows.
comet-github
A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.
github-skill
Work with GitHub via the gh CLI — clone repositories, create/list/merge pull requests, create/list issues, and run any other gh command (API calls, workflow runs, releases, repo administration). List operations return parsed JSON.
release-helper
Ensures configuration and code changes are released correctly. Use PROACTIVELY whenever you edit config.json, change any setting, or fix a configuration bug in this project, so the change reaches production.