iteration-loop

iteration-loop is a command for Claude Code from btspoony/mstar-harness. It costs 83 tokens per session (1,934 once invoked), scanned A, original, MIT.

An automated workflow command that takes a software task from choosing a direction through execution, closure, opening a pull request, and preparing it for merging. A pull request is a proposed set of code changes for review before it is merged.

In plain words
What is it for?
Use it for end-to-end coding iterations with an optional direction and size from S to XL. The selected size limits the number of business plans included in the iteration.
Why use it?
It removes much of the manual coordination between planning, implementation, review, quality checks, and preparing the change for merge. It can also resume an iteration that has already had its direction set.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: agent in frontmatter.

Part of the morning-star-harness plugin — 23 skills, 5 commands, 14 agents shipped together

Good fit Use it for end-to-end coding iterations with an optional direction and size…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/btspoony/mstar-harness/iteration-loop
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.

Clone the repo
git clone --depth 1 https://github.com/btspoony/mstar-harness

Made for: Claude Code.

Or install morning-star-harness, the plugin that ships this one along with the rest of its 23 skills, 5 commands, 14 agents.

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 iteration-loop

README.md
[![agentmods](https://agentmods.dev/badge/commands/btspoony/mstar-harness/iteration-loop.svg)](https://agentmods.dev/commands/btspoony/mstar-harness/iteration-loop)
Your own site
<a href="https://agentmods.dev/commands/btspoony/mstar-harness/iteration-loop"><img src="https://agentmods.dev/badge/commands/btspoony/mstar-harness/iteration-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,934 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.00083 $0.01934
Opus 5 $0.00042 $0.00967
Sonnet 5 $0.00017 $0.00387
Haiku 4.5 $0.00008 $0.00193

Measured 7d ago against content hash 6b580c6f53c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

iteration-loop 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 7d 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/iteration-loop.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Iteration Loop

Run a full Morning Star iteration with minimal human intervention. Done = Phase 5 §5.5 exit checklist 全 [x] — not Phase 1 lock, not Phase 3 close, not Phase 4 PR open.

vs other commands:

| Command | Scope | | iteration-start | Phase 1 (grill-me with user) → auto-continue Phase 2→5(pause 止于 Phase 1) | | iteration-drive | Phase 2→5 re-entry / resume on an already locked iteration | | iteration-loop | Phase 1→5 end-to-end; autonomous direction lock |

Phase gate SSOT → mstar-iteration §1–§5. This command is a consumer; it does not redefine skill semantics.

Args(最多 2 个)

/iteration-loop [direction] [scale]
Arg Meaning Default
direction Iteration direction / feedback constraint (free text) Code-first research → auto-lock recommended
scale S | M | L | XL M

Scale budget(写入 compass;约束 业务 plan 数量)→ mstar-iteration §1.2 + references/autonomous-direction-lock.md

  • S → 1 business plan
  • M → 2–3 business plans
  • L → 3–4 business plans(上限 4)
  • XL>4 business plans(5+;适合大范围 autonomous 迭代)

HARD:budget 只计实际业务交付 plan;不计 harness 流程(Review 链、QC/QA、compound、close、PR、merge-ready、compass/status.json 维护等)。流程门禁仍须执行,但不占 S/M/L/XL 名额,也不得写成独立 process plan 来“凑数/占坑”。

Parse: if the last token is exactly S/M/L/XL (case-insensitive), treat it as scale; remaining text is direction. If only one token and it is S/M/L/XL, that is scale with empty direction.

Phase flow(禁止跳步)

Phase 1: Autonomous start → Phase 2: Autonomous Execute → Phase 3: close → Phase 4: PR → Phase 5: merge-ready。Transition gates(HARD)→ mstar-iteration Phase transition gates table。

Continuous execution(HARD — Phase 1 lock 后至 Phase 5 exit)

Execute mstar-iteration §2.6(Continuous execution SSOT)+ mstar-iteration/references/command-shared-invariants.md STOP list(branch metadata 缺失 / Blocked / 用户显式打断 — 不在本命令重复)。Loop 特有 STOP:branch metadata 按 mstar-iteration autonomous resolve 顺序仍无法确定(禁止静默默认 main/master);代码/roadmap 无可信候选且无 direction 参数。Turn 收束纪律:最后一条内容必须是 in-flight 动作(invoke 已发出或下一 Assignment),不得以确认问句结尾。

Read the full file on GitHub · 100 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. 7d ago First seen · 100 lines · 83 tokens per session scan A 6b580c6f53c1

Subscribe to this mod's changes

iteration-loop is a command published in the GitHub repository btspoony/mstar-harness (58 stars, last pushed today), licensed MIT. It adds 83 tokens to every session and 1,934 once invoked, about $0.0004 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.