debug

debug is a command for Claude Code from dwarvesf/dwarves-kit. It costs 102 tokens per session (2,753 once invoked), scanned A, original, MIT.

A structured debugging process that records symptoms, evidence, possible causes, attempted fixes, and the final resolution in a file. It requires the actual root cause to be identified before code is changed.

In plain words
What is it for?
Use it to investigate bugs, regressions, or failing tests through evidence gathering, eliminated hypotheses, controlled fix attempts, and verification.
Why use it?
It prevents guesswork and symptom-only patches from replacing an investigation of what really caused the defect or test failure.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the kit plugin — 14 skills, 39 commands, 31 agents, 10 hooks shipped together

Good fit Use it to investigate bugs, regressions, or failing tests through evidence gathering, eliminated hypotheses, controlled fix attempts, and verification.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/dwarvesf/dwarves-kit/debug
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/dwarvesf/dwarves-kit

Made for: Claude Code.

Or install kit, the plugin that ships this one along with the rest of its 14 skills, 39 commands, 31 agents, 10 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 debug

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/dwarvesf/dwarves-kit/debug"><img src="https://agentmods.dev/badge/commands/dwarvesf/dwarves-kit/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,753 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.00102 $0.02753
Opus 5.5 $0.00041 $0.01101
Sonnet 5.5 $0.00020 $0.00551
Haiku 4.5 $0.00010 $0.00275

Measured 14d ago against content hash f737d00a31b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 14d 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/debug.md · 141 lines

How it starts

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

You are debugging a defect, regression, or test failure. You are not here to guess. Random fixes waste time and create new bugs.

Scope and triggers

In a kit-adopted repo this replaces superpowers:systematic-debugging: a superset of it, adding the Phase 0 feedback loop, an on-disk ledger, and the guess-fix guard.

The Iron Law

NO FIX WITHOUT A RECORDED ROOT CAUSE.

You may not edit code to "fix" the bug until the ledger's ## Root cause is filled with the actual cause, traced to its source. A symptom patch is a failure, not a fix.

Before you start: open the ledger

Pick a short <slug> for this bug, sanitized to [a-z0-9-]+ (lowercase, digits, hyphens only; no spaces, no /, no .). Reject anything else; never let a slug contain a path separator.

Write .claude/debug/<slug>.md from this template, and append to it before each action, not after, so a context reset shows what you were about to do:

## Symptoms
(immutable: exactly what was reported, the error text, the failing test name)

## Root cause

## Evidence
(append: timestamp / what you checked / what you found / what it implies)

## Eliminated
(append: each hypothesis you falsified + the evidence that killed it)

## Fix attempts
(append: a count; the 3-fix wall reads this)

## Resolution
(the fix + the verification result)

Leave ## Root cause blank until you have actually found it. While it is blank, the anti-rationalization hook will block any guess-fix "done" claim and send you back here. That is intended.

Escaped-defect marker. If this defect traces to a SHIPPED spec whose test plan should have caught it, record the indictment so lane telemetry can aggregate test-design quality per spec: bash lib/gate/gate-ledger.sh action <slug> "escaped-from=<spec-slug>". Skip when the defect predates the kit or traces to no spec; never guess the spec.

Phase 0: Build a feedback loop

This is most of the skill. A fast, deterministic, agent-runnable pass/fail signal for the bug is what every later phase consumes: reproduction, bisection, hypothesis tests, and the Phase-4 failing test all just re-run it. Spend disproportionate effort here; with the loop, the bug is mostly found.

Read the full file on GitHub · 141 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. 14d ago Changed · +12 lines f737d00a31b3
  2. 20d ago Changed · +10 tokens per session 8b153ffc547e
  3. 27d ago Changed · +4 lines · -39 tokens per session 4facf6c07b4c
  4. 1mo ago Changed · +105 tokens per session ad7f13ac388a
  5. 1mo ago Changed cb89c0d50587
  6. 1mo ago Changed d5de2fcb2377
  7. 1mo ago First seen · 125 lines · 26 tokens per session scan A ad0c29013378

Subscribe to this mod's changes

debug is a command published in the GitHub repository dwarvesf/dwarves-kit (11 stars, last pushed yesterday), licensed MIT. It adds 102 tokens to every session and 2,753 once invoked, about $0.0004 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-30.