Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add MadAppGang/magus/plugin install devWrote 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.
[](https://agentmods.dev/commands/madappgang/magus/debug)<a href="https://agentmods.dev/commands/madappgang/magus/debug"><img src="https://agentmods.dev/badge/commands/madappgang/magus/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.
<a href="https://agentmods.dev/commands/madappgang/magus/debug"><img src="https://agentmods.dev/badge/commands/madappgang/magus/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00026 | $0.01994 |
| Opus 5.5 | $0.00010 | $0.00798 |
| Sonnet 5.5 | $0.00005 | $0.00399 |
| Haiku 4.5 | $0.00003 | $0.00199 |
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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 188 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<user_request> $ARGUMENTS </user_request>
<value_banner> Display ONCE at the start of the command:
/dev:debug — Structured Debugging Workflow
Beyond what Claude does natively, this command adds:
- 3 depth levels: quick patch / systematic 6-phase debug / production-grade TDD fix
- Fault localization with stack trace, keyword, and AST strategies
- Auto-inference detects the right depth from your description
- Escalation: quick-patch auto-upgrades when complexity grows
For quick debugging, just ask Claude directly. </value_banner>
<critical_override> THIS COMMAND OVERRIDES THE CLAUDE.md TASK ROUTING TABLE FOR AGENT SELECTION.
Routing rules for this command only:
- Stack detection → dev:stack-detector agent
- Error analysis → dev:debugger agent (standard debug path only, via skill)
- Applying fixes → dev:developer agent
QUICK-PATCH: root cause analysis is INLINE (no agent delegation) DO NOT use code-search:analyze (READ-ONLY agent, not for fixing) </critical_override>
<scope_selection> MANDATORY: Determine debugging scope before starting.
Auto-inference rules (skip the question when any of these match):
- Stack trace present + single file mentioned → Quick patch
- Keywords: "production", "critical", "intermittent", "uncertain root cause" → /dev:fix
- Keywords: "root cause", "investigate first", "systematic" → Standard debug
- Simple error message with obvious single-location cause → Quick patch
- --downgrade flag in $ARGUMENTS → Standard debug (bypass all inference)
- Default (none of the above): Ask user
If auto-inference cannot determine scope, use AskUserQuestion with these options:
- Quick patch: "Fast: stack trace → inline analysis → patch. Auto-escalates if scope grows."
- Standard debug: "Thorough: reproduce → localize (3 strategies) → root cause → patch → validate"
- Production-grade fix: "Full TDD + multimodel review. Run /dev:fix for this depth."
Decision:
- "Quick patch" → execute the Quick-Patch Workflow below
- "Standard debug" → load dev:systematic-debugging and follow workflow.md exactly
- "Production-grade fix" → output: "Scope: Production-grade fix. Run
/dev:fix {bug description}for the full TDD + review workflow." then STOP </scope_selection>
<quick_patch_workflow> Execute this workflow inline when scope = Quick patch.
Phase 0: Initialize
- Follow dev:systematic-debugging → session-setup.md for session setup (prefix: "dev-debug-quickfix")
- Parse flags from $ARGUMENTS:
- --review: opt-in multimodel patch quality vote at Phase 4
- --tdd: write RED test before applying patch
- --interactive: approval gate before PATCH phase
Phase 1: REPRODUCE
- Use context from session-setup.md
- If reproduction steps were provided in $ARGUMENTS, attempt reproduction via Bash
- Document reproduction result in session
Phase 2: LOCALIZE (Strategy A — stack trace first)
- If stack trace present: extract file:line with Grep, Read ±20 lines of surrounding context
- If no stack trace: fall back to keyword search across codebase with Grep
- Write localization.md to session directory
Escalation check #1: if candidates span > 3 files → offer upgrade to Standard debug
Phase 3: PLAN (inline root cause — no agent delegation)
- Perform root cause analysis directly in this context
- Generate: hypothesis, fix approach, files to modify
- Self-critique checklist:
- MINIMAL_CHANGE: is the fix as small as possible?
- ROOT_CAUSE_NOT_SYMPTOM: does this fix the cause, not mask it?
- REGRESSION_SAFETY: what existing behavior could break?
- TEST_COVERAGE: is there a test that would catch this?
- REGRESSION_RISK: LOW / MEDIUM / HIGH
- COMPETING_HYPOTHESES: YES / NO
- Write root-cause.md to session directory
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.
- 2mo ago Changed · -1 lines 0a825dcb0e66
- 2mo ago Changed e48d4451c808
- 2mo ago First seen · 189 lines · 26 tokens per session scan A a6ceda4bba87
debug is a command published in the GitHub repository MadAppGang/magus (16 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 1,994 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-09-04.
debug compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| debugMadAppGang/magus | Command | 16 | today | MIT | A | 26 | Claude Code |
| qa-changesOpenHands/extensions | Command | 190 | today | MIT | A | 63 | Claude Code |
| auditar-cascadingluanpdd/kit-mcp | Command | 5 | yesterday | MIT | A | 54 | Claude Code |
| react-nativegetsentry/toolkit | Command | 977 | yesterday | none | A | 0 | Claude Code |
| doctordoncheli/don-cheli-sdd | Command | 59 | 3mo ago | Apache-2.0 | A | 76 | Claude Code |
| doctorfatihkan/badi | Command | 8 | 1mo ago | MIT | A | 0 | Claude Code |
| fixstefan-jansen/claude-code-toolkit | Command | 101 | 4mo ago | MIT | A | 9 | Claude Code |