semantic-search
Skill4 starsChanged 16 days agoMITView on GitHub
Find code by the words it uses with the semantic-code MCP server's search_code, and know when Grep or Read serves better. Use when you look for behaviour, a concept or a definition in a project's Python, Rust or Markdown files.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- myths-labs/musetheir own version, first seen Nov 6, 2026
- wrg32786/aigent-ostheir own version, first seen Oct 13, 2026
- stevemarksava/superteamtheir own version, first seen Sep 4, 2026
- ZhuBit/cowork-semantic-searchtheir own version, first seen Mar 24, 2026
- ahmedibrahim085/Claude-Multi-Agent-Research-System-Skilltheir own version, first seen Dec 10, 2025
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- myths-labs/muse★ 38same name
- ZhuBit/cowork-semantic-search★ 28same name
- wrg32786/aigent-os★ 25same name
- ahmedibrahim085/Claude-Multi-Agent-Research-System-Skill★ 11same name
- stevemarksava/superteam★ 1same 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 repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
If the tools are missing, tell the user the server is not installed and point them to semantic-code-mcp's README …
- Very specific: line 50
Write query in the words the code would use: identifiers, their parts, the domain's terms.
- Very specific: line 90
Ask include_debug=true only when a search was slow or odd: debug then holds timings (embedding_ms, search_ms, total_ms, and indexing_ms …
- Very specific: line 100
Call index_codebase with force=true only when results point at code that is gone: it reads every file again, and on a server set to search …
- Very specific: line 106
Call index_status to see which root a directory belongs to and what built its index, not before every search.
“Common” is measured: kept by at least 6 in 10 of the 5 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
The semantic-code server splits a project into functions, classes, methods, module docstrings and document sections and finds them by the words their code uses, ranked, the chunks named as the query first. It answers what Grep cannot: the few chunks that best match, not every line. It does not answer what Grep does better.
1. Which tool
| You want | Use |
| a string, a regex | Grep |
| the definition of a name you know | search_code with the name |
| every call site of a name | Grep: search_code returns its best matches only |
| a file whose path you know | Read |
| behaviour you can describe but not name | search_code |
| a concept spread over several files | search_code, then Grep the names it shows |
| a language the server does not index | Grep |
The loop that works: search_code → Read the line range of the best hit → Grep the names
you found there.
The server indexes Python, Rust and Markdown files: languages takes python, rust
and markdown.
2. Before the first search
project_pathis absolute. Give the repository's root, or a directory inside it to keep the search to that directory: the repository keeps one index either way, andproject_rootin the answers ofindex_statusandindex_codebasenames it (a directory the repository ignores, or one in a repository that holds the home directory, is a project of its own, and names itself). Left out, it is the client's workspace root, the directory Claude Code was started in, which must lie in a git repository: a folder of projects, or the home directory, would be indexed as one. Give it whenever the work lies outside that directory or outside any repository; a client that names no single root, or a root no repository holds, gets an error asking forproject_path.- The first call indexes the whole project's words, seconds even on a large one; on a server its user set to search by meaning too, the first search also embeds every chunk, minutes on a large one and about an hour on one of 90k chunks, with progress. Wait for it; do not call again while it runs.
- If the tools are missing, tell the user the server is not installed and point them to semantic-code-mcp's README (github.com/vrppaul/semantic-code-mcp); do not install it yourself.
3. Phrasing a query
Write query in the words the code would use: identifiers, their parts, the domain's
terms. On a miss, search again with other words. Name no file: narrow with path_glob
instead.
| Works | Does not |
| "retry backoff delay attempts" | "how does the code work" — no word of the code |
| "parse_args config options" | "progress stuff in utils.py" — a file name |
| "release lock write error" | "the thing that handles it" — no concept |
A name, bare or qualified, as greet or Stack.push, brings the chunks of that name
first. For every place a name is used, Grep.
4. Narrowing a search
chunk_kinds:module,function,method,class,section. Rust's structs, enums, traits and impls are classes; a Markdown heading with its text is a section.languages:python,rust,markdown.path_globandexclude_glob, read as in a.gitignore, from the directoryproject_pathnames:exclude_glob="tests"leaves out everytestsdirectory,path_glob="src/**/*.py"keeps to Python undersrc. A glob with a character class, braces, an escape, a leading!or..is refused, with the reason.limit: how many results at most; the tool's schema gives its default and its cap.
5. Reading the answer
search_code returns project_root, the project's root (its repository's, or outside
git the directory itself), and
searched_directory, the directory it kept to: where the two differ, nothing outside
searched_directory was searched, and project_root as project_path searches it all.
Then results, best first. Each has:
file_path(absolute),line_start,line_end: Read that range for the whole chunk;name,kind, andparent: the class, impl, module or heading it sits in, asStackforStack.pushorGuide > Installfor a section;content, cut at a limit of lines;truncatedsays it was cut: Read the range before quoting.
A search can return nothing: that is an answer, not a failure.
Ask include_debug=true only when a search was slow or odd: debug then holds
timings (embedding_ms, search_ms, total_ms, and indexing_ms where it indexed
first), stats (results_count, filtered_out, the hits a server set to search by
meaning too dropped below its similarity floors, unique_files, tokens_estimate) and indexing, what the search indexed before it
searched (files_indexed, chunks_indexed).
6. The index
- Each search first re-indexes the files changed since the last; you never need to index before searching.
- Call
index_codebasewithforce=trueonly when results point at code that is gone: it reads every file again, and on a server set to search by meaning too, a model whose weights nothing pins has its vectors dropped, so the next search embeds every chunk again; renames and deletions need nothing. It answersproject_root,files_indexed,chunks_indexed,files_deletedandduration_seconds. - Call
index_statusto see which root a directory belongs to and what built its index, not before every search. It answersproject_root,is_indexed,last_updated,files_count,chunks_count,embedded_chunks_count(the chunks a server set to search by meaning too reads without embedding first) and themodelwhose vectors it counts (model_name,model_revision,embedder_version),stale_files_count, themanifestof what built the index (chunker_version,schema_version), andbeing_built: a run, this session's or another's, holds the index now, so the counts may be what it has written so far; a search waits for it, so do not take the index for broken. - Each chunker version keeps an index of its own, built once on the first search after a change, and each model's vectors are kept apart in it; an index no session used for a week is removed.
- In a git repository, git lists the files: tracked ones, and untracked ones
.gitignoredoes not exclude. The server's settings are its environment's, which the user sets, not a tool's parameters: a repository whose.gitignorehides source on purpose needsuse_gitignoreoff (SEMANTIC_CODE_MCP_USE_GITIGNORE=false), so ask the user for it; withlocal_indexthe index lives in.semantic-code/inside the project; withSEMANTIC_CODE_MCP_SEARCH_MODE=words_and_meaningevery search searches by meaning too, where the server was installed with its extrasemantic-code-mcp[meaning]; without it the server does not start.
7. Traps already met
- A
project_pathone level too deep, or a session started in a subdirectory, keeps the search to that directory, and the answer in the directory above never comes back.searched_directoryshows it; search fromproject_rootwhen unsure. - A glob reads from the directory searched: from inside
src,src/**/*.pynamessrc/src/...and finds nothing; write**/*.py, or search from the root. - By words, a chunk that repeats the query's words can rank above the one that does what it asks; search again with the code's own terms.
- A query that names a file finds chunks that mention the file. Use
path_glob. - A class's chunk holds its methods too, so a class and one of its methods can both come back for one question; the method's chunk is the narrower answer.
- A module's docstring can come first for a question about the module; the code that does the work is usually the next hit of the same file.
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.

