fix-bug

A command workflow for investigating and fixing a reported software bug from its symptoms or logs through testing and delivery.

In plain words
What is it for?
Use it to diagnose failures, add regression tests, check related code for the same bug, verify with Bun and Node, and optionally prepare a pull request or release.
Why use it?
It helps find the underlying cause instead of only hiding the visible error, while checking that the bug does not return.

Command for Claude Code

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/developerz-ai/ai-task-master/fix-bug
Clone the repo
git clone --depth 1 https://github.com/developerz-ai/ai-task-master

Made for: Claude Code.

Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,671 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00056 $0.01671
Opus 5 $0.00028 $0.00835
Sonnet 5 $0.00011 $0.00334
Haiku 4.5 $0.00006 $0.00167

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

Security

Grade A, and why

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

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

**OpenRouter only** — no Anthropic SDK, ever; inference flows through `Credentials` (`OPENROUTER_API_KEY`). **SOLID / SRP** — one responsibility per module. **Every module ships a paired `*.test.ts` — no test, no merge.*
.claude/commands/fix-bug.md · 49 lines

How it starts

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

/fix-bug

You are a senior engineer on the aitm team debugging a reported defect. Take it from symptom to merged-and-shipped. Read CLAUDE.md first. The sibling /feature command is the map for the PR/merge/release mechanics — this command differs in the front half: diagnose before touching anything.

Bug report

$ARGUMENTS

The prompt is the context — read the intent. A pasted log or stack trace is the primary evidence; quote the exact failing line back in your diagnosis. "Fix and release" / "all pushed all merged" → run start-to-finish autonomously, merge on green, no check-ins. A tentative "I think X is broken" → confirm the diagnosis with the user before fixing. Always stop for a true blocker (irreversible action outside the ask — an npm publish above all — credential risk, a policy violation from Hard rules).

The flow

  1. Reproduce the failure in your head first. Locate the code that raised — grep the message verbatim; a TypeScript message pins the operation (Cannot read properties of undefined, a Zod safeParse failure naming the field, an execa non-zero exit). Read the whole function and its callers until you can narrate the failing path end to end: which input, which line, why. Name the root cause, not the symptom — the throw site is where it surfaced, not where it went wrong. codegraph_explore gets you the symbol plus its call paths in one hop.

  2. Understand the blast radius. A bug rarely lives alone:

    • What does the failure do downstream? A swallowed rejection inside WorkLoop becomes a stalled or hot-looping run; a mis-parsed gh payload silently merges the wrong thing. The secondary defect is often worse than the primary.
    • Is there a bug family? Fan out Task Explore agents to sweep for the same pattern elsewhere — an optional field read without a guard under exactOptionalPropertyTypes, a gh --json field assumed present that GitHub sends null, a poll loop with no bound, an await missing in a finally. Fix genuine siblings in the same PR; note-and-skip cosmetic ones, or fix them if trivial.

Read the full file on GitHub · 49 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. yesterday First seen · 49 lines · 56 tokens per session scan A e43611446b27

Subscribe to this mod's changes

fix-bug is a command published in the GitHub repository developerz-ai/ai-task-master (5 stars, last pushed 25d ago), licensed MIT. It adds 56 tokens to every session and 1,671 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.