swarm-debug

swarm-debug is a skill for Claude Code, Codex from AnmarHani/SwarmVault. It costs 52 tokens per session (511 once invoked), scanned A, original, MIT.

A step-by-step debugging method that finds and records the cause of a software problem before changing the code.

In plain words
What is it for?
Use it for bugs, failed tests, regressions, crashes, or other unexplained behaviour, including reproducing the issue, checking evidence, testing possible causes, and adding a regression test.
Why use it?
It prevents guesswork and patches that hide symptoms while leaving the underlying bug in place.

Skill for Claude CodeCodex

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/anmarhani/swarmvault/swarm-debug
Any agent
npx skills add AnmarHani/SwarmVault --skill swarm-debug
Clone the repo
git clone --depth 1 https://github.com/AnmarHani/SwarmVault

Made for: Claude Code, Codex.

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-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/anmarhani/swarmvault/swarm-debug.svg)](https://agentmods.dev/skills/anmarhani/swarmvault/swarm-debug)
Your own site
<a href="https://agentmods.dev/skills/anmarhani/swarmvault/swarm-debug"><img src="https://agentmods.dev/badge/skills/anmarhani/swarmvault/swarm-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 511 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.00511
Opus 5 $0.00026 $0.00255
Sonnet 5 $0.00010 $0.00102
Haiku 4.5 $0.00005 $0.00051

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

Security

Grade A, and why

swarm-debug 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.

skills/swarm-debug/SKILL.md · 41 lines

What it actually says

swarm-debug — systematic debugging

No fix without a reproduced cause. Shotgun patching is how the same bug costs twice.

The loop

  1. Reproduce — a command/test that shows the bug, or record explicitly why reproduction is impossible. This is the entry gate for everything below.
  2. Evidence — read the FULL error, stack, and surrounding logs (not the first line); note what changed recently (git log, new deps, config).
  3. Locate — binary-search the causal chain: which layer last had correct data? Instrument with targeted prints/asserts if needed; remove them after.
  4. Hypothesize — ranked list, cheapest-to-test first. State each as a falsifiable claim ("the cache returns stale X when Y").
  5. Verify — one targeted experiment per hypothesis. Evidence kills or confirms; opinion does neither.
  6. Fix the root cause — not the symptom, when the root is reachable. If you must ship a symptom patch, say so in the code-note and open a ticket for the root.
  7. Regression test — must fail on the pre-fix code, pass on the fix. No test, no fix.
  8. Record (J1) — non-trivial diagnosis → memory note (the footgun, compact, ≤ 15 lines) + code-note link on the affected file, so no future session pays for this twice. Check the vault FIRST next time: swarmvault.py query --search "<symptom>" — someone may already have paid.

Hard rules

  • Three dead hypotheses → stop, step back, re-examine assumptions — including the spec and design ("is the requirement itself contradictory?").
  • A diagnosis that reveals a spec/design gap → route it to the question queue / SRS change management (swarm-spec), don't silently patch around it.
  • Performance bugs: measure before and after; a fix without numbers is a guess.

Influences: superpowers systematic-debugging; Pocock's diagnosing-bugs; Jeffallan's debugging-wizard — see CREDITS.md.

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 · 41 lines · 52 tokens per session scan A 739a2f4fdb4f

Subscribe to this mod's changes

swarm-debug is a skill published in the GitHub repository AnmarHani/SwarmVault (5 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 511 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.