loop

An automated controller that repeatedly builds, verifies, reviews, and fixes an existing SpecClaw change.

In plain words
What is it for?
Finishing an already planned and built change by running fix-and-verify cycles until the configured checks pass.
Why use it?
It can continue through repeated checks and stop when all gates pass or when it detects problems such as no progress, regressions, or repeated oscillation.

Skill for Claude CodeCodex

Part of the specclaw plugin — 19 skills, 8 agents shipped together

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.

agentmods
npx agentmods add skills/chan4lk/specclaw/loop
Any agent
npx skills add chan4lk/specclaw --skill loop
Clone the repo
git clone --depth 1 https://github.com/chan4lk/specclaw

Made for: Claude Code, Codex.

Or install specclaw, the plugin that ships this one along with the rest of its 19 skills, 8 agents.

Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,468 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00090 $0.02468
Opus 5 $0.00045 $0.01234
Sonnet 5 $0.00018 $0.00494
Haiku 4.5 $0.00009 $0.00247

Measured 3d ago against content hash a34fdf7fcdfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 3d 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.

plugins/specclaw/skills/loop/SKILL.md · 168 lines

How it starts

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

specclaw loop

First, run specclaw-ensure-init .specclaw — idempotently creates .specclaw/ if it doesn't exist (silent if already initialized; auto-inits using the current directory's basename as the project name).

Autonomously drive the change to all-green. The controller (specclaw-loop) owns every mechanical decision — gate evaluation, signatures, caps, no-progress / regression / oscillation detection, the reward-hack guard, and state/log persistence. This skill only orchestrates the LLM steps: reflect, spawn a fix agent, commit. Follow the controller's JSON verbatim — do not second-guess a halt.

Step 0 — Validate prerequisites

The loop presumes /specclaw:plan and at least one /specclaw:build pass have already run — it remediates an existing implementation, it does not create one. Confirm the change is built:

specclaw-validate-change .specclaw <change> verify

If it fails (tasks not all complete / no build), tell the user to run /specclaw:build first and stop.

Read loop.enabled from .specclaw/config.yaml:

grep -A1 '^loop:' .specclaw/config.yaml

If loop.enabled is false, tell the user the autonomous loop is disabled and to run /specclaw:build and /specclaw:verify normally, then stop. Otherwise continue.

Step 1 — Init

specclaw-loop init .specclaw <change>

Seeds loop-state.json and loop-log.md (idempotent — never clobbers an existing state or log). Send a loop started notification:

🦞 **Loop Started**
**Change:** <change>
**Mode:** autonomous build→verify→review
**Caps:** max <loop.max_iterations> local iterations

Step 2 — Local loop

Repeat up to loop.max_iterations (default 5). The controller enforces the cap in Step 2c — do not track it yourself.

a. Evaluate gates:

specclaw-loop gates .specclaw <change>

Parse the JSON: {all_green, passing_count, gates:[{name,green,errors,files}]}. The four gates are tasks-complete, tests, verify, review.

Read the full file on GitHub · 168 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. 3d ago First seen · 168 lines · 90 tokens per session scan A a34fdf7fcdfd

Subscribe to this mod's changes

loop is a skill published in the GitHub repository chan4lk/specclaw (12 stars, last pushed 18d ago), licensed MIT. It adds 90 tokens to every session and 2,468 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.

Related

Other skills, from other repositories

agent-code-analyzer

Agent skill for code-analyzer - invoke with $agent-code-analyzer.

ruvnet/ruflo · 19 tokens

agent-collective-intelligence-coordinator

Agent skill for collective-intelligence-coordinator - invoke with $agent-collective-intelligence-coordinator.

ruvnet/ruflo · 29 tokens

agent-payments

Agent skill for payments - invoke with $agent-payments.

ruvnet/ruflo · 15 tokens

agui-dotnet-streaming-chat

Get started with the AG-UI .NET SDK: bootstrap and run your first streaming-chat app (client + server) with the AG-UI .NET NuGet packages (AGUI.Client, AGUI.Server, AGUI.Formatting, AGUI.Abstractions). USE FOR: which packages to install and how to wire them; constructing an AGUIChatClient against an endpoint and…

ag-ui-protocol/ag-ui · 223 tokens

agui-dotnet-sample-step

Add a GettingStarted sample Step (a Server/Client pair) to the AG-UI .NET SDK that demonstrates one protocol feature the way we want users to write it. USE FOR: adding a new samples/GettingStarted/StepNN Server+Client pair, wiring it into AGUI.slnx and the integration-test project, giving it a deterministic…

ag-ui-protocol/ag-ui · 168 tokens

agui-dotnet-shared-state

Share structured, evolving state between an AG-UI agent and its client with the AG-UI .NET SDK — the client seeds state on the request, the server reads it, mutates it, and streams the updated state back as snapshots or deltas alongside the chat. USE FOR: sending initial/working state from the client via…

ag-ui-protocol/ag-ui · 215 tokens