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
| Measure | Before / without Wexa | With 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 |
With Wexa
net annual value to the client after Wexa's own operating cost
faster to implement
lower AI operating cost
less AI spend in year 1
- 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.
More case studies
All 43 casesRecruitment
PureHire · AI recruitment platform
Live
in production, including Wexa's own hiring
Live; runs Wexa's own hiring; customer engagements under contract
Read the caseSoftware
Enterprise search and actions · software company
−80%
tokens vs sending raw data to the model (up to −82%)
~80% fewer tokens and 18/20 correct vs 8/20 for a plain model call; zero permission leaks
Read the caseIT service management
AI service desk · enterprise IT
5.5 s
self-service answer citing past incidents
Answers in 5.5 s, escalations in 4.5 s; go-live in 9.4 s; built entirely on Wexa
Read the caseWant results like these?
Book a 30-minute call and we will map your workflow to this case.