Developer tooling · 2026

Context Mesh

Code intelligence that cuts AI agent token spend by 99%.

Role
Design and engineering
Timeline
Five months of active development
Status
Private
Year
2026
Real terminal output from `cm guard runBuildPipeline`: a blast-radius table listing 64 affected files, which have guarding tests and which have none.
Real terminal output from `cm guard runBuildPipeline`: a blast-radius table listing 64 affected files, which have guarding tests and which have none.2026

01 / The problem

The problem

Ask an AI coding agent what calls a given function. Without an index it greps, gets partial matches, opens four files to confirm, spends several thousand tokens, and still misses the caller that reaches the function indirectly.

That loop repeats on every question. On a large repository it becomes the dominant cost of working with an agent, and it gets worse precisely when the codebase is big enough for the help to matter most.

02 / What it does

What it does

Context Mesh indexes a repository once and then answers structural questions (where is this defined, what calls it, what depends on it) in a single lookup instead of a search loop.

The design decision that carries the project is that one index is exposed three ways: as static files any tool can read, including editor modes that cannot call tools at all; as a command-line binary that runs anywhere a shell does, including inside subagents that do not inherit their parent's tool registrations; and as an MCP server for hosts that support it. Keeping all three in parity from a single build is the part that is easy to get wrong.

~/Code/ContextMesh
Real cm output (stats, symbol, deps) replayed in a terminal and recordedOutput unedited

03 / The measurements

The measurements

There is a benchmark in the repository, it runs in CI, and it is pinned to specific public commits so the results reproduce.

Retrieving the same answers against a grep-loop baseline: 5,202 tokens and 11 tool calls, versus 2,082,608 tokens and 654 tool calls. Across a broader eleven-task run over four open-source repositories, task success was 100% against the baseline's 63.6%.

99.8%
Fewer tokens than baseline
98.3%
Fewer tool calls
100%
Task success vs 63.6% baseline
1,729
Test cases

One disclaimer, written against my own results: the scripted judge does not account for how a real model degrades when a huge context is dumped on it, so the success-rate gap is softer than the number suggests. Read the cost figures as the result and the success rate as directional.

04 / How it is built

How it is built

tree-sitter does the parsing, which lets the call graph work across languages rather than just the one the tool happens to be written in. Route extraction covers 27 web frameworks. The call graph crosses language boundaries too: a React Native bridge call resolves through to its Swift or Kotlin implementation.

Incremental rebuilds are verified byte-identical to a full rebuild by the performance harness, and run between 1.4× and 14× faster depending on how much changed. An optional SQLite full-text index engages automatically once a repository is large enough to need it.

1,729 test cases. CI runs build, typecheck, the test suite and a benchmark regression gate on every push, so a change that makes retrieval worse fails before it merges, whether or not anyone noticed.

05 / Status

Status

Private. It is packaged for release and has not been released: the repository is not public and nothing is on any package registry. It is in daily use across my own projects, including the site you are reading this on.

Stack

  • 01TypeScript, Node 20+, ESM monorepo
  • 02tree-sitter (WASM) for multi-language parsing
  • 03Model Context Protocol server with 29 tools
  • 04Optional SQLite FTS5 search accelerator
  • 05Vitest, CI with a benchmark regression gate

Need something in this shape?

Tell me what you are trying to build and roughly when you need it. I reply to every enquiry within one business day, including the ones I am not the right fit for.

Start a project

Replies within one business day