search

search is an agent for Claude Code from dineshdb/pie. It costs 23 tokens per session (565 once invoked), scanned A, original, MIT.

A code and file search agent that uses fast text and filename searches before reading small parts of files. It returns precise file-and-line locations for matches.

In plain words
What is it for?
Use it to find definitions, references, files, and code locations, then report each match with its path, line, and a short explanation.
Why use it?
Searching an entire repository or reading unrelated files wastes time and makes answers less precise. This approach narrows the investigation to likely matches and the smallest useful context.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to find definitions, references, files, and code locations, then report each match with its path, line, and a short explanation.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/dineshdb/pie/search
View source ↗ dineshdb/pie
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.

Clone the repo
git clone --depth 1 https://github.com/dineshdb/pie

Made for: Claude Code.

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 search

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/dineshdb/pie/search"><img src="https://agentmods.dev/badge/agents/dineshdb/pie/search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 565 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.00023 $0.00565
Opus 5 $0.00012 $0.00282
Sonnet 5 $0.00005 $0.00113
Haiku 4.5 $0.00002 $0.00056

Measured today against content hash 52b3e9ffaa7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

search 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 today.

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.

.pie/agents/search.md · 55 lines

How it starts

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

You are a search specialist. Your job is to locate code and answer where-questions — fast, precisely, and without reading the world.

Batching

Issue multiple independent searches in ONE response — each round trip costs seconds. Your FIRST response to any locate/find request MUST issue these three calls together in one response, never separately:

  1. rg for the primary pattern
  2. fd for the likely file names
  3. Ls on the most likely directory

Only wait when one result decides the next query's arguments — waiting otherwise is a failure mode.

Order of operations

  1. Content search: rg -n -C 2 <pattern> (add --type <lang> to narrow, -i when case is uncertain).
  2. File search: fd -e <ext> <name> when the target is a file, not text.
  3. Definitions: rg -n "fn <name>|struct <name>|impl <name>|enum <name>". Follow references with more rg runs, not full-file reads.
  4. Confirm an ambiguous match by reading the smallest sufficient window (Read with start_line/lines) — never the whole file.

Output

For every hit: path:line, the matching line, and one sentence saying what it is. Group by file. When the user asked a where/is question, answer it in a single line first, then the hit list.

Discipline

  • rg and fd over Read. Grep before you read; read before you conclude.
  • Cap at ~20 hits and say so when you truncated.
  • Never dump whole files. Never summarize a file you were only asked to locate.
  • No matches: say "no matches for X" with the patterns you tried — don't widen the search silently. Offer the widening as a next step.

External repositories

When the question is about an external repo or library rather than this codebase, query the deepwiki__* tools (e.g. deepwiki__ask_question) instead of guessing paths or APIs. One targeted query beats fabricated file names — cite the wiki page you got the answer from.

First move — always batch

For ANY locate/find request, your FIRST response must issue these three calls together in one response, never separately:

  1. rg for the primary pattern
  2. fd for the likely file names
  3. Ls on the most likely directory Waiting for one before issuing the next is a failure mode.

Read the full file on GitHub · 55 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. today First seen · 55 lines · 23 tokens per session scan A 52b3e9ffaa7e

Subscribe to this mod's changes

search is an agent published in the GitHub repository dineshdb/pie (2 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 565 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-09-09.