SOFTWARE ENGINEERING

CodeMesh: 95% fewer tokens for AI coding agents

When AI coding assistants moved to token billing, an engineering leader at a global energy-equipment manufacturer asked how to cut the cost. Wexa built CodeMesh: a structural graph of the codebase that coding agents query over MCP instead of reading whole files.

fewer tokens across 98 engineering queries (25.3M → 1.23M)
fewer tokens per query (258,115 → 12,524)
measured API spend for the benchmark
savings held on hard and expert queries
CLIENT
Wexa product, built from a problem raised by a global energy-equipment manufacturer
REGION
Global
WHEN
2026
ENGAGEMENT
Wexa product
WEXA COMPONENTS
CodeMesh on the Wexa memory layer · MCP server · 5 retrieval tools

01Case 10

The challenge

  • Coding agents re-read whole files and rebuild context for every query
  • Token-based billing makes that cost visible and large
  • Agents miss relationships between functions, classes and dependencies

What Wexa built

  • Code knowledge graph of files, functions, classes, imports and git history on the Wexa memory layer
  • Exposed over MCP to Claude Code, Cursor, ChatGPT and custom agents
  • Guard hook redirects file search to the graph; no LLM in the retrieval path
  • Read-only, permission-checked access with audit of every agent query

02Case 10

How it runs on Wexa

03Case 10

Solution architecture

04Case 10

How the result was measured

05Case 10

Results

MeasureBefore / without WexaWith Wexa

Coding-agent token spend (team of 50 developers)

$300K a year

$21K a year

Annual cost of the process

$300K

$21K

Time to implement the AI solution

4 months

1 day

AI build cost (one-time)

$192K

$4K

AI operating cost per year (models, infrastructure, upkeep, platform)

$141K

$66K

Total AI cost in year 1

$333K

$70K

  • Public benchmark on an open-source repository; method and questions published for anyone to reproduce
  • On a private production repository, a 10-question test measured 82–90% input-token reduction
  • Prospects include a global IT-services firm and a US hospital group

Benchmark source: CodeMesh benchmark (codemesh.cloud/benchmarks). Same model and questions in both runs.

Want results like these?

Book a 30-minute call and we will map your workflow to this case.