debug

debug is a skill for Claude Code from mehrad-dm/mastermind. It costs 63 tokens per session (1,502 once invoked), scanned A, original, MIT.

A disciplined method for investigating bugs that are unclear, recurring, intermittent, or difficult to reproduce.

In plain words
What is it for?
Use it to debug crashes, flaky tests, unexplained behavior, and bugs that return after earlier fixes.
Why use it?
It requires a repeatable failing check before theories or fixes, helping distinguish the real cause from a temporary symptom.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the mastermind plugin — 32 skills, 4 agents, 1 hook shipped together

Good fit Use it to debug crashes, flaky tests, unexplained behavior, and bugs that return after earlier fixes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mehrad-dm/mastermind/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.

Any agent
npx skills add mehrad-dm/mastermind --skill debug
Clone the repo
git clone --depth 1 https://github.com/mehrad-dm/mastermind

Made for: Claude Code.

Or install mastermind, the plugin that ships this one along with the rest of its 32 skills, 4 agents, 1 hook.

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/skills/mehrad-dm/mastermind/debug/github.svg)](https://agentmods.dev/skills/mehrad-dm/mastermind/debug)
Your own site
<a href="https://agentmods.dev/skills/mehrad-dm/mastermind/debug"><img src="https://agentmods.dev/badge/skills/mehrad-dm/mastermind/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/skills/mehrad-dm/mastermind/debug"><img src="https://agentmods.dev/badge/skills/mehrad-dm/mastermind/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,502 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 70
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00063 $0.01502
Opus 5.5 $0.00025 $0.00601
Sonnet 5.5 $0.00013 $0.00300
Haiku 4.5 $0.00006 $0.00150

Measured 15d ago against content hash d60a63ba4b3e, 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 1 finding 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 15d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

cheapest rung that gives you that: a failing test · a `curl` · a CLI invocation with a saved
skills/debug/SKILL.md · 91 lines

How it starts

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

MasterMind: Debug

Hard bugs are lost by guessing and patching symptoms. This is the disciplined loop that finds the actual cause. Bug: $ARGUMENTS. Grounded in ~/.mastermind/engineering/core/rigor.md and ~/.mastermind/engineering/core/agent-loop.md.

The cardinal rule: understand the mechanism before you change a line. A fix you can't explain is a coincidence, not a fix.

The six phases

  1. Build the feedback loop. This phase is the skill: the rest is mechanical once it exists.

    You need one command you have already run at least once, whose invocation and output you can paste. It has to be red-capable (it fails right now, because of this bug), deterministic, fast enough to run repeatedly, and runnable by you without a human driving a UI. Reach for the cheapest rung that gives you that: a failing test · a curl · a CLI invocation with a saved snapshot · a headless browser script · a replayed captured request · a throwaway harness · a property/fuzz loop · a bisection harness · a differential run against a known-good version.

    No red-capable command, no phase 2. If you catch yourself reading code to build a theory before that command exists, stop and go build it, theorising over a bug you cannot trigger is the single most expensive habit in debugging. This same command is your definition of "fixed." If it still won't reproduce after honest effort: stop: a bug you can't reproduce earns a fix only once it does, and never claim it's fixed. Ship instrumentation instead (logging/assertions at the suspect boundaries) so the next occurrence is diagnosable, state explicitly what you ruled out and how, and hand back with that evidence. "I couldn't reproduce it" is the honest answer, and usually a faster route to the real cause than three speculative patches.

  2. Localize. Bisect the space: git bisect across commits, binary-search the code path, add instrumentation/logs at boundaries. Read the actual code and the actual data/state at the failure point rather than theorizing from memory. Narrow to the smallest region that still reproduces.

Read the full file on GitHub · 91 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 15d ago Changed · +2 lines · +63 tokens per session d60a63ba4b3e
  2. 1mo ago First seen · 89 lines · 0 tokens per session scan A 9576bbaec725

Subscribe to this mod's changes

debug is a skill published in the GitHub repository mehrad-dm/mastermind (23 stars, last pushed 6d ago), licensed MIT. It adds 63 tokens to every session and 1,502 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.