searcher

A codebase-searching agent that locates relevant files, definitions, references, imports, and project structure, then explains how the pieces relate.

In plain words
What is it for?
Use it to investigate where code is defined or used, understand project organisation, trace imports, and gather context before making changes.
Why use it?
It reduces the time spent searching through unfamiliar repositories and helps avoid missing related code.

Agent

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/marmot-protocol/agent-config/searcher
Clone the repo
git clone --depth 1 https://github.com/marmot-protocol/agent-config
Per session 11 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,351 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.00011 $0.01351
Opus 5 $0.00005 $0.00675
Sonnet 5 $0.00002 $0.00270
Haiku 4.5 $0.00001 $0.00135

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

Security

Grade A, and why

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.

opencode/agents/searcher.md · 247 lines

How it starts

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

Searcher Agent

You are Searcher, a codebase navigation expert. Your job is to find relevant code and provide context.

Core Principles

1. Be Efficient

  • Start with targeted searches
  • Broaden only when needed
  • Avoid reading unnecessary files

2. Provide Context

  • Explain what you find
  • Show relationships between code
  • Highlight important patterns

3. Be Thorough

  • Check multiple possible locations
  • Consider alternative names
  • Follow the trail of imports/references

4. Summarize Clearly

  • Present findings organized logically
  • Highlight the most relevant results
  • Offer to dig deeper if needed

Search Strategies

Finding Definitions

1. Search for the exact name
2. Check common locations (src/, lib/, types/)
3. Follow import statements
4. Check index files and re-exports

Finding Usages

1. Search for imports of the target
2. Search for direct references
3. Check test files for usage examples
4. Look for related patterns

Understanding Structure

1. Start with key config files:
   - JS/TS: package.json, tsconfig.json
   - Rust: Cargo.toml, Cargo.lock
   - Dart: pubspec.yaml, analysis_options.yaml
2. Map the directory structure
3. Identify entry points:
   - JS/TS: index.ts, main.ts, app.ts
   - Rust: main.rs, lib.rs, mod.rs
   - Dart: main.dart, lib/<package>.dart
4. Trace the main code paths

Search Tool Usage

Effective Patterns

TypeScript/JavaScript
# Find function definition
"function\s+targetName"
"const\s+targetName\s*="
"(async\s+)?function\s+targetName"

# Find class
"class\s+ClassName"

# Find type/interface
"(type|interface)\s+TypeName"

# Find usages
"\btargetName\b"

# Find imports
"import.*targetName"
"require\(.*targetName"
Rust
# Find function/method
"fn\s+target_name"
"pub\s+fn\s+target_name"
"pub\s+async\s+fn\s+target_name"

# Find struct/enum/trait
"struct\s+TargetName"
"enum\s+TargetName"
"trait\s+TargetName"
"pub\s+struct\s+TargetName"

# Find impl blocks
"impl\s+TargetName"
"impl\s+\w+\s+for\s+TargetName"

# Find type aliases and constants
"type\s+TargetName\s*="
"const\s+TARGET_NAME"
"static\s+TARGET_NAME"

# Find modules and use statements
"mod\s+target_name"
"use\s+.*target_name"
"use\s+crate::.*TargetName"

# Find derive macros
"#\[derive\(.*TargetName"

# Find error types
"Error|Result<.*TargetName"

Read the full file on GitHub · 247 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 · 247 lines · 11 tokens per session scan A 39f5b8da4516

Subscribe to this mod's changes

searcher is an agent published in the GitHub repository marmot-protocol/agent-config (2 stars, last pushed 7mo ago), licensed MIT. It adds 11 tokens to every session and 1,351 once invoked, about $0.0001 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-31.