2026-11-27 16:36 UTC

Vesalius adds a local code graph to Claude Code

state: expiredheat: mediumuncertainty: mediumrelevance: mediumcoding-agents code-graphs local-aiVesalius maintainer

What is this?

Vesalius is a downloadable, Mac-only codebase indexing tool that builds a local code graph and exposes it to Claude Code through five read-only MCP tools, including symbol-usage, feature-map and architecture queries. Its maintainer says a 20-question test across six codebases used 51% fewer tokens typically, with answer quality near unchanged; the benchmark is small, partly based on codebases used to design the tool, and has not been independently validated in the supplied evidence.

Why it matters

Vesalius turns a local code index into a queryable map for Claude Code, potentially replacing repeated file searches with direct structural answers. If its maintainer’s benchmark results generalize, that could reduce token use, latency and cost while helping agents navigate unfamiliar code. The scope is currently limited: it requires a recent Apple-silicon Mac, and the benchmark is small and partly uses codebases the tool was designed against.

Current assessment

Vesalius is available to install for Apple-silicon Macs running macOS 15 or later. It indexes code locally and exposes five read-only MCP tools to Claude Code, including queries about symbol usage, feature locations, architecture and dependency cycles; it also offers a CLI, Mac app and VS Code extension. The maintainer reports a 20-question comparison across six codebases: typical token use fell 51% (44% by arithmetic mean), answer quality was nearly unchanged overall, and responses took fewer turns and less time. This is a first-party benchmark, not independent validation: only 20 questions were tested, one AI judge graded answers, 12 questions were used in development, and four questions used more tokens with Vesalius. The maintainer also reports a 2.1-point quality drop on feature-location questions. The tool does not upload code, but code excerpts returned to Claude Code are still sent to its model as they would be after a search. The supplied web results do not provide independent evidence specific to Vesalius. Track adoption, broader language and platform support, and replication on external codebases before drawing conclusions about typical savings.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-26 20:11⭐ origin directly observedShow HN: Vesalius, an on-device code graph for Claude Code
bigman1113 on hacker news
—
10-26 20:11amplified on hacker news 👑hn.story.50250206
bigman1113
peak 1 · 0 comments · 105% of case engagement
10-26 20:27our radar first saw it · +0.2hdiscovery anchor: hn.story.50250206—

Evidence (1) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hn ⭐Show HN: Vesalius, an on-device code graph for Claude Code
Retrieved article excerpt

Open article · Retrieved 2026-10-26T20:28:54.612239+00:00

Vesalius. A map of your codebase, for you and for Claude Code. Built and kept on your Mac.

