Reduce unnecessary repository context in Claude Code with CodeMesh

The short answer

CodeMesh can provide supported Claude Code workflows with targeted structural repository information, helping reduce the need for repeated broad repository discovery.

One exchange, with CodeMesh attached

The question, the structural calls it makes instead of reading files, and the answer. The general mechanism is on connect your agent.

claude: connected to CodeMesh
‣ Where do we handle token refresh, and who calls it?
⚙ search-code query: "token refresh"
→ server/auth/tokens.ts:118  score 0.94
→ engine/src/auth.rs:47  score 0.81
⚙ query-context MATCH (c:CodeFunction)-[:CALLS]->(f) WHERE f.name = 'refreshTokens'
→ 3 callers
refreshTokens() in server/auth/tokens.ts rotates the token and revokes the whole family if a spent one is replayed. Called from the token endpoint, the daemon's retry path, and auth.rs on a 401.

What does CodeMesh add to Claude Code?

Claude Code can already search, open and read files across a repository on its own. CodeMesh adds a structural layer underneath that: instead of Claude Code repeatedly searching and opening files to work out how code is connected, it can ask CodeMesh directly for the relevant functions, classes, imports and call relationships for a specific question, and use that structural context alongside, or instead of, its own file reads.

Why repository discovery can consume tokens

To answer a question about an unfamiliar repository, an agent typically has to search for candidate files, open them, read through them, follow imports, identify callers, and re-read related code before it has enough information to act. Every one of those steps costs tokens before any actual reasoning or code generation happens.

Discovery can consume tokens before useful reasoning begins.

On a large or unfamiliar codebase, this discovery phase can end up consuming more of a session's context than the work it was meant to support.

How the integration works

flow
1Developer
2Claude Code
3CodeMesh
4Structural repository context
5Claude

When Claude Code has a question that depends on understanding the repository's structure, it can call CodeMesh's MCP tools instead of searching the filesystem from scratch. CodeMesh returns the structural context relevant to that question, which Claude Code passes back into its own reasoning.

On data handling
CodeMesh stores your repository's parsed structure and source text in a graph scoped to your organization. Your machine and your coding agent never hold a database credential: every query is scoped by the credential itself, executed read-only, and only the result crosses back.

Installation

Claude Code doesn't have its own extension marketplace, so CodeMesh installs through the same extension that supports VS Code, Cursor and Devin, and that extension configures Claude Code for you.

  1. Install the CodeMesh extension for VS Code, Cursor or Devin.
  2. Open the repository you want Claude Code to work in. CodeMesh begins building a structural understanding of it automatically.
  3. Click Connect in the CodeMesh extension. This configures Claude Code's MCP settings (~/.claude.json) for you: no manual JSON editing required.
  4. Open Claude Code in that same repository. CodeMesh's tools are now available to it.

Installers are available directly: macOS (Apple Silicon), macOS (Intel), Windows, Linux.

Example workflow

A developer asks Claude Code:

“Where is authentication handled, and what depends on it?”

Without CodeMesh, Claude Code would typically search the repository for likely filenames, open several candidate files, read through them, and trace imports and call sites by hand to build up an answer, spending tokens on every intermediate step. With CodeMesh connected, Claude Code can request the relevant functions, classes and call relationships for authentication directly, then reason over that structural context instead of rediscovering it from scratch.

Does CodeMesh replace Claude Code?

No.

Claude Code is still the agent that reads instructions, plans changes, writes code, runs commands and talks to you. CodeMesh doesn't do any of that. It's a context layer underneath Claude Code that answers questions about repository structure, so Claude Code doesn't have to rediscover the same information by searching and reading files repeatedly.

Benchmark evidence

CodeMesh's published benchmark ran 98 real software-engineering questions against a public repository, using Claude Code's own CLI as the test harness for both arms of the comparison: once with the agent reading files directly, and once with CodeMesh's MCP tools available. That means this isn't a benchmark of a modified or Claude-specific product; it's a controlled way of running the identical questions twice with the same agent, and measuring what changes when structural context is available.

Results are from the published CodeMesh benchmark (98 questions, one public repository, one model). Actual results vary by repository, model, coding agent, task and usage pattern. Read the methodology →

FAQ

Yes. CodeMesh connects to Claude Code over MCP. Installing the CodeMesh extension in VS Code, Cursor or Devin and clicking Connect configures Claude Code's MCP settings automatically.
No. CodeMesh is a context layer underneath Claude Code. It doesn't write code, plan changes, run commands or replace any part of what Claude Code does.
Through the CodeMesh extension's Connect flow. The extension configures Claude Code's local MCP settings for you, so there's no manual configuration file to edit.
For Claude Code, yes: MCP is the protocol Claude Code uses to reach CodeMesh's tools. It's the same open protocol several AI coding tools support.
CodeMesh stores your repository's parsed structure and source text in a graph scoped to your organization. Your machine and your coding agent never hold a database credential: every query is scoped by the credential itself, executed read-only, and only the result crosses back.
By answering structural questions directly instead of Claude Code having to search and read files repeatedly, CodeMesh can reduce the tokens spent on repository discovery. See the benchmark evidence above for measured numbers from CodeMesh's published benchmark; actual impact depends on the repository, task, and how much of a session was previously spent on discovery.
CodeMesh's structural parsing works per-repository. It doesn't have monorepo-specific features beyond that today, so multi-package repositories are supported to the extent each package parses normally within the repository.

Give Claude Code precise repository context

Install the CodeMesh extension, connect Claude Code, and stop paying for repeated repository discovery.

Start Saving TokensSee the Benchmark