> ## Documentation Index
> Fetch the complete documentation index at: https://docs.v3code.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Context Bridge

> LSP-backed structural intelligence for the agent.

Most AI editors hand the model a pile of text and hope the right lines are in it. V3Code ships **Context Bridge**: a set of native, language-server-backed tools the agent calls to navigate your codebase structurally — definitions, callers, callees, references, type hierarchies, dependency graphs, and persistent notes. It's compiled into the editor, always on, and nothing leaves your machine.

## 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 string `handleAuth`" 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_modules` or a `lib.*.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

<ParamField path="get_file_context" type="{ filePath }">
  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.
</ParamField>

<ParamField path="get_file_dependencies" type="{ filePath }">
  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.
</ParamField>

<ParamField path="get_symbol_context" type="{ filePath, symbolName }">
  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.
</ParamField>

<ParamField path="get_call_graph" type="{ filePath, symbolName, direction, depth }">
  A recursive caller/callee tree, `depth` 1–4 (clamped). Cycles are de-duplicated; stdlib/dependency nodes are skipped so the tree stays actionable.
</ParamField>

<ParamField path="pack_context" type="{ filePath, symbolName, task, maxTokens }">
  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.
</ParamField>

<ParamField path="get_project_briefing" type="{ includeNotes }">
  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.
</ParamField>

### Notes (persistent memory)

<ParamField path="remember" type="{ filePath, symbolName, note }">
  Attach a durable note to a symbol. Survives across sessions. Stored in `.v3code/notes.json` in the workspace. Requires approval.
</ParamField>

<ParamField path="forget" type="{ noteId }">
  Remove a note by id. Requires approval.
</ParamField>

<ParamField path="list_notes" type="{ filePath | null }">
  List notes for a file, or all workspace notes when `null`.
</ParamField>

### Search

<ParamField path="find_text" type="{ query, isRegex, includePattern, pageNumber }">
  Grep with context and paging — exact/regex text search across the workspace.
</ParamField>

<ParamField path="semantic_search" type="{ query, topK, includeFile, rerank }">
  Meaning-based search over the local [semantic index](/editor/semantic-index). Returns ranked hits with the index state; optional rerank pass. See that page for how ranking works.
</ParamField>

<Note>
  `remember` / `forget` / `list_notes` are the storage layer under [Memory](/editor/memory). `semantic_search` is the query layer over the [Semantic index](/editor/semantic-index). Context Bridge is the connective tissue that makes both structural.
</Note>

## Bring Context Bridge to any agent

Context Bridge isn't locked inside V3Code's own chat. The same tools can be exposed over a single MCP endpoint so Claude Code, Cursor, or any MCP client gets the same structural view of your codebase. See [Bring V3Code to any agent](/connect/other-agents).

## Your code stays local

Every tool here runs on your machine against your own language server and files. The only network traffic V3Code makes is the model calls you choose, with your own keys. See [Privacy](/account/privacy).
