Two tools
codebase_search ranks chunks with BM25. find_related starts from a file and a line you already trust.
Local BM25 search for agents. Ranked chunks, on the machine, with no API key and no vector database.
Locus indexes the repository on the machine and returns the path, the line range, the symbol, and the chunk text. The ranker is BM25. The tool route id rust-tfidf is the historical name of that path, not a TF-IDF score.
A path that contains the word, with no line range, no symbol, and no reason it ranked above the next file.
path, startLine, endLine, symbol, BM25 score, and the chunk text. Filters run before limit.
{
"query": "authenticate request",
"limit": 5,
"file_extensions": ["ts"],
"path_filter": "src/auth",
"exclude_paths": ["src/auth/legacy"]
}login does not match authenticate. Pass an absolute --root. Locus will not search the process working directory. The response field route is the string rust-tfidf.
One npx line with an absolute --root. A stdio MCP server starts for Claude, Cursor, VS Code, Codex, or any other MCP client. No API key.
codebase_search refreshes the local index, scores every chunk that passes the filters, then cuts to limit. The default limit is 10.
find_related takes the repo-relative path and a line from that hit. It ranks other chunks by token overlap. It does not run BM25.
There is no search profile named auto, and there is no embedding path hiding behind the lexical one.
BM25 over symbol and file chunks. k1 is 1.2 and b is 0.75. Document frequency comes from the whole index, even when a path filter is set.
Starts from a chunk whose line range contains the line you pass. Other chunks are scored by shared tokens. The route id is rust-related.
file_extensions, path_filter, and exclude_paths choose the candidates. limit is applied after the score sort.
.json is not an indexed extension..locus/rust-index.json. .coderag/ is read only when that file is absent.Skipped directory segments are node_modules, dist, target, and .git. This is not gitignore. A missing token is an empty result list, not a guessed synonym.
npx -y @sylphx/locus --root=/absolute/path/to/project{
"mcpServers": {
"locus": {
"command": "npx",
"args": ["-y", "@sylphx/locus", "--root=/absolute/path/to/project"]
}
}
}claude mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/projectcodex mcp add locus -- npx -y @sylphx/locus --root=/absolute/path/to/projectNo API key. codebase_search and find_related are the whole tool surface.