Claude-ast-index-search: Agent for Claude Code

.claude/agents/bug-fix.md

bug-fix is an agent for Claude Code from defendend/Claude-ast-index-search. It costs 100 tokens per session (1,117 once invoked), scanned A, original, MIT.

A debugging agent for reported problems in the ast-index Rust project. It reproduces the issue, finds its underlying cause, makes a small fix, adds a test, and checks the result.

In plain words
What is it for?
Use it for crashes, incorrect output, or other concrete bugs with reproduction details. It is not intended for new features or unrelated refactoring.
Why use it?
It replaces guesswork with a repeatable process for turning a specific failure into a tested code change. If the problem cannot be reproduced, it stops instead of guessing.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is defendend/Claude-ast-index-search's own configuration. It tells Claude Code how to work on Claude-ast-index-search itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Claude-ast-index-search configures →

Part of the ast-index plugin — 3 agents, 1 plugin shipped together

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/defendend/Claude-ast-index-search/main/.claude/agents/bug-fix.md
Clone the repo
git clone --depth 1 https://github.com/defendend/Claude-ast-index-search

Made for: Claude Code.

Or install ast-index, the plugin that ships this one along with the rest of its 3 agents, 1 plugin.

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/agents/defendend/claude-ast-index-search/bug-fix.svg)](https://agentmods.dev/agents/defendend/claude-ast-index-search/bug-fix)
Your own site
<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>
Per session 100 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,117 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.00100 $0.01117
Opus 5 $0.00050 $0.00558
Sonnet 5 $0.00020 $0.00223
Haiku 4.5 $0.00010 $0.00112

Measured 9d ago against content hash 1053229e3b75, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 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.

.claude/agents/bug-fix.md · 101 lines

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 TempDir with 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.md before 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 in db.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.rs for user-observable behaviour.
  • Inline #[cfg(test)] unit test for a pure helper.
  • See .claude/rules/testing.md for the TempDir + db::open_db pattern.

5. Verify scope

Prove you haven't broken anything else:

Read the full file on GitHub · 101 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. 9d ago First seen · 101 lines · 100 tokens per session scan A 1053229e3b75

Subscribe to this mod's changes

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.

Related

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.

davepoon/buildwithclaude · 34 tokens

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.

awslabs/aidlc-workflows · 60 tokens

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.

CronusL-1141/AI-company · 51 tokens

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.

WaHaiLong/KingdeeMCP · 49 tokens

debugger

Systematic debugger using the Iron Law: no fix without confirmed root cause. Reproduces errors, traces execution paths, forms and verifies hypotheses, then implements…

KevinZai/commander · 35 tokens

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.

mickeyyaya/evolve-loop · 51 tokens