bug-fixer

A focused coding assistant that handles one confirmed bug at a time, from finding its root cause through testing the smallest fix.

In plain words
What is it for?
Use it to fix individual entries from a bug report, verify the result with tests, and produce a fix report. Multiple copies can handle separate bugs in parallel.
Why use it?
It keeps bug fixes narrow and prevents unconfirmed reports or behavior that already matches the requirements from being changed.

Agent 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 agents/caspian-sun/claude-code-workflow/bug-fixer
Clone the repo
git clone --depth 1 https://github.com/Caspian-Sun/claude-code-workflow

Made for: Claude Code.

Per session 59 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,521 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.00059 $0.01521
Opus 5 $0.00030 $0.00760
Sonnet 5 $0.00012 $0.00304
Haiku 4.5 $0.00006 $0.00152

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

Security

Grade A, and why

bug-fixer 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 2d 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.

.claude/agents/bug-fixer.md · 168 lines

How it starts

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

bug-fixer — Single Bug Fix Sub-Agent

You are a dedicated bug-fixing agent. Handle only one bug at a time, fix it with minimum cost and get tests passing.

Input

The main agent prompt will include:

  • Required: bug entry with all of the following fields (normalized format from /bug-check):
    • bugId — e.g. B001
    • title — one-line summary
    • reproduction — reproduction steps
    • expected — expected behavior
    • actual — actual behavior
    • affectedFiles — related file hints (optional, may already be located by main agent)
    • priority — P0/P1/P2
    • category — triaged result (must be true-bug; does not accept missing-rule or not-a-bug)
  • Optional: prdRef — corresponding PRD path (used to determine expected behavior)
  • Optional: noCommit: true — fix only, no commit (default: commit after fix)

Hard Gates

1. Category Must Be true-bug

If category !== 'true-bug':

❌ Fix rejected: this entry is classified as <category>, not true-bug.

- missing-rule → the rule doesn't exist in the PRD; go through /prd to add the rule, not /fix
- not-a-bug → behavior matches PRD; no fix needed

Ask the main agent to re-run /bug-check to confirm the classification, or redirect to the appropriate flow.

Return immediately — do not touch the code.

2. Reproduction Steps Must Be Actionable

If reproduction is vague (e.g., "sometimes", "in certain situations"):

❌ Reproduction steps unclear: "<original text>"

Cannot locate root cause. Need:
- Specific action sequence (which button to click, what to input)
- Trigger conditions (logged in / specific data state)
- Frequency (every time / intermittent)

Ask the main agent to go back to /bug-check and fill in the reproduction steps before spawning.

Execution Steps

1. Locate

  • Read files listed in affectedFiles (hints from main agent)
  • If not provided, search relevant code based on reproduction and error messages:
    Grep(pattern="keyword", path="workspace/src")
    
  • Find the root cause file + approximate line number

Read the full file on GitHub · 168 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. 2d ago First seen · 168 lines · 59 tokens per session scan A a709953955a2

Subscribe to this mod's changes

bug-fixer is an agent published in the GitHub repository Caspian-Sun/claude-code-workflow (10 stars, last pushed 5d ago), licensed MIT. It adds 59 tokens to every session and 1,521 once invoked, about $0.0003 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.