fix

fix is a command for coding agents from MadAppGang/magus. It costs 42 tokens per session (17,822 once invoked), scanned A, original, MIT.

Fixes a bug test-first — reproduce, localize, plan, patch, validate. Two multimodel gates, one on the root-cause hypothesis before any code and one on the finished patch.

Command

Installs and runs on its own, but its text points at files inside the plugin that ships it — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed.

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.

agentmods
npx agentmods add commands/madappgang/magus/fix
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/magus

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 fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/magus/fix.svg)](https://agentmods.dev/commands/madappgang/magus/fix)
Your own site
<a href="https://agentmods.dev/commands/madappgang/magus/fix"><img src="https://agentmods.dev/badge/commands/madappgang/magus/fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 17,822 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin unknown 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 $0.00042 $0.17822
Opus 5 $0.00021 $0.08911
Sonnet 5 $0.00008 $0.03564
Haiku 4.5 $0.00004 $0.01782

Measured today against content hash 3b5043b2795c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix 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 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.

Makes network callslowCapability

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

BASELINE=$(curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
plugins/dev/commands/fix.md · 1,459 lines

How it starts

The opening of the file, as written. The whole thing — 1,459 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 this ONCE at the start of the command:

/dev:fix — Production-Grade Bug Fix Beyond /dev:debug, this command adds:

  • TDD state machine: RED → VERIFY RED → GREEN → REGRESSION CHECK (always, not opt-in)
  • Dual multimodel consensus review (Phase A: root cause; Phase B: patch quality)
  • 3-strategy fault localization with context budget enforcement
  • Optional deployment monitoring (Sentry, CloudWatch, log files)
  • Downgrade offer at VALIDATE: skip Phase B + monitoring if fix is clean

For quick debugging or one-off patches, use /dev:debug instead. </value_banner>

<critical_override> THIS COMMAND OVERRIDES THE CLAUDE.md TASK ROUTING TABLE FOR AGENT SELECTION.

WHY: The CLAUDE.md routing table maps "Debugging" to code-analysis:detective, but this command needs dev:debugger for root cause analysis and dev:developer for applying fixes. code-analysis:detective is READ-ONLY and cannot write code or tests.

AGENT RULES FOR THIS COMMAND:

  • Stack detection → dev:stack-detector agent (subagent_type: "dev:stack-detector")
  • Error analysis and root cause investigation → dev:debugger agent (subagent_type: "dev:debugger")
  • Writing tests and applying patches → dev:developer agent (subagent_type: "dev:developer")
  • Phase A vote, internal Claude (root-cause hypothesis) → dev:debugger with EVALUATE ONLY instruction, run_in_background: true
  • Phase B vote, internal Claude (patch quality) → dev:reviewer (subagent_type: "dev:reviewer"), foreground, handed the TARGET / FOCUS / OUTPUT / MODELS contract lines. The reviewer judges the patch it is handed; the debugger wrote the diagnosis and does not grade its own work. It writes its own report in its own format; this command maps its **Verdict**: line to a vote (PASS → APPROVE, FAIL → REJECT, CONDITIONAL → ABSTAIN) and never hands it the vote schema
  • Phase B tally when MODELS is not "none" → dev:synthesizer (subagent_type: "dev:synthesizer"), foreground, given the vote files and never the code. At MODELS "none" there is one mapped vote and it is the tally — no synthesizer
  • Multimodel vote (external models) → claudish MCP tools (team/create_session), run_in_background: true
  • Post-deploy monitoring → inline Bash
  • Validation → inline Bash (run tests directly)

DO NOT use code-analysis:detective (READ-ONLY — cannot apply fixes or write tests). DO NOT use dev:researcher (researches topics, does NOT debug code). DO NOT use dev:architect (plans architecture, does NOT debug or fix code). </critical_override>

<critical_constraints> <todowrite_requirement> You MUST use Tasks to track all 8 phases plus the two review gates.

  Before starting, create this todo list:
  0. Initialize (session setup, flag parsing, skill loading)
  1. REPRODUCE (confirm bug, detect stack, capture error signature)
  2. LOCALIZE (3-strategy fault localization with context budget)
  3. PLAN (root cause analysis + Phase A multimodel review)
  4. PATCH (TDD: RED → VERIFY RED → GREEN, apply minimal fix)
  5. VALIDATE (full test suite + quality checks + downgrade offer)
  6. REVIEW-B (multimodel patch quality vote — after full validation)
  7. MONITOR (optional 3-tier deployment monitoring)
  8. DOCUMENT (fix-report.md + git commit)

Read the full file on GitHub · 1,459 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. today First seen · 1,459 lines · 42 tokens per session scan A 3b5043b2795c

Subscribe to this mod's changes

fix is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 17,822 once invoked, about $0.0002 per session on Opus 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-09-04.