Skip to content

Code Navigation Tools

Code navigation tools let agents read symbol source code, search indexed text with regex, trace call graphs, and orient on unfamiliar code — all without reading entire files.

Read a symbol’s source code span (start_line..end_line) without loading the entire file.

Accepts UIDs (sym:...), bare names, or FQNs. When ambiguous names match multiple symbols, candidate UIDs are returned for disambiguation.

ParameterTypeRequiredDescription
targetsstring[]YesSymbol UIDs (sym:...), names, or FQNs to read.
include_neighborsintegerNoInclude N adjacent symbols in the same file. Default 0.
token_budgetintegerNoApproximate token cap for the combined output.
rootstringNoRepository root for resolving file paths. Default: server working directory.

Run a Rust regex against indexed text (section bodies, note titles, symbol signatures) with trigram-accelerated pre-filtering.

Use for exact pattern matching. For fuzzy or semantic lookup, use brain_search instead.

ParameterTypeRequiredDescription
patternstringYesRust regex pattern. Example: "fn\\s+authenticate" or "(?i)todo".
path_prefixstringNoRestrict to nodes whose file path starts with this prefix.
kindsstring[]NoRestrict to these node kinds: Section, Note, Symbol (case-insensitive).
limitintegerNoMaximum results to return. Default: unlimited (capped by candidate budget).
max_millisintegerNoWall-clock time budget in milliseconds. Default 2000.

Count regex matches across indexed text without returning the matches themselves. Useful for frequency analysis and comparing pattern prevalence.

ParameterTypeRequiredDescription
patternsstring[]YesOne or more Rust regex patterns to count.
path_prefixstringNoRestrict to nodes whose file path starts with this prefix.
kindsstring[]NoRestrict to these node kinds: Section, Note, Symbol (case-insensitive).

Returns per-pattern {pattern, total_matches, files_matched, top_files: [{path, count}]}.

Trace forward execution flow from a symbol: what it calls, what those call, and so on. Returns a tree of callees.

Best for tracing from entry points (main, request handlers) to understand execution paths. For reverse dependencies (“what calls this?”), use brain_impact instead.

ParameterTypeRequiredDescription
symbolstringYesSymbol name (e.g. "handleRequest") or full UID to trace from.
max_depthintegerNoMaximum traversal depth. Default 10.
response_formatstringNo"concise" returns function name chain only; "detailed" (default) adds file paths, UIDs, and depth.

Classes are auto-expanded to their methods since classes have no direct CALLS edges.

Orient on an unfamiliar topic in one call: runs hybrid PPR+BM25 retrieval, groups results into architectural domains, inlines high-confidence source bodies, and returns a token-budgeted map with a bundle_id for drill-down.

ParameterTypeRequiredDescription
querystringYesThe topic, feature, or subsystem to orient on (e.g. "device pairing", "how indexing works").
scopestringNoOptional scope: "project:<slug>", "repo:<name>", or "vault"/"all" (default = no restriction).
token_budgetintegerNoApproximate token cap for the map (chars / 4). Default 4000. Hard-capped at 16000.
rootstringNoFilesystem root for reading inline source bodies.

Drill into entries with investigate_expand (by asset_id) or fill all bodies with investigate_hydrate.

Drill into specific investigate map entries: fetch full source bodies and immediate neighbors (callers/callees for symbols, wikilink sources for notes).

ParameterTypeRequiredDescription
bundle_idstringYesThe bundle_id returned by a prior investigate call.
targetsstring[]Yesasset_id values from the investigate map, or raw node UIDs to expand.
rootstringNoFilesystem root for reading source bodies.

Expanded entries always have body_complete: true (full untruncated body). Bundles expire 24 hours after creation.

Fill in source bodies for all un-hydrated entries in an investigate bundle. This is the bulk version of investigate_expand, bounded by a token budget.

ParameterTypeRequiredDescription
bundle_idstringYesThe bundle_id returned by a prior investigate call.
token_budgetintegerNoApproximate token cap for hydrated bodies (chars / 4). Default 4000. Hard-capped at 16000.
rootstringNoFilesystem root for reading source bodies.

Entries with body_complete: true have the full source inlined. Entries with body_complete: false were truncated; use read_symbols for the rest.