bug

A command workflow for investigating and fixing software bugs through root-cause analysis, testing, and review gates.

In plain words
What is it for?
Handling bug reports, error messages, issue numbers, and reproduction steps through investigation and verified fixes.
Why use it?
It helps prevent premature fixes, requires validation, and avoids committing changes without the user’s approval.

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/qwickapps/ai-sdlc-workflows/bug
Clone the repo
git clone --depth 1 https://github.com/qwickapps/ai-sdlc-workflows

Made for: Claude Code.

Per session 9 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,944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00009 $0.01944
Opus 5 $0.00005 $0.00972
Sonnet 5 $0.00002 $0.00389
Haiku 4.5 $0.00001 $0.00194

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

Security

Grade A, and why

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

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/.claude/commands/bug.md · 267 lines

How it starts

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

Bug Fix Workflow

You are now in Bug Fix Mode. Follow this workflow strictly.

Input: $ARGUMENTS (bug description, error message, issue number, or reproduction steps)

CRITICAL RULES

  1. Understand before fixing - investigate root cause first (see RESEARCH-DEPTH.md)
  2. NEVER auto-commit - always wait for explicit user approval
  3. NEVER add legacy support or workarounds - fix the actual issue
  4. No attributions in commit messages
  5. When blocked - STOP and discuss (see COMMUNICATION-PROTOCOL.md)
  6. Validate thoroughly - build, test, E2E (see VALIDATION-GATES.md)
  7. Use worktree script - NEVER use git commands directly (see WORKTREE-ENFORCEMENT.md)

Interactive Setup

Check if $ARGUMENTS is provided.

If $ARGUMENTS is empty or unclear, ask:

"What bug would you like me to investigate? Please provide:

  • Error message or unexpected behavior
  • Steps to reproduce (if known)
  • Expected vs actual behavior
  • Issue/ticket number (GitHub issue, JIRA ticket, etc.)"

Extract and store the issue/ticket number from the response for:

  • Branch naming (bugfix/ISSUE-123)
  • Document attachment
  • Commit messages

Wait for response before proceeding.

Workflow Phases

PHASE 1: Investigation (Quality Engineer + Coder)

Research Requirements: Follow RESEARCH-DEPTH.md guidelines:

  • Use Explore agent for unfamiliar code areas
  • Use Grep for specific code patterns
  • Use Chrome automation to verify frontend bugs
  • Use QwickBrain MCP to check for similar past bugs
  • Gather evidence with file:line references
  • No assumptions without verification
  1. Reproduce the bug:

    • Understand the expected vs actual behavior
    • Identify steps to reproduce
    • Ask clarifying questions if unclear
  2. Root cause analysis:

    • Use Explore agent to understand affected system
    • Use Grep to find relevant code
    • Read actual code, don't assume behavior
    • Trace execution path
    • Identify the source of the bug
    • Document findings with file:line evidence

Read the full file on GitHub · 267 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 · 267 lines · 9 tokens per session scan A 1b463ba6c91b

Subscribe to this mod's changes

bug is a command published in the GitHub repository qwickapps/ai-sdlc-workflows (2 stars, last pushed 5mo ago), licensed MIT. It adds 9 tokens to every session and 1,944 once invoked, about $0.0000 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-08-31.