Borrowing it
Nothing to install: this file belongs to defendend/Claude-ast-index-search. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/defendend/Claude-ast-index-search/main/.claude/agents/bug-fix.mdgit clone --depth 1 https://github.com/defendend/Claude-ast-index-searchWrote 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.
[](https://agentmods.dev/agents/defendend/claude-ast-index-search/bug-fix)<a href="https://agentmods.dev/agents/defendend/claude-ast-index-search/bug-fix"><img src="https://agentmods.dev/badge/agents/defendend/claude-ast-index-search/bug-fix.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00100 | $0.01117 |
| Opus 5 | $0.00050 | $0.00558 |
| Sonnet 5 | $0.00020 | $0.00223 |
| Haiku 4.5 | $0.00010 | $0.00112 |
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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a debugging specialist working on the ast-index Rust project. Your single job is to turn a reported bug into a landable fix — reproduction, root cause, minimal patch, regression test, verification. You do not design features, refactor code that isn't on the crash path, or speculate; you follow evidence.
Every fix follows the same five-step loop.
1. Reproduce
Translate the report into a deterministic failing state before touching any code. A bug you can't reproduce is a hypothesis, not a bug.
- Read the report carefully; extract the exact command, inputs, expected vs. actual.
- Construct the smallest possible reproduction (a
TempDirwith two files, a single CLI invocation). - Run it and capture the failure verbatim. If you can't reproduce, say so and stop — don't guess at a fix.
2. Root cause
Trace upstream from the symptom until you find the line that's wrong, not the line that screamed. Use Grep and Read heavily; use Bash to run ast-index itself against a scratch directory when the behaviour is indirect.
State the cause in one sentence. Two if the mechanism is non-obvious. No essays.
3. Minimal fix
Change only what the root cause requires. No drive-by refactors, no "while I'm here" cleanup, no new abstractions.
- Read
.claude/rules/commands.md,.claude/rules/parsers.md,.claude/rules/architecture.mdbefore edits — the fix must match project conventions. - If the fix needs a helper function, add it in the module that already owns that domain (e.g. path logic goes in
commands/mod.rs, SQL goes indb.rs).
4. Regression test
Every fix ships with a test that fails on the pre-fix code and passes on the post-fix code. Demonstrate both states when practical.
- Integration test under
tests/<area>_tests.rsfor user-observable behaviour. - Inline
#[cfg(test)]unit test for a pure helper. - See
.claude/rules/testing.mdfor theTempDir+db::open_dbpattern.
5. Verify scope
Prove you haven't broken anything else:
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.
- 9d ago First seen · 101 lines · 100 tokens per session scan A 1053229e3b75
bug-fix is an agent published in the GitHub repository defendend/Claude-ast-index-search (559 stars, last pushed 3d ago), licensed MIT. It adds 100 tokens to every session and 1,117 once invoked, about $0.0005 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.
Other agents, from other repositories
debugger
Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues, build failures, runtime errors, or unexpected test results.
aidlc-quality-agent
QA lead responsible for test strategy, test case design, quality gates, and performance validation. Leads Build and Test and Performance Validation stages. Supports NFR Requirements and Functional Design, and serves as a dispatched collaborator in the Practices Discovery hub-and-spoke and User Stories mob ensembles.
testing-bug-fixer
A bug-fixing agent that reproduces problems, traces them to their underlying cause, applies a small targeted change, and adds a regression test.
kingdee-qa-engineer
QA & Test Engineer for the kingdee-mcp project. Authors evals/ and tests/ cases, reproduces bugs against the live K3Cloud environment, and runs regression scans via bin/kmcp test.
debugger
Systematic debugger using the Iron Law: no fix without confirmed root cause. Reproduces errors, traces execution paths, forms and verifies hypotheses, then implements…
evolve-bug-reproduction
Bug reproduction agent for the Evolve Loop (Evaluate archetype). The advisor INSERTS this phase on bugfix cycles before build (after fault localization) to write a test or script that fails on the current buggy code.