Why it’s built in, not bolted on
Context Bridge is native — not an MCP server, not an external process, no daemon to start and no path to configure. The language-server bridge lives inside the V3Code binary. Open a project and the agent can already navigate it: it asks the same TypeScript/LSP services your editor uses, in process. That’s the difference between “find the stringhandleAuth” and “show me every caller of handleAuth, its type hierarchy, and the two diagnostics on its signature.” The agent traces real edges instead of guessing from text — so when you ask what breaks if I change this, it already has the map.
Two design choices keep the output high-signal:
- Stdlib and dependency noise is filtered. Callers/callees that resolve into
node_modulesor alib.*.d.ts(Promise.all, Array.filter, and friends) are dropped — they’re never actionable and they eat the token budget real edges need. - Syntactic fallback when the language server is cold. If the TS server hasn’t analyzed a file yet, Context Bridge returns a top-level declaration scan so a real code file never looks symbol-less, and flags it so the agent knows to retry once the server is warm.
The 11 tools
Context Bridge exposes eleven tools in three groups. Write-side note tools require approval; reads are unrestricted.Structural & briefing
A file’s structural map — its symbols, imports (text-parsed, always available), and diagnostics. Function-local variables are stripped so the outline is the top-level + member skeleton, not every loop counter.
Direct imports (resolved to files), external packages ranked by frequency, and — the useful half — everything that imports this file back (
importedBy). Scans up to 2000 workspace source files.A symbol’s full neighborhood: definition snippet, callers, callees, references, nearby diagnostics, supertypes/subtypes (for class/interface/enum/type), and any persistent notes attached to it. Resolves via LSP, falls back to text.
A recursive caller/callee tree,
depth 1–4 (clamped). Cycles are de-duplicated; stdlib/dependency nodes are skipped so the tree stays actionable.A token-budgeted bundle for a symbol, shaped by
task — understand, refactor, debug, or extend — each with different caps on callers/references/snippet size. Trims to fit maxTokens (references first, then caller snippets) and reports what it dropped.A session-opening orientation: pulls
Recent Changes / Session Memory sections from AGENTS.md (or .github/AGENTS.md / copilot-instructions.md), a depth-3 curated file tree, the last ~20 git commits, and optionally your saved notes. This is how the agent starts already knowing the project.Notes (persistent memory)
Attach a durable note to a symbol. Survives across sessions. Stored in
.v3code/notes.json in the workspace. Requires approval.Remove a note by id. Requires approval.
List notes for a file, or all workspace notes when
null.Search
Grep with context and paging — exact/regex text search across the workspace.
Meaning-based search over the local semantic index. Returns ranked hits with the index state; optional rerank pass. See that page for how ranking works.
remember / forget / list_notes are the storage layer under Memory. semantic_search is the query layer over the Semantic index. Context Bridge is the connective tissue that makes both structural.