loop

loop is a command for Claude Code from skullninja/coco-workflow. It costs 28 tokens per session (6,135 once invoked), scanned A, original, MIT.

An autonomous execution loop repeatedly works through the available tasks in an epic. It follows a test-first development cycle and can use parallel agents, while stopping after configured limits or repeated lack of progress.

In plain words
What is it for?
Use it to run an epic to completion, process tasks in dependency order, execute work in parallel when enabled, create pull requests through the configured workflow, and view periodic progress dashboards.
Why use it?
It reduces the need to start each task manually. Checks before and during the loop help prevent invalid dependencies, configuration problems, and stalled execution from going unnoticed.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions Claude Code.

Part of the coco plugin — 6 skills, 14 commands, 4 agents, 3 hooks shipped together

Good fit Use it to run an epic to completion, process tasks in dependency order, execute work in parallel when enabled, create pull requests through the configured workflow, and view periodic progress dashboards.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/skullninja/coco-workflow/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/skullninja/coco-workflow

Made for: Claude Code.

Or install coco, the plugin that ships this one along with the rest of its 6 skills, 14 commands, 4 agents, 3 hooks.

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 loop

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/skullninja/coco-workflow/loop"><img src="https://agentmods.dev/badge/commands/skullninja/coco-workflow/loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,135 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.00028 $0.06135
Opus 5.5 $0.00011 $0.02454
Sonnet 5.5 $0.00006 $0.01227
Haiku 4.5 $0.00003 $0.00613

Measured 3d ago against content hash d77f6818c8d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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.

commands/loop.md · 673 lines

How it starts

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

User Input

$ARGUMENTS

$ARGUMENTS is an epic ID or feature name. If empty, use the most recent open epic.

Setup

  1. Read .coco/config.yaml for project configuration (including pr and loop sections).

  2. Determine the target epic from $ARGUMENTS or most recent open epic.

  3. Read loop config. Defaults when a key is absent: max_iterations: 20, no_progress_threshold: 3, pause_on_error: false, dashboard_every: 5, parallel.enabled: true, parallel.max_agents: 3, parallel.max_agent_attempts: 2.

    A project initialized before these defaults changed still carries the old values in its own .coco/config.yaml, which is read in preference to any default here. If pause_on_error is true or parallel.enabled is false in this project, say so in the opening ledger line -- the user may not know their config predates the change, and /coco:setup migrate reconciles it.

Pre-Loop Gate

Verify the epic is ready for autonomous execution:

coco-tracker epic-status {epic-id}

First, reconcile. Any previous run that ended without finishing -- usage limit, crash, Ctrl-C, context exhaustion -- left its claimed task in_progress. ready selects only pending, so that task is unstartable and the epic can never complete, while the loop reports "all remaining tasks are blocked" with nothing actually blocked.

coco-tracker reconcile

Exit 0 means consistent, carry on. Exit 1 means it found something and printed it. Stranded tasks are safe to reset on entry -- by definition nothing is working on them, because the run that claimed them is over:

coco-tracker reconcile --fix

An epic closed over unfinished tasks, or a task pointing at a missing epic, needs a decision rather than a reset. --fix leaves those alone and still exits 1. Stop and report them.

Then check ALL before entering the loop:

  1. Tracker epic exists and has tasks
  2. Dependencies are set -- at least one task is unblocked (ready returns a result)
  3. If an issue tracker is configured AND issue_tracker.per_task_issues is not false: every task has issue_key in metadata. A project that uses feature-level issues only sets per_task_issues: false and this check is skipped -- it previously blocked such a project outright, forcing the creation of per-task issues its own working agreement refused
  4. If pr.enabled: verify on a feature/* branch
  5. If pr.enabled: verify remote origin is configured (git remote -v)
  6. If pr.enabled: verify gh CLI is available

Read the full file on GitHub · 673 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 Changed · +210 lines d77f6818c8d8
  2. 1mo ago First seen · 463 lines · 28 tokens per session scan A eb242b7ab444

Subscribe to this mod's changes

loop is a command published in the GitHub repository skullninja/coco-workflow (8 stars, last pushed yesterday), licensed MIT. It adds 28 tokens to every session and 6,135 once invoked, about $0.0001 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-31.