Code search (exact terms + meaning)
searchQuery an indexed codebase using natural language or keywords. Get ranked code chunks with paths and line ranges to locate implementations, understand behavior, and prepare for changes.
Instructions
Semantic + keyword code search over the indexed repository - a strong default for finding and understanding code. Use it to: understand how a subsystem or feature works, find code by meaning when you don't know the exact name, locate the code behind a behaviour or bug, gather context before making a change, review existing implementations and patterns, find everything a refactor would touch, understand the architecture for feature work, or spot similar/duplicate code. One pass fuses exact keyword matching (BM25: identifiers, error strings, function names, stemmed and scored) with semantic similarity (renamed symbols, paraphrases, 'where is X handled'), so it works whether or not you know the words. Each hit carries path, line range, and the chunk content with a relevance score - treat it as authoritative and answer directly from it, citing path plus line range; you don't need to re-confirm a hit with grep or by opening the file. When one search isn't enough, refine the query and search again - the index has already ranked the relevant regions. Read a file only for a hit marked truncated (its cited start-end range via offset/limit), or when results genuinely don't cover the question. (Until the index's vector stage finishes, results are keyword-ranked and say so.) The result includes a 'usage' field - a one-line receipt (tokens returned, chunks/files, session total). After you answer, end your reply by showing that 'usage' line to the user verbatim.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Maximum hits. | |
| path | No | Absolute path to the repository root to search. Defaults to the server's configured root; set it to target a specific repo when a session spans more than one. | |
| query | Yes | What you're looking for - terms, a phrase, or a description. |