spec-loop

spec-loop is a command for Claude Code from Habib0x0/spec-driven-plugin. It costs 11 tokens per session (1,532 once invoked), scanned B, original, MIT.

A command that repeatedly selects and implements the next highest-priority task from a feature specification until the work is finished or a limit is reached.

In plain words
What is it for?
Use it to execute spec tasks in sequence, track recent progress, limit iterations, and optionally run a command after clean completion.
Why use it?
It turns a task list into a continuing implementation cycle and reduces the need to restart the process for each task.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the spec-driven plugin — 1 skill, 18 commands, 11 agents shipped together

Good fit Use it to execute spec tasks in sequence, track recent progress, limit iterations, and optionally run a command after clean completion.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Habib0x0/spec-driven-plugin
Claude Code
/plugin install spec-driven

Made for: Claude Code.

Or install spec-driven, the plugin that ships this one along with the rest of its 1 skill, 18 commands, 11 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 spec-loop

README.md
[![agentmods](https://agentmods.dev/badge/commands/habib0x0/spec-driven-plugin/spec-loop/github.svg)](https://agentmods.dev/commands/habib0x0/spec-driven-plugin/spec-loop)
Your own site
<a href="https://agentmods.dev/commands/habib0x0/spec-driven-plugin/spec-loop"><img src="https://agentmods.dev/badge/commands/habib0x0/spec-driven-plugin/spec-loop/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 spec-loop

Your own site · 80×15
<a href="https://agentmods.dev/commands/habib0x0/spec-driven-plugin/spec-loop"><img src="https://agentmods.dev/badge/commands/habib0x0/spec-driven-plugin/spec-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 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,532 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00011 $0.01532
Opus 5.5 $0.00004 $0.00613
Sonnet 5.5 $0.00002 $0.00306
Haiku 4.5 $0.00001 $0.00153

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

Security

Grade B, and why

spec-loop scanned grade B with 1 finding 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/specs/my-feature/progress.md | tail -20
commands/spec-loop.md · 180 lines

How it starts

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

/spec-loop Command

Run spec-driven implementation in a loop. Each iteration picks the next highest-priority task, implements it, and continues until all tasks are done or max iterations reached.

Usage

Run the script directly from your project root:

${CLAUDE_PLUGIN_ROOT}/scripts/spec-loop.sh [--spec-name <name>] [--max-iterations <n>] [--progress-tail <n>] [--on-complete <command>]

Or via Bash tool if invoked within Claude Code:

bash ${CLAUDE_PLUGIN_ROOT}/scripts/spec-loop.sh --spec-name <name>

Arguments

  • --spec-name <name> - Which spec to execute against. Auto-detected if only one spec exists in .claude/specs/.
  • --max-iterations <n> - Maximum number of iterations before stopping. Default: 50.
  • --progress-tail <n> - Number of recent progress entries to include in prompt. Default: 20.
  • --on-complete <command> - Shell command to run after clean completion. Only fires when <promise>COMPLETE</promise> is detected, not on max-iterations exit. Recommended: "bash scripts/spec-accept.sh --spec-name <name>".

What It Does

  1. Reads your spec files fresh each iteration
  2. Runs Claude to implement one feature per iteration
  3. Runs verification gates on completed tasks
  4. Checks output for <promise>COMPLETE</promise> to detect completion
  5. Stops when all tasks are done or max iterations reached

Recommended hook — run UAT automatically on clean completion:

bash scripts/spec-loop.sh --spec-name <name> \
  --on-complete "bash scripts/spec-accept.sh --spec-name <name>"

If you want docs too:

bash scripts/spec-loop.sh --spec-name <name> \
  --on-complete "bash scripts/spec-accept.sh --spec-name <name> && bash scripts/spec-docs.sh --spec-name <name>"

Post-completion (release notes, retro) should be run manually after reviewing acceptance results:

bash scripts/spec-accept.sh --spec-name <name>    # UAT gate
bash scripts/spec-docs.sh --spec-name <name>      # Docs
bash scripts/spec-release.sh --spec-name <name>   # Release notes
bash scripts/spec-retro.sh --spec-name <name>     # Retrospective

Read the full file on GitHub · 180 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. 1mo ago First seen · 180 lines · 11 tokens per session scan B 8a69b6549bd4

Subscribe to this mod's changes

spec-loop is a command published in the GitHub repository Habib0x0/spec-driven-plugin (10 stars, last pushed 5mo ago), licensed MIT. It adds 11 tokens to every session and 1,532 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.