code-search
Skill8 starsChanged 8 months agoMITView on GitHub
This skill should be used when the user asks to "search code", "find in files", "grep for", "look for pattern", "search the codebase", "find references to", "find usages of", "search for function", "find where X is defined", or needs to search file contents across a directory tree. Provides guidance on using the search_code MCP tool for fast indexed code search.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- langwatch/langwatchtheir own version, first seen Oct 17, 2026
- elastic/sourcerertheir own version, first seen Oct 13, 2026
- gitextensions/gitextensionstheir own version, first seen Oct 8, 2026
- jmylchreest/aidetheir own version, first seen Aug 21, 2026
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
- EasyJoy-Technologies/openclaw-skillstheir own version, first seen Apr 1, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- gitextensions/gitextensions★ 8.6ksame name
- langwatch/langwatch★ 5ksame name
- kunwl123456/zeroclaw-skills-collection★ 27same name
- elastic/sourcerer★ 20same name
- jmylchreest/aide★ 19same name
- brettatoms/agent-skills★ 3same name
- EasyJoy-Technologies/openclaw-skills★ 1same name
- Jinbae10/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Prefer the search_code MCP tool over the built-in Grep tool when searching file contents across a directory tree.
- Distinctive: line 77
If an index exists for the target path, use qgrep
- Distinctive: line 78
If the repo has 15k+ files and no index, build one automatically
- Very specific: line 82
No manual index management is needed for typical usage.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Indexed Code Search
This skill provides fast indexed code search via the search_code MCP tool, which is up to 300x faster than standard grep on large codebases.
When to Use search_code
Prefer the search_code MCP tool over the built-in Grep tool when searching file contents across a directory tree. The search_code tool automatically selects the fastest backend:
- On large repos (15k+ files), it builds and uses a qgrep index. Searches complete in ~10ms instead of ~3-25s
- On small repos (< 5k files), it transparently falls back to ripgrep
- In the gray zone (5k-15k files), it measures ripgrep latency and indexes if beneficial
Available MCP Tools
search_code
Primary search tool. Supports regex patterns, glob filters, case-insensitive search, and context lines.
search_code(pattern="impl Iterator for", path="/path/to/repo")
search_code(pattern="TODO|FIXME", path="/path/to/repo", case_insensitive=True)
search_code(pattern="class.*Handler", path="/path/to/repo", glob="*.py")
search_code(pattern="fn main", path="/path/to/repo", output_mode="files_with_matches")Parameters:
pattern(required): Regex pattern to search forpath(required): Absolute directory path to search inglob: Filter files (e.g."*.py","*.{ts,tsx}")case_insensitive: Case-insensitive search (default: false)output_mode:"content"(default),"files_with_matches", or"count"context_lines: Lines of context around matchesmax_results: Maximum result lines (default: 200)
build_search_index
Manage the search index lifecycle. Build an index before searching to get maximum speed.
build_search_index(action="build", path="/path/to/repo")
build_search_index(action="status", path="/path/to/repo")
build_search_index(action="rebuild", path="/path/to/repo")
build_search_index(action="delete", path="/path/to/repo")search_estimate
Analyze a directory and get an indexing recommendation with stats.
search_estimate(path="/path/to/repo")Returns file count, current search latency stats, and whether building an index is worthwhile.
Performance Characteristics
Based on benchmarks against rust-lang/rust (58,534 files):
| Backend | Avg latency | When used |
| qgrep (indexed) | ~12ms | Index exists or auto-built for large repos |
| ripgrep (fallback) | ~2.9s | Small repos, glob filters, context lines |
Index build is a one-time cost (~7s for 58k files) that pays for itself after ~3 searches.
Automatic Behavior
The search_code tool handles backend selection automatically:
- If an index exists for the target path, use qgrep
- If the repo has 15k+ files and no index, build one automatically
- For glob filters or context lines, use ripgrep (qgrep limitation)
- For small repos, use ripgrep directly (fast enough)
No manual index management is needed for typical usage. Just call search_code and it handles the rest.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

