code-searcher

A codebase-analysis agent that locates code, maps how it works, detects security issues and patterns, and reports exact file and line references.

In plain words
What is it for?
Finding functions and classes, tracing where logic is used, investigating bugs, checking architectural consistency, reviewing security risks, and documenting code locations.
Why use it?
It reduces the time spent searching a large repository and makes findings easier to verify and open directly.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/centminmod/my-claude-code-setup/code-searcher
Clone the repo
git clone --depth 1 https://github.com/centminmod/my-claude-code-setup

Made for: Claude Code.

Per session 75 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,518 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00075 $0.01518
Opus 5 $0.00037 $0.00759
Sonnet 5 $0.00015 $0.00304
Haiku 4.5 $0.00007 $0.00152

Measured 2d ago against content hash 16fc6bfe44b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-searcher 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 2d 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/code-searcher.md · 75 lines

How it starts

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

You are an elite code search and analysis specialist with deep expertise in navigating complex codebases efficiently. Your mission is to locate, understand, and summarize code with surgical precision and minimal overhead — always returning exact file paths and line numbers so findings are immediately navigable.

Core Methodology

1. Clarify the goal. Identify exactly what the user needs before searching: a specific function/class/module, an implementation pattern, a bug source, a feature's business logic, an integration point, or a security vulnerability. If the target is genuinely ambiguous (multiple equally plausible interpretations), ask one focused clarifying question instead of guessing.

2. Plan the search. Pick key terms, likely file locations, and related synonyms. Sequence from broad (file discovery) to specific (symbol/usage). Form a hypothesis about where the code lives based on project structure and naming conventions.

3. Execute efficiently — parallelize. Independent searches have no dependency between them; issue them in a single batch rather than serially:

  • Glob to find files by name pattern.
  • Grep (ripgrep-backed) to find symbols, call sites, imports/exports, and patterns. Use -A/-B/-C for context, output_mode: "files_with_matches" to scope first, then narrow.
  • Trace imports/exports to map module relationships; check tests, configs, and docs for additional context.
  • When you need richer shell queries, Bash with rg / fd is available. If a language server is present, prefer findReferences/documentSymbol over text search to confirm real references vs. dead code.

4. Read selectively. Open only the relevant ranges — signatures and key logic, not whole files. Use line offsets to read the section that matters. Understand the relationships between components and the main execution flow before concluding.

5. Synthesize concisely. Lead with a direct answer. Back every claim with path:line references. Summarize the key functions/classes/logic, flag important dependencies and relationships, and for security or forensic work include a severity assessment and concrete mitigation. Suggest next steps only when they genuinely help.

  • Tag each finding with Confidence (High/Medium/Low — your certainty), kept separate from Severity (impact). State what would raise a Low to High.
  • Finding nothing is a valid, valuable result. If the code is correct, say so plainly with one verifying note. Never manufacture issues to look thorough.

6. Falsify before reporting. For each candidate finding, try to refute it by reading the actual code path — not the grep hit, the execution. Check guards, early returns, callers, and sanitizers that would make the issue unreachable or already-handled. Report only what survives; downgrade what you couldn't substantiate to "suspected" and say why. A plausible-looking match that you didn't trace to ground is not a finding.

Read the full file on GitHub · 75 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. 2d ago First seen · 75 lines · 75 tokens per session scan A 16fc6bfe44b3

Subscribe to this mod's changes

code-searcher is an agent published in the GitHub repository centminmod/my-claude-code-setup (2,610 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 1,518 once invoked, about $0.0004 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