[**Quick start**](https://github.com/haplollc/Vesalius#quick-start)  · 
[The five tools](https://github.com/haplollc/Vesalius#the-five-tools-claude-gets)  · 
[Is Claude using it?](https://github.com/haplollc/Vesalius#is-claude-using-it)  · 
[Benchmark](https://github.com/haplollc/Vesalius#does-it-actually-help)  · 
[How it compares](https://github.com/haplollc/Vesalius#how-it-compares)  · 
[Mac app](https://github.com/haplollc/Vesalius#the-mac-app)  · 
[FAQ](https://github.com/haplollc/Vesalius#faq-and-troubleshooting)

[macOS 15+](https://camo.githubusercontent.com/2854fd23738945ffe1e08eb23f3cd06aedbf29b3ec146df39099fadf6269e291/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61634f532d31352532422d3136313831443f6c6f676f3d6170706c65266c6f676f436f6c6f723d7768697465)
[Swift 6](https://camo.githubusercontent.com/74022f2db1ca9c8192965493cdb189f6fee8fb4d14809c73c53456c0d6e31108/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53776966742d362d4630353133383f6c6f676f3d7377696674266c6f676f436f6c6f723d7768697465)
[Install with Homebrew: brew install haplollc/tap/vesalius](https://camo.githubusercontent.com/4a05aaf0529142952eecb4161507d5d6b1fc52a92d0de2c7f0bb9b254d09ad1e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f627265772d6861706c6f6c6c632532467461702d4642423034303f6c6f676f3d686f6d6562726577266c6f676f436f6c6f723d7768697465)
[MCP server with 5 tools](https://camo.githubusercontent.com/18797264301090ee18f5d6509587183414615e268620dbd407dc9367ac732c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d43502d35253230746f6f6c732d374339334646)
[Works with Claude Code](https://camo.githubusercontent.com/c6eb234b5f5f4a97362544cac87de02b080e9981b75fc0891026b0172bc4af0a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436c61756465253230436f64652d72656164792d443937373537)
[Indexing runs entirely on your Mac](https://camo.githubusercontent.com/f2566b1e9ff80717fafd3834bdde657560f7676186a8e679eca2f57662f8acd5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696e646578696e672d3130302532352532306c6f63616c2d323339353541)
[323 tests passing](https://camo.githubusercontent.com/a3d78197123b07668c7d43742dc1c61b9305148a5e5bf8f2aa1fc706f801c724/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d33323325323070617373696e672d323339353541)

[Buy Me a Coffee](https://buymeacoffee.com/jcbuilds)
  
If Vesalius is useful to you, a coffee keeps it going.

When you ask an AI coding assistant about your project, something like *"what breaks if I change this?"*, it works
the way a new teammate would on their first day: search for a name, open a file, search again, open another file,
and slowly piece the answer together. Every one of those steps costs time and tokens, and on a real codebase they
add up fast. **Vesalius gives your assistant a map instead.** It reads your repository once, right on your Mac, and
remembers how everything connects: which file uses which, who calls what, where a feature actually lives. Then Claude
Code can ask it directly and get answers with exact file and line references, usually in one call instead of a chain
of searches. In our benchmark that cut the tokens Claude Code spent answering real questions about real codebases
roughly in half, and a blind AI judge scored the answers about the same. A map is useful to people too, so Vesalius
also comes as a Mac app and a VS Code extension for exploring code yourself. Vesalius itself never uploads your code.

Benchmark over 20 questions: Claude Code alone averaged 204k tokens per question at 97.8 answer quality; with Vesalius, 113k at 97.4. The typical question used 51% fewer tokens (geometric mean of per-question ratios; 44% by plain means), with no measurable change in overall quality, and Claude chose Vesalius in 20 of 20 runs.

## Quick start

```
brew install haplollc/tap/vesalius
vesalius setup
```

That's it. Open Claude Code in any project and ask the way you normally would. It picks the right tool on its own:

> *Who calls `SessionStore.save`, and what would I have to update if I renamed it?*  
> *Where are in-app purchases handled?*  
> *Are there any circular imports under src/?*  
> *What's in PaymentService.swift?*

Most answers come back in one call, with file:line evidence. Claude still opens or greps files when it wants to check
something, just far less: in our benchmark, 2.65 search, read and shell calls per question instead of 7.2.

Here is setup in Vesalius's own repository:

```
$ vesalius setup
Setting up Vesalius 2.1.0 (/opt/homebrew/bin/vesalius)

  ✓ Claude Code: registered for every project
      claude mcp add --scope user vesalius -- /opt/homebrew/bin/vesalius mcp
  ✓ Claude Code: now runs Vesalius's read-only tools without asking
      mcp__vesalius__* in permissions.allow, ~/.claude/settings.json
  ✓ Claude Code: connected
  – Codex: not installed
  ✓ Indexed Vesalius: 256 files in 3.6 s

Next: start Claude Code in a project (in a session that's already open, run /mcp), then ask, for example:
  Who uses Theme, and what would I have to change to rename it?

  vesalius doctor          checks the connection any time
  vesalius stats           shows what Claude asked Vesalius
  vesalius setup --undo    reverses all of this
```

**What setup changes, and nothing else:**

- It registers `vesalius mcp` with Claude Code for every project (`claude mcp add --scope user`), and with Codex when
  the `codex` command is installed.
- It adds `mcp__vesalius__*` to `permissions.allow` in `~/.claude/settings.json`, so Claude Code runs the five
  read-only tools without asking. The rest of that file stays as it was, and `--no-permissions` skips this step.
- It indexes the repository you're in, so the first answer doesn't wait.

It never writes to your repository, your CLAUDE.md or your hooks. `--dry-run` shows the plan first, and
`vesalius setup --undo` reverses it.

**You need** a Mac with Apple silicon on macOS 15 or later, and
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) or another MCP client.

**Build from source** (Xcode 26)

```
git clone https://github.com/haplollc/Vesalius.git
cd Vesalius
scripts/install-cli.sh        # builds a release binary and installs it to ~/.local/bin
vesalius setup
```

The first build downloads SwiftSyntax and ArgumentParser (about 47 MB) and compiles SwiftSyntax in release mode, so it
takes several minutes: about 6 on an M2 in our runs, more on a busy machine. If `~/.local/bin` is not on your `PATH`,
the script prints the line to add to your shell profile. To install somewhere else, pass a folder:
`scripts/install-cli.sh ~/bin`.


**Register it by hand, or with another client** (team-shared, a pinned repository, Codex, Cursor)

```
# What setup runs for Claude Code
claude mcp add --scope user vesalius -- vesalius mcp

# Share it with your team through .mcp.json instead. Each person approves it once when they next start Claude Code;
# until then `claude mcp list` shows "⏸ Pending approval".
claude mcp add --scope project vesalius -- vesalius mcp

# Always serve one repository, wherever Claude Code is started
claude mcp add --scope user vesalius -- vesalius mcp --repo ~/code/your-app

# Load every Vesalius tool on demand instead of two up front (see VESALIUS_MCP_PROFILE under Configuration)
claude mcp add --scope user vesalius -e VESALIUS_MCP_PROFILE=lean -- vesalius mcp
```

A new registration in the same scope needs the old one removed first: `claude mcp remove --scope user vesalius`.

Codex reads `~/.codex/config.toml` (setup uses `codex mcp add` when that command is installed):

```
[mcp_servers.vesalius]
command = "vesalius"
args = ["mcp"]
```

Cursor reads `~/.cursor/mcp.json`:

```
{ "mcpServers": { "vesalius": { "type": "stdio", "command": "vesalius", "args": ["mcp", "--repo", "/path/to/repo"] } } }
```

Any other MCP client that speaks stdio can run `vesalius mcp --repo /path/to/repo`; leave out `--repo` only if the
client starts servers in your project folder. If a client can't find `vesalius`, give its full path,
`/opt/homebrew/bin/vesalius`. The Mac app's **Settings › Agents** can also register Vesalius with Claude Code and Codex.

## Where it helps

- **Before a risky change.** "What breaks if I rename this?" lists the callers, including type-inferred uses a text
  search would miss, the files to edit and the tests to run, with a check on how complete that list is.
- **In a codebase you didn't write**, or wrote a year ago. See its shape, its health, its hotspots and where to start,
  before reading a single file.
- **When an agent does the digging.** Claude Code asks Vesalius first and greps far less, so it spends fewer tokens
  and fewer turns getting to an answer of about the same quality.
- **When you want the code to stay healthy.** A health score with every deduction explained, dependency cycles,
  oversized files, possibly unused code, each with its evidence.

## The five tools Claude gets

| Tool | Ask it… | What comes back |
| --- | --- | --- |
| **`usages`** | *who calls X? what uses this file? what breaks if I rename X?* | Its uses as file:line + code, grouped by the function they sit in, including uses only type inference can see, minus same-name lookalikes, plus a completeness check. With `change: rename | signature | remove`: the edit list and the tests to run. |
| **`feature_map`** | *where are purchases handled? how is data persisted?* | The core types and functions grouped by role, with their decisive lines, framework and I/O calls, config and environment links, and call sites: a map that points straight at the right files and lines. |
| **`outline`** | *what's in this file, type or function?* | Declarations with signatures and line ranges, first doc sentences and calls in order, at about a fifth of the tokens of reading the file. |
| **`architecture`** | *how is this project put together?* | Targets and their product types, packages, folders, dependency direction, cycles and cross-target links, from the project files plus the code graph. |
| **`dependency_cycles`** | *do we have circular imports?* | Every cycle in scope with each edge's import line and where the imported names are used, plus what was scanned, so "no other cycles" needs no re-check. |

`usages` and `feature_map` are loaded up front, which adds about 900 tokens to Claude Code's context in every session
where Vesalius is registered (cached after the first request, and already counted in the benchmark totals). The
other three wait behind Claude Code's tool search until they are needed. Every tool is read-only.

This is exactly what Claude sees, because the command line prints the same text as the MCP tool:

```
$ vesalius usages RepositoryEngine.ensureFresh
@discardableResult public func RepositoryEngine.ensureFresh(options:progress:) async throw…  VesaliusKit/Sources/QueryEngine/RepositoryEngine.swift:201-210 · method · target QueryEngine
3 callers in 3 files (VesaliusCommands 2 · VesaliusMCP 1) · complete: "ensureFresh" occurs 10×: 3 resolved to the target, 1 declaration, 2 strings (DebugCommands.swift:21,76), 4 non-source (README.md); 0 unresolved
RepositoryEngine (owner type) is used by 59 other files
VesaliusKit/Sources/VesaliusCommands/SetupCommand.swift
  func Setup.run() :39-215  type doc: "vesalius setup: one command from installed to answering Claude Code's questions, and --undo to reve…"
    186 │ let summary = try await engine.ensureFresh { progress.update($0) }
VesaliusKit/Sources/VesaliusCommands/VesaliusCommand.swift
  func GlobalOptions.engine() :75-86  "Opens the engine and brings the index up to date unless --no-refresh."
    82 │ if let summary = try await engine.ensureFresh(progress: { printer.update($0) })
    called by: runTool(_:_:full:) :100 · Watch.run() :270 · DebugCompleteness.run() DebugCommands.swift:31 · +22
VesaliusKit/Sources/VesaliusMCP/IndexCoordinator.swift
  private func IndexCoordinato
bigman111310

Interpretation history

Decision trace