debug

debug is a command for Claude Code from brain-bootstrap/claude-code-brain-bootstrap. It costs 19 tokens per session (678 once invoked), scanned A, original, MIT.

A guided debugging command for finding and fixing the underlying cause of a failing test, build, or running service.

In plain words
What is it for?
Use it to investigate test failures, compiler or bundler errors, runtime logs, database or message-queue problems, and lint errors.
Why use it?
It prevents quick symptom fixes that hide the real bug. It requires evidence, a testable explanation, a focused fix, and verification.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit Use it to investigate test failures, compiler or bundler errors, runtime logs, database or message-queue problems, and lint errors.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/brain-bootstrap/claude-code-brain-bootstrap/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/brain-bootstrap/claude-code-brain-bootstrap

Made for: Claude Code.

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/brain-bootstrap/claude-code-brain-bootstrap/debug/github.svg)](https://agentmods.dev/commands/brain-bootstrap/claude-code-brain-bootstrap/debug)
Your own site
<a href="https://agentmods.dev/commands/brain-bootstrap/claude-code-brain-bootstrap/debug"><img src="https://agentmods.dev/badge/commands/brain-bootstrap/claude-code-brain-bootstrap/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/brain-bootstrap/claude-code-brain-bootstrap/debug"><img src="https://agentmods.dev/badge/commands/brain-bootstrap/claude-code-brain-bootstrap/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 678 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.00019 $0.00678
Opus 5.5 $0.00008 $0.00271
Sonnet 5.5 $0.00004 $0.00136
Haiku 4.5 $0.00002 $0.00068

Measured 1mo ago against content hash e73c646d24fe, 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 1mo 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.

.claude/commands/debug.md · 67 lines

How it starts

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

Debug a failing test, build, or service issue: $ARGUMENTS

ultrathink — use extended reasoning for root cause analysis.

Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

Symptom fixes are failure. A fix that makes a test pass without understanding why it was failing is not a fix — it is a masked bug. This law is especially critical under time pressure, after 2+ failed fix attempts, or when there is a "just try this quick thing" temptation.

4 Phases (do not skip or reorder):

  1. Root Cause — gather all evidence, classify the failure
  2. Hypothesis — form a specific, testable hypothesis about the cause
  3. Fix Design — design a minimal fix that addresses the root cause only
  4. Verification — run the test/build, confirm fix, check for regressions

Instructions

Read claude/tasks/lessons.md for known pitfalls before starting.

Phase 1 — Root Cause (gather ALL evidence before hypothesizing):

  1. Identify the failure type from the arguments:

    • Test failure → read test file + source under test
    • Build failure → read error output, check compiler/bundler errors
    • Runtime error → read logs, check DB state, check message queues
    • Lint error → run linter on the file
  2. Gather evidence (do ALL of these before proposing a fix):

    • Read the full error message/stack trace
    • Read the failing source file
    • Check if the error is pre-existing: git stash && <run-test> && git stash pop
    • Search claude/tasks/lessons.md for similar past issues
    • Check if the file was recently modified: git --no-pager log --oneline -5 -- <file>

Phase 2 — Hypothesis (form one specific, testable hypothesis before acting):

Write it explicitly: "I believe the root cause is X because Y."

Phase 3 — Fix Design (fix only the root cause, no opportunistic changes):

  1. Diagnose root cause — classify:
    Category Symptoms Typical fix
    Missing import ReferenceError, is not defined Add import statement
    Type mismatch TypeError, Cannot read properties Fix type/null check
    DB schema drift column X does not exist Check migration
    Stale build Works after clean build Clean + rebuild
    Stub mismatch Test assertion fails Verify stub key matches export name

Read the full file on GitHub · 67 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. 1mo ago First seen · 67 lines · 19 tokens per session scan A e73c646d24fe

Subscribe to this mod's changes

debug is a command published in the GitHub repository brain-bootstrap/claude-code-brain-bootstrap (11 stars, last pushed 5mo ago), licensed MIT. It adds 19 tokens to every session and 678 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-30.