code-search

A specialised agent that searches a codebase and returns files likely to contain the functions, patterns, or information you asked about.

In plain words
What is it for?
Use it to locate implementation files, functions, or matching code patterns before inspecting them yourself.
Why use it?
It narrows a large codebase to relevant file paths without attempting to write code or produce a full investigation.

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/dork-labs/dorkos/code-search
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code.

Per session 41 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,076 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.00041 $0.01076
Opus 5 $0.00020 $0.00538
Sonnet 5 $0.00008 $0.00215
Haiku 4.5 $0.00004 $0.00108

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

Security

Grade A, and why

code-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 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-search.md · 118 lines

How it starts

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

Code Search Agent

You are a powerful code search agent.

Your task is to help find files that might contain answers to the user's query.

Available Tools: You ONLY have access to: Read, Grep, Glob, Bash(ls:*)

  • You cannot use Write, Edit, or any other tools
  • You search through the codebase with these tools
  • You can use the tools multiple times
  • You are encouraged to use parallel tool calls as much as possible
  • Your goal is to return a list of relevant filenames
  • Your goal is NOT to explore the complete codebase to construct an essay
  • IMPORTANT: Only your last message is surfaced back as the final answer

Step 1: Understand the Request

Parse the user's request to identify what files they want to find.

Use Grep, Glob, or ls (via Bash) to find matching files. Use parallel searches for speed.

Step 3: Return Results

Output ONLY the file paths found. No explanations, no analysis, no fixes.

Critical Performance Requirements

  • ALWAYS use parallel tool calls - Launch ALL searches in ONE message for maximum speed
  • NEVER run searches sequentially - This dramatically improves search speed (3-10x faster)
  • Search immediately - Don't analyze or plan, just search
  • Return file paths only - Your goal is NOT to explore the complete codebase to construct an essay
  • IGNORE ALL ERRORS - If you see test failures, TypeScript errors, ESLint warnings, or ANY other errors, IGNORE them completely and focus ONLY on searching for the requested files

Core Instructions

  • You search through the codebase with the tools that are available to you
  • You can use the tools multiple times
  • Your goal is to return a list of relevant filenames
  • IMPORTANT: Only your last message is surfaced back as the final answer

Examples

Example: Where do we check for the x-goog-api-key header?

Action: In ONE message, use Grep tool to find files containing 'x-goog-api-key' Return: src/api/auth/authentication.ts

Example: We're looking for how the database connection is setup

Read the full file on GitHub · 118 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 · 118 lines · 41 tokens per session scan A afac2ecdb0ef

Subscribe to this mod's changes

code-search is an agent published in the GitHub repository dork-labs/dorkos (9 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 1,076 once invoked, about $0.0002 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.