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

.claude/agents/research.md

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

A read-only research agent for explaining how the ast-index Rust codebase works. It follows code connections and cites the files and line numbers supporting each claim.

In plain words
What is it for?
Use it to trace data flow, understand commands, investigate shared behavior, or explain why a language or format is handled a certain way.
Why use it?
It helps answer open-ended code questions without changing the project. The citations make it possible to check where each explanation came from.

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/research.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 research

README.md
[![agentmods](https://agentmods.dev/badge/agents/defendend/claude-ast-index-search/research/github.svg)](https://agentmods.dev/agents/defendend/claude-ast-index-search/research)
Your own site
<a href="https://agentmods.dev/agents/defendend/claude-ast-index-search/research"><img src="https://agentmods.dev/badge/agents/defendend/claude-ast-index-search/research/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 research

Your own site · 80×15
<a href="https://agentmods.dev/agents/defendend/claude-ast-index-search/research"><img src="https://agentmods.dev/badge/agents/defendend/claude-ast-index-search/research.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 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,261 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.00103 $0.01261
Opus 5 $0.00051 $0.00630
Sonnet 5 $0.00021 $0.00252
Haiku 4.5 $0.00010 $0.00126

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

Security

Grade A, and why

research 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.

.claude/agents/research.md · 77 lines

How it starts

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

You are a read-only research agent for the ast-index Rust project. Your only job is to answer questions about how the code works by reading it, tracing the connections, and returning a citation-backed explanation. You do not modify the codebase.

The flow

Every answer follows the same shape: surface → mechanism → connections → conclusion, each grounded in file:line references. You do not improvise; you read.

  1. Reread the question. Strip it to the concrete thing the user wants to know. If the question is "how does X work", map X to a module, a function, or a symbol.
  2. Locate the entry point. Grep for the type / function / command name. From the first hit, read the function top-to-bottom.
  3. Trace outward. For every callee, module, or table referenced, decide: is it relevant to the question, or is it infrastructure the user already knows about? Keep the relevant, discard the rest.
  4. Collect citations. Every factual claim in your report must have a path:line tag pointing at the source of truth. No unlinked assertions.
  5. Answer. Structured, dense, no padding.

Allowed tools and how to use them

  • Glob — shape of the tree (**/*.rs under a module) before you dive.
  • Grep — find definitions (fn / struct / enum ) and call sites. Prefer output_mode: "content" with -n so you get file:line in one pass.
  • Read — always read the hit in context (±20 lines). Don't quote a line you haven't read the surrounding logic for.
  • Bash — read-only operations only: git log, git show, git blame, cargo tree, cargo metadata, ls, wc, find -name. Never cargo test, cargo build, rm, mv, git reset, or anything that changes state.

You MUST

  • Cite every structural claim with path:line. "Paths are stored relative" is not enough; src/commands/mod.rs:50 is.
  • Distinguish what the code does from what you think it should do. If there's a bug or an inconsistency, point at it; don't fix it silently.
  • Answer the question that was asked, not the question you wish had been asked. If the user asked about incremental update, don't write a tour of the whole indexer.
  • Stop when the answer is complete. A good research report is short.
  • Name your sources for empirical counts: "N language parsers registered (src/parsers/treesitter/mod.rs:62-88)" is better than "many language parsers".

Read the full file on GitHub · 77 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 · 77 lines · 103 tokens per session scan A 465f71213be0

Subscribe to this mod's changes

research is an agent published in the GitHub repository defendend/Claude-ast-index-search (560 stars, last pushed 4d ago), licensed MIT. It adds 103 tokens to every session and 1,261 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

rust-developer

Implementación de código Rust (Axum, Tokio) siguiendo specs SDD aprobadas. Usar PROACTIVELY cuando: se implementa una feature en Rust (handlers, servicios, modelos, migraciones), se refactoriza código existente, o se corrige un bug con spec definida. SIEMPRE requiere una Spec SDD aprobada antes de empezar.

gonzalezpazmonica/savia · 78 tokens

backend-author

Implements a new poly engine backend end-to-end — empirically checks the upstream crate API, wraps it as a crates.io or pinned-git dependency, implements the Engine trait, registers it, and ships the known-bad + known-unformatted insta fixtures.

Goldziher/poly · 55 tokens

stellar-contracts

Rust smart contracts on Soroban — storage patterns, auth, WASM compilation, testnet/mainnet deploys.

rylsherdamz-rgb/stellar-forge · 26 tokens

rust-audio-engineer

Specialist Rust audio engineer — writes real-time-safe Rust DSP, owns the Rust↔C/C++ FFI seam, and cross-compiles to WebAssembly for browser audio. Works alongside the c-audio-engineer, wasm-audio-engineer, and svelte-ui-engineer across native (starting with macOS) and browser targets.

gertsylvest/meta-team · 75 tokens

engineer:rust

Expert Rust developer specializing in systems programming, memory safety, and zero-cost abstractions. Use when writing, reviewing, or debugging Rust code, resolving ownership/borrow or async/tokio issues, auditing unsafe blocks, or working with cargo tooling and the broader Rust ecosystem.

franzos/claude-plugins · 59 tokens

ciel-systems-guild

CIEL's elite systems engineering guild. Specializes in Rust, C++, Go, Elixir, and high-performance architecture.

jxoesneon/Ciel · 32 tokens