swarm

swarm is a command for coding agents from naimkatiman/continuous-improvement. It costs 52 tokens per session (1,432 once invoked), scanned A, original, MIT.

A command that gives several isolated coding agents the same task and contract test, then compares their results. An isolated worktree is a separate copy of the code used to avoid agents interfering with one another.

In plain words
What is it for?
Use it when you have multiple candidate implementations and a shared test or other measurable definition of success.
Why use it?
It provides evidence for choosing between providers, refactors, library upgrades, or designs instead of discovering compatibility problems only after deployment.

Command

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 commands/naimkatiman/continuous-improvement/swarm
Clone the repo
git clone --depth 1 https://github.com/naimkatiman/continuous-improvement

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 swarm

README.md
[![agentmods](https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/swarm.svg)](https://agentmods.dev/commands/naimkatiman/continuous-improvement/swarm)
Your own site
<a href="https://agentmods.dev/commands/naimkatiman/continuous-improvement/swarm"><img src="https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/swarm.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 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,432 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.00052 $0.01432
Opus 5 $0.00026 $0.00716
Sonnet 5 $0.00010 $0.00286
Haiku 4.5 $0.00005 $0.00143

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

Security

Grade A, and why

swarm 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 4d 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/swarm.md · 102 lines

How it starts

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

/swarm

Parallel-agent fan-out for evidence-based decision-making. Driven by the user's session report: provider-swap epics (Trading Economics → Forex Factory, ETF → CFD, Finnhub → R StocksTrader, Stooq removal) each took multiple sessions and hit fallback bugs in production because alternatives were not vetted upfront.

This command does not replace the superpowers:dispatching-parallel-agents skill — it builds on top of it with a contract-pinned, worktree-isolated, comparison-report shape.

When to use

The right trigger is "I need to pick between N options and I have a contract test that defines what 'works' means." Examples:

  • Evaluating N candidate providers behind a shared interface (the report's recurring need)
  • Trying N candidate refactors against the same test suite
  • Prototyping N candidate library upgrades and measuring which breaks the fewest tests
  • Generating N candidate UI designs that all pass the same accessibility + performance budget

Do NOT use this command for:

  • Open-ended exploration without a contract — use superpowers:brainstorming instead
  • Single-implementation tasks — use the superpowers:dispatching-parallel-agents skill directly
  • Tasks where the candidates have different contracts — that is N separate jobs, not a swarm

Preconditions

  1. A shared contract test exists at a path the agents can reference (e.g. tests/contracts/<name>.test.ts).
  2. Candidates are listed up front (3-6 typical; 8 max). Letting agents propose candidates is allowed but the list freezes before fan-out.
  3. The base branch is clean.
  4. Each candidate has a clear evaluation rubric: PASS/FAIL per contract test, plus per-candidate measurements (latency, coverage, cost, free-tier limits, etc. — domain-specific).

Behavior

  1. Plan — restate the objective, list candidates, confirm contract test path. If unclear, halt and ask.
  2. Bootstrap — for each candidate, create an isolated worktree off origin/main: git worktree add -b swarm/<objective>-<candidate> ../<candidate>. Pin the base SHA in the swarm log.
  3. Fan out — dispatch one fresh sub-agent per candidate via the Agent tool, in a single message (parallel, not serial). Each agent receives the contract test path, the candidate name, the rubric, and the worktree path.
  4. Run — each agent implements the candidate behind the shared interface, runs the contract test against it, captures measurements per the rubric, and writes findings to reports/<objective>/<candidate>.md.
  5. Synthesize — when all agents complete, this command produces a decision matrix (candidates × rubric metrics) and recommends a winner with citations to the per-candidate reports.
  6. Stop — does NOT merge any candidate's worktree. Does NOT modify production. Output is evidence; the operator decides which candidate to advance.

Read the full file on GitHub · 102 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. 4d ago First seen · 102 lines · 52 tokens per session scan A c93ded2dada9

Subscribe to this mod's changes

swarm is a command published in the GitHub repository naimkatiman/continuous-improvement (7 stars, last pushed 9d ago), licensed MIT. It adds 52 tokens to every session and 1,432 once invoked, about $0.0003 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-31.