search_codebase
Find code by concept, symbol, or path, returning ranked matches to pinpoint relevant files and symbols in a codebase.
Instructions
Find code by concept, symbol, or path — hybrid codebase search.
For QUESTIONS ("how does X work", "where is Y handled", "why is Z like
this"), call get_answer instead: it runs this same hybrid retrieval
internally and synthesizes a cited answer, so a search_codebase call
before get_answer is a wasted round-trip. Use this tool directly when you
want the raw ranked hits themselves — enumerating matches, resolving an
identifier to a symbol_id, or scoping a later get_context call.
mode="auto" (default) routes the query: identifier-shaped queries search
the indexed symbols (returns symbol_id/file/line bounds — pipe into
get_symbol), path-shaped queries resolve files (pipe into get_context),
and conceptual queries run wiki-semantic search. Mixed queries run hybrid,
symbol hits first. Decision records rank below file pages unless the query
is why-shaped.
`candidates` lists up to `limit` distinct openable file paths, best first.
Some results are pages, not files; this is what to Read.
Args:
query: identifier, path, or natural-language query.
limit: max results (default 5).
page_type: restrict to one page type. Common: file_page (per-file
docs, always present) or module_page (subsystem/concept pages).
Any stored type filters (repo_overview, layer_page, scc_page,
api_contract, infra_page, symbol_spotlight).
kind: implementation | test | config | doc (concept/symbol modes).
repo: alias, or "all" for workspace-wide.
mode: auto | concept | symbol | path | hybrid.
symbol_kind: filter symbol hits by kind (function|class|method|...).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| mode | No | auto | |
| repo | No | ||
| limit | No | ||
| query | Yes | ||
| page_type | No | ||
| symbol_kind | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |