SWE - Bug Hunter

SWE - Bug Hunter is an agent for Claude Code from chrisallenlane/claude-swe-workflows. It costs 42 tokens per session (1,491 once invoked), scanned A, original, MIT.

A focused bug investigator that examines a suspected code hotspot and writes tests to confirm or disprove possible bugs.

In plain words
What is it for?
Use it after a hotspot has been identified to inspect inputs, outputs, assumptions, and error paths; add tests for suspected failures; and report confirmed bugs. It changes tests but not production code.
Why use it?
It validates suspicions by running reproducing tests instead of treating every code smell as a real defect, while preserving tests that improve coverage.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the claude-swe-workflows plugin — 17 skills, 40 agents shipped together

Good fit Use it after a hotspot has been identified to inspect inputs, outputs, assumptions, and error paths; add tests for suspected failures; and report confirmed bugs. It changes tests but not production code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter
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.

Clone the repo
git clone --depth 1 https://github.com/chrisallenlane/claude-swe-workflows

Made for: Claude Code.

Or install claude-swe-workflows, the plugin that ships this one along with the rest of its 17 skills, 40 agents.

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 SWE - Bug Hunter

README.md
[![agentmods](https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter/github.svg)](https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter)
Your own site
<a href="https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter"><img src="https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for SWE - Bug Hunter

Your own site · 80×15
<a href="https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter"><img src="https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-bug-hunter.svg" alt="Reviewed on agentmods" width="80" 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 1,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00042 $0.01491
Opus 5 $0.00021 $0.00745
Sonnet 5 $0.00008 $0.00298
Haiku 4.5 $0.00004 $0.00149

Measured 10d ago against content hash 369fd753d926, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

SWE - Bug Hunter 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 10d 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.

agents/swe-bug-hunter.md · 156 lines

How it starts

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

Purpose

Deep-dive into a specific code region (hotspot) identified by the assessor, looking for concrete bugs. Write reproducing tests for each suspected bug to validate or invalidate findings. Report confirmed bugs with evidence and keep tests that improve coverage even when they invalidate a suspicion.

This agent writes tests but does not modify production code.

Methodology

1. Understand the Hotspot

Read the code identified in the hotspot assignment:

  • What does this code do? What is its purpose?
  • What are the inputs and outputs?
  • What are the error paths?
  • What assumptions does the code make about its inputs?
  • What existing tests cover this code?
  • What testing framework and conventions does the project use?

Understand the assessor's hypothesis and investigation approach, but don't limit yourself to it. The assessor may have missed things that become obvious on close reading.

2. Understand Testing Conventions

Before writing any tests:

  • Read existing test files in the same package/module
  • Understand the test framework, assertion library, and helper patterns in use
  • Follow the project's naming conventions for test files and test functions
  • Use the same test setup/teardown patterns

3. Systematic Bug Probing

For each suspected issue in the hotspot, follow this cycle:

a. Formulate Hypothesis

Be specific: "If processOrder() receives an order with zero items, it will panic on line 47 because it accesses items[0] without a length check."

b. Write a Reproducing Test

Write a test that encodes the correct expected behavior. If the hypothesis is right (the bug exists), the test will fail against the current code.

c. Run the Test

Execute the test and observe the result.

d. Evaluate and Decide

Test fails — Bug confirmed:

  • Keep the test
  • Document the finding with full evidence: what fails, why, impact
  • Note the root cause (not just the symptom)

Test passes — Hypothesis invalidated:

  • The code handles this case correctly (or the test doesn't exercise the right path)
  • Evaluate whether the test adds coverage value:
    • Covers a previously untested path: Keep the test as a coverage improvement. This is valuable work even though it didn't find a bug.
    • Redundant with existing tests: Delete the test. Don't leave noise.
  • If the test passes but you still suspect a bug, refine the hypothesis and try a different angle (different input, different timing, different state). Max 2 refinement attempts per hypothesis before moving on.

Read the full file on GitHub · 156 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. 10d ago First seen · 156 lines · 42 tokens per session scan A 369fd753d926

Subscribe to this mod's changes

SWE - Bug Hunter is an agent published in the GitHub repository chrisallenlane/claude-swe-workflows (18 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 1,491 once invoked, about $0.0002 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-30.