Repo-bound, local-first code indexing and MCP context for structural code exploration.
vtrace builds a deterministic index for a local repository, exposes CLI, MCP, and private/local VS Code surfaces, and gives you practical commands for setup, status, context packaging, skeleton views, impact graphs, and other bounded structural analysis.
It is designed for coding agents and human operators that need compact, inspectable repository context without sending the project through a remote indexing service.
Use vtrace when you want:
- a repo-local structural index instead of a remote service
- deterministic outputs you can inspect and reproduce
- a stable MCP server for Claude Code or Codex
- compact task context for coding sessions
- conservative answers about file structure, symbol impact, and symbol-to-symbol paths
vtrace is intentionally structural. It does not pretend to do runtime tracing, semantic dataflow, or fuzzy architectural guessing.
- Bun installed locally
- a local repository to index
- Claude Code or Codex only if you want MCP config installed automatically
Clone the repo and install dependencies:
git clone <repo-url> vtrace
cd vtrace
bun installRun the local wrapper directly from the repo:
./bin/vtrace --helpIf you put vtrace on your PATH, you can drop the ./bin/ prefix in the examples below.
Replace /path/to/your/repo with the repository you want to inspect.
Set up a repo for vtrace:
./bin/vtrace setup /path/to/your/repo
./bin/vtrace status /path/to/your/repoInspect structure directly from the shell:
./bin/vtrace skeleton /path/to/your/repo src/controller.ts
./bin/vtrace impact-graph /path/to/your/repo "src/session.ts::SessionManager.createSession"
./bin/vtrace intent /path/to/your/repo "trace how sessions are created"
./bin/vtrace capsule /path/to/your/repo "smallest safe edit surface for session creation"Launch the repo-bound MCP server manually when needed:
./bin/vtrace mcp-serve --repo /path/to/your/repoIn normal use you usually do not run mcp-serve yourself after setup. Claude Code and Codex launch it through the installed MCP config.
The main user-facing shell commands are:
| Command | Purpose |
|---|---|
setup |
Initialize repo-local state, build or refresh the index, install agent config, and optionally start the daemon. |
status |
Show compact readiness and freshness state. |
doctor |
Run a more detailed readiness and runtime inspection. |
claude-config |
Install or preview Claude Code or Codex MCP config. |
daemon |
Manage the optional background runtime lifecycle. |
watch |
Mark the index stale when indexed source files change. |
workspace |
Create, update, list, and inspect .vtrace/workspace.json. |
mcp-serve |
Start the repo-bound MCP server entrypoint. |
There are also direct inspection commands for manual flows:
indexintentcapsuleskeletonimpact-graphhandoffrunsrulescheck-capsulerun-pipelineexpand-vexp-ref
The default MCP tool is run_pipeline.
Use the specialized tools when the question becomes narrower:
get_context_capsule: compact task context onlyget_skeleton: cheap file shapeget_impact_graph: structural blast radiussearch_logic_flow: bounded path between two exact symbol FQNssearch_memory/get_session_context: continuityindex_status/workspace_setup: health and setupsave_observation: durable memoryexpand_vexp_ref: resolve exact deferred V-REF hashes from the current process hot cache or retained repo-local stored payloads
For the practical tool-by-tool guide, see MCP Tool Cheat Sheet.
setup installs MCP config for the selected shell agent.
Supported agents:
claude-code(default)codex
Examples:
./bin/vtrace setup /path/to/your/repo --agent codex
./bin/vtrace claude-config /path/to/your/repo --agent codex --dry-runThe command name stays claude-config for compatibility even when you target Codex.
vtrace keeps repo-local state under .vtrace/:
.vtrace/config.json: repo-local config and resolved paths.vtrace/state.json: readiness, latest run, and freshness metadata.vtrace/index.sqlite: the repo-local SQLite index, including bounded persisted V-REF payloads.vtrace/workspace.json: optional multi-repo workspace config
Repeated setup is safe. If the repo is already ready, vtrace reuses the current state conservatively.
vtrace is currently distributed as a local-source install. The supported install path today is cloning this repository, running bun install, and using the repo-local ./bin/vtrace launcher.
The VS Code extension is private/local packaging only. It can be packaged locally with:
bun run package:vscodenpm and VS Marketplace publication are planned release options, but they are not part of the current RC1 release path.
The README uses the project artwork from docs/assets/brand.
vtrace is conservative by design:
- structural outputs are based on indexed repository data
search_logic_flowrequires exact start and end FQNs- impact and flow tools are not runtime execution proofs
- watcher freshness is mark-stale-only by default;
watch --auto-reindexis explicit opt-in and keeps failures visible - V-REF expansion is exact stored-payload lookup with bounded repo-local retention, not fuzzy reconstruction
- the optional daemon is inspectable, but not required


