codebase-search
Skill230 starsChanged 5 months agoMITView on GitHub
Task-specific semantic code and documentation retrieval. Use compact context for unfamiliar repository orientation, direct lookup for known definitions, graph tools for relationships, and grep for exhaustive literal matches.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- tmcfarlane/team-avatartheir own version, first seen Oct 20, 2026
- FilenCloudDienste/filen-rstheir own version, first seen Oct 9, 2026
- derheissenberg/applicaitontheir own version, first seen May 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- tmcfarlane/team-avatar★ 112same name
- FilenCloudDienste/filen-rs★ 104same name
- derheissenberg/applicaiton★ 2same 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.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codebase-searchSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Check index_status when readiness or freshness is unknown.
- Very specific: line 40
Use codebase_peek for semantic locations or codebase_search for matching content when needed.
- Very specific: line 41
Read known paths directly.
- Distinctive: line 81
Check if indexed and ready.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Codebase Search Skill
Important: Indexed Content
The indexed codebase contains two types of content:
- Project Source Code — all code files in the current workspace
- Knowledge Base Documentation — external documentation, usage guides, API references, and example programs added via
add_knowledge_base(MCP/OpenCode) orknowledge_base_add(Pi).
When to Use What
| Scenario | Tool | Why |
| Unfamiliar repository layout or subsystem | codebase_context | Compact orientation before broad reads |
| Code/library/API question | codebase_search | Search local knowledge first |
| Just need file locations | codebase_peek | Metadata only, saves ~90% tokens |
| Need to see actual code | codebase_search | Returns full code content |
| Find duplicates/patterns | find_similar | Given code snippet → similar code |
| Understand code flow | call_graph | Find callers/callees of any function |
| Trace dependency paths | call_graph_path | Find a shortest known path between two symbols |
| Analyze PR blast radius | pr_impact | Find affected symbols, communities, hub nodes, and risk |
| Don't know function/class names | codebase_context | Natural-language orientation with bounded evidence |
| Know a symbol and need its definition | implementation_lookup | Authoritative source without a context prerequisite |
| Need ALL occurrences | grep | Semantic returns top N only |
| Access specific URL | webfetch | Direct URL access, no codebase search needed |
| Local search fails | websearch | Fallback when codebase has no results |
| Local and web search fails | suggest adding knowledge base | Notify user to add related folder |
Task-specific Workflow
- Check
index_statuswhen readiness or freshness is unknown. Index only when missing, stale, or incompatible. - For unfamiliar repository orientation, use one compact
codebase_contextfirst pass (tokenBudget: 600,limit: 5) and inspect its evidence before broad reads or searches. - For known definitions, use
implementation_lookupdirectly. For callers/callees or dependency paths, usecall_graphorcall_graph_pathdirectly once endpoints are identified. - For known or suspected edit targets, optionally use
codebase_edit_contextfor bounded source plus direct graph evidence. - Use
codebase_peekfor semantic locations orcodebase_searchfor matching content when needed. Neither requires another context call when scope is already known. - Read known paths directly; use
grepfor exact identifiers and exhaustive literal matches. Apply directory/file filters when the scope is known, rather than guessing a narrower scope.
For repository implementation questions, use local source evidence before web search. External library/API documentation questions may need web sources when the local index lacks relevant documentation. Avoid repeating retrieval when existing evidence already answers the task.
Tools
codebase_peek
Find WHERE code is. Returns metadata only (file, line, name, type).
codebase_peek(query="validation logic", chunkType="function", directory="src/utils")
codebase_peek(query="authentication flow", blameAuthor="jane@example.com")codebase_search
Find code with full content. Use when you need to see implementation.
codebase_search(query="error handling middleware", fileType="ts", contextLines=2)
codebase_search(query="rate limiter", blameSince="2025-01-01", blameUntil="2025-01-31")find_similar
Find code similar to a given snippet. Use for duplicate detection, pattern discovery, refactoring.
find_similar(code="function validate(input) { return input.length > 0; }", excludeFile="src/current.ts", blameSince="2025-01-01")call_graph
Query callers or callees of a function/method.
call_graph(name="validateToken", direction="callers")index_codebase
Manually trigger indexing. Required before first search.
index_status
Check if indexed and ready.
MCP/OpenCode knowledge-base tools
add_knowledge_base(path="/path/to/docs")list_knowledge_basesremove_knowledge_base(path="/path/to/docs")
Pi knowledge-base tools
knowledge_base_add(path="/path/to/docs")knowledge_base_listknowledge_base_remove(path="/path/to/docs")
Query Tips
Describe behavior, not syntax:
- Good:
"function that hashes passwords securely" - Bad:
"hashPassword"(use grep for exact names)
Search across documentation:
- Good:
"how to configure WiFi in ESP-IDF" - Good:
"GPIO initialization example"
Filters
| Filter | Example |
chunkType | function, class, interface, type, method |
directory | "src/api", "tests" |
fileType | "ts", "py", "rs" |
blameAuthor | "jane@example.com" or "Jane Doe" |
blameSha | "abc1234" |
blameSince | "2025-01-01" |
blameUntil | "2025-01-31" |
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.

