search-code

search-code is a command for Claude Code from tomdwipo/claude-soul. It costs 0 tokens per session (445 once invoked), scanned A, original, MIT.

A repository search command that combines meaning-based matching with exact keyword search across source code and documentation. A repository is the project folder containing the code and its related files.

In plain words
What is it for?
Use it to investigate how a feature works, find related implementation or docs, and search projects written in any programming language.
Why use it?
It helps locate relevant code or documentation when you do not know the exact file, function, or wording to search for.

Command 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 commands/tomdwipo/claude-soul/search-code
Clone the repo
git clone --depth 1 https://github.com/tomdwipo/claude-soul

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-code

README.md
[![agentmods](https://agentmods.dev/badge/commands/tomdwipo/claude-soul/search-code.svg)](https://agentmods.dev/commands/tomdwipo/claude-soul/search-code)
Your own site
<a href="https://agentmods.dev/commands/tomdwipo/claude-soul/search-code"><img src="https://agentmods.dev/badge/commands/tomdwipo/claude-soul/search-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 445 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.00000 $0.00445
Opus 5 $0.00000 $0.00222
Sonnet 5 $0.00000 $0.00089
Haiku 4.5 $0.00000 $0.00044

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

Security

Grade A, and why

search-code 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 5d 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/commands/search-code.md · 31 lines

What it actually says

/search-code — semantic code + docs search (code-rag MCP)

Semantic + keyword search over this repository (source code and docs) via the local code-rag MCP tool (see tools/code-rag/). Natural-language query, any language.

Usage:

/search-code <query>
/search-code <query> | fast          # candidates=20 (~8s), quick lookup
/search-code <query> | deep          # candidates=80, top_k=25 (max recall, slower)
/search-code <query> | top_k=N candidates=M

What to do

  1. Parse $ARGUMENTS: text before | is the query; after | are options (fast, deep, or explicit top_k=N / candidates=M). 1b. Pick the server. If several code-rag-<folder> MCP servers exist (parallel checkouts), call the one whose <folder> matches the basename of the current repo root. If only a bare code-rag exists (single-stack), use that.
  2. Call the search_code MCP tool with query, and top_k/candidates only if the user gave options (defaults: candidates=50, top_k=15; fast→20; deep→80/25). If its schema is deferred, load it first (ToolSearch "select:mcp__code-rag*__search_code").
  3. Present ranked hits as path:start-end (clickable) + enclosing symbol + a 1-line why-it-matches; lead with the most relevant, summarize rather than dumping raw chunks. Read the top hits for depth.

If the tool errors / isn't connected

The local stack isn't running. Fall back to Grep/Glob, and tell the user: cd tools/code-rag && make up, then restart the agent so the code-rag MCP server connects. Full docs: tools/code-rag/README.md.

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. 5d ago First seen · 31 lines · 0 tokens per session scan A 3815eb722316

Subscribe to this mod's changes

search-code is a command published in the GitHub repository tomdwipo/claude-soul (24 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 445 tokens. 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.