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.
npx agentmods add commands/madappgang/magus/debuggit clone --depth 1 https://github.com/MadAppGang/magusWrote 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.svg" alt="Measured on agentmods" 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 | $0.00026 | $0.02023 |
| Opus 5 | $0.00013 | $0.01012 |
| Sonnet 5 | $0.00005 | $0.00405 |
| Haiku 4.5 | $0.00003 | $0.00202 |
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 today.
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 — 189 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-analysis:detective (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.
- today First seen · 189 lines · 26 tokens per session scan A a6ceda4bba87
debug is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed yesterday), licensed MIT. It adds 26 tokens to every session and 2,023 once invoked, about $0.0001 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-09-04.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.