senkani_search
Live
Replaces
Grep
Savings 99%
Symbol lookup from the local tree-sitter index, BM25-ranked and FTS5-backed. Returns `file:line`, kind, container — ~50 tokens vs ~5,000 for grepping.
Signature
senkani_mcp.call(tool="senkani_search", args={...})
Behavior
In-memory `IndexEntry` array backed by FTS5 + optional RRF fusion with MiniLM file embeddings. Substring match on symbol names; `--kind`/`--file`/`--container` filters narrow results. The hook intercepts plain-identifier Grep calls and routes them here automatically.
Inputs
Name
Type
Default
Description
query
string
—
Symbol name or prefix. Supports substring match; not a full regex.
kind
string
any
Filter: `class`, `function`, `method`, `struct`, `enum`, `type`, `constant`, `variable`.
file
string
any
Restrict results to files matching this glob.
container
string
any
Restrict to symbols inside this container (e.g., class name).
limit
integer
20
Max results.
Output
List of `{{name, kind, file, line, end_line, container, score}}`. Sorted by BM25+RRF score.
Example
{"tool": "senkani_search", "args": {"query": "OrderRepository"}}
// returns ~50 tokens:
[{"name":"OrderRepository","file":"src/orders/repo.ts","line":12,"kind":"class"}]
Details
FTS5 operator syntax is stripped from the query before execution (prevents FTS injection). The index rebuilds incrementally via FSEvents; cold search < 5 ms, cached < 1 ms. 25 tree-sitter grammars supply the symbol extraction.
Search queries never reach the model — only sanitized outputs do.
See also
senkani_fetch— Read a symbol's source after finding it.senkani_outline— All symbols in a file, no query.Indexer toggle (I)— Disable the indexer per-pane.Symbol indexer concept— How the index is built.
Source:
Sources/MCPServer/Tools/SearchTool.swift + Sources/Indexer/