bug-fix

bug-fix is a skill for Claude Code from chrisallenlane/claude-swe-workflows. It costs 39 tokens per session (3,638 once invoked), scanned A, original, MIT.

A structured process for fixing software bugs by reproducing the failure, finding its cause, applying a targeted change, and checking the result. A regression test is a test that helps ensure the bug does not return.

In plain words
What is it for?
Use it to investigate errors, crashes, or unexpected behavior and to add tests that protect the corrected behavior.
Why use it?
It turns unclear bug reports into verifiable failures and reduces the chance that a fix creates another problem.

Skill 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 — 22 skills, 37 agents shipped together

Good fit Use it to investigate errors, crashes, or unexpected behavior and to add tests that protect the corrected behavior.

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

Any agent
npx skills add chrisallenlane/claude-swe-workflows --skill bug-fix
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 22 skills, 37 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 bug-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/chrisallenlane/claude-swe-workflows/bug-fix/github.svg)](https://agentmods.dev/skills/chrisallenlane/claude-swe-workflows/bug-fix)
Your own site
<a href="https://agentmods.dev/skills/chrisallenlane/claude-swe-workflows/bug-fix"><img src="https://agentmods.dev/badge/skills/chrisallenlane/claude-swe-workflows/bug-fix/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 bug-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/chrisallenlane/claude-swe-workflows/bug-fix"><img src="https://agentmods.dev/badge/skills/chrisallenlane/claude-swe-workflows/bug-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,638 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.00039 $0.03638
Opus 5.5 $0.00016 $0.01455
Sonnet 5.5 $0.00008 $0.00728
Haiku 4.5 $0.00004 $0.00364

Measured 12d ago against content hash 20b36e0a5dcb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bug-fix 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 12d 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.

skills/bug-fix/SKILL.md · 316 lines

How it starts

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

Bugfix - Automated Bug-Fixing Workflow

Coordinates specialist agents through a bug-fixing cycle: clarify bug -> reproduce with failing test -> diagnose root cause -> implement fix -> verify -> review -> document.

Workflow

1. Clarify the bug

Gather bug details from user:

  • What are the symptoms? (error messages, unexpected behavior, crashes)
  • What is the expected behavior vs actual behavior?
  • How do you reproduce it? (steps, inputs, configuration)
  • When did it start? Any recent changes that might be related?
  • Environment specifics? (OS, versions, configuration)

Ask clarifying questions if needed:

  • Ambiguous symptoms
  • Missing reproduction steps
  • Unclear expected behavior

Loop back to user until the bug is clearly understood. You need enough information to write a test that demonstrates the failure.

2. Write Failing Test(s)

Spawn swe-implementer in reproduce-a-bug mode (or write the tests directly when the bug is small and local).

Implementer task:

  • Write test(s) that reproduce the reported bug
  • Tests should encode the expected behavior (so they fail against the current buggy behavior)
  • Run the tests and verify they actually fail
  • If the tests pass (bug cannot be reproduced): report back with findings — the bug may be environmental, already fixed, or misunderstood

This is the contract. When these tests pass, the bug is fixed.

If reproduction fails:

  • Return to step 1 for more information from the user
  • Report what was tried and why reproduction failed
  • Max 2 reproduction attempts before escalating to user with findings

3. Diagnosis

Spawn swe-bug-investigator agent:

  • Pass: bug description, failing test(s) from step 2, reproduction results
  • Agent performs root-cause analysis:
    • Traces execution paths through the code
    • Git archaeology at agent's discretion (shallow for obvious bugs, deep for systemic ones)
    • Identifies the root cause with supporting evidence
    • Identifies related failure modes that may share the same root cause
  • Agent produces a structured diagnosis report

Read the full file on GitHub · 316 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago Changed · -79 lines · -2 tokens per session 20b36e0a5dcb
  2. 3mo ago First seen · 395 lines · 41 tokens per session scan A 812cab895176

Subscribe to this mod's changes

bug-fix is a skill published in the GitHub repository chrisallenlane/claude-swe-workflows (21 stars, last pushed 13d ago), licensed MIT. It adds 39 tokens to every session and 3,638 once invoked, about $0.0002 per session on Opus 5.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.

Related

bug-fix compared with skills from other repositories

bug-fix next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bug-fixchrisallenlane/claude-swe-workflowsSkill2113d agoMITA39Claude Code
five-whyswesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k2d agononeA53Claude Code
check-linkswesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k2d agononeA44Claude Code, Codex
check-cache-bugsFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A38Claude Code
sandbox-unblockFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A65Claude Code
investigateFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A41Claude Code
qaFlorianBruniaux/claude-code-ultimate-guideSkill7.6ktodayCC-BY-SA-4.0A37Claude Code