CLASSEVE
RoutePublic
Public / Context Zero Engine

Context Zero Engine.

A local code-intelligence engine for AI agents. It indexes a repository into a code graph, then answers targeted questions — symbols, dependencies, effects, contracts, similar code, and blast radius — over MCP and HTTP.

Built into REX, ClassEve’s coding agent, so REX understands large codebases by meaning, not just text.

Free. Get it from GitHub:

git clone https://github.com/Classevelabs/context-zero-engine.git
Open repository on GitHub
One ordinary job

Your AI reads 1,413 lines to answer one question.
It needs 165.

You pay for all 1,413 — every single time it asks.

The job is always the same three things: the function, the code it uses from other files, and the code that calls it. We measured what that costs 955 times across 18 public repositories — 2,727,382 lines in 13,954 files, picking the functions at random.

Not an estimate. On an ordinary job your agent searches for the name, opens the 1 files that come back, and reads every line in them.

What your agent reads todayThe orange squares are the part it actually needed. You paid for all of it.
What it reads with ContextZeroJust the part it needed. Nothing else is sent.
Your agent todayWith ContextZero
Times it stops to askthree pauses, or one21
Files it has to openit asks the index it already built1None
Lines of code it readsto answer the same question00
Tokens you are billed for83% fewer00
What that costs youat $3.00 per million tokens4.00¢0.67¢
Did the answer contain the function you asked about?same token budget on both sides, checked against the code on disk1 time in 30Every time

Both sides were given the same number of tokens to spend, so this is not a trade of cheaper for worse. It is a measurement of what your assistant is handed — not a claim about how it thinks.

Seven of the eighteen public repositoriesClone any of them and run it yourself. The saving tracks how far the answer is spread across files, not how big the repository is — Nest is larger than OkHttp and saves a third as much.
  • ReactJavaScript · 4,575 files93.5%14.3× fewer
  • DjangoPython · 3,043 files89.2%16.5× fewer
  • NestTypeScript · 1,842 files57.6%2.9× fewer
  • GitHub CLIGo · 937 files70.7%5.0× fewer
  • TokioRust · 793 files79.3%6.1× fewer
  • OkHttpJava · 692 files90.1%9.4× fewer
  • AlamofireSwift · 108 files83.3%5.4× fewer

It runs on your machine. Your code never leaves it.

There is no service to sign up for and no API key to paste in. The index is a database on your own computer, so nothing gets uploaded and nothing charges you per search. Pull the network cable and try it — the switch does exactly that.

what breaks if Ichange this?YOUR AGENT · LOCAL MCPSOURCE///GRAPHYOUR MACHINECODE GRAPH · LOCAL POSTGRESNEVER CONNECTEDSOMEBODY ELSE’S SERVERVENDOR INDEX · PER-CALL BILLING
Bytes leaving your machine
0
External API calls
None
Capsule compiled in
11 ms
Blast radius, depth 2
12 ms
With the network pulled
Unchanged
Similarity is TF-IDF plus MinHash LSH computed locally — there is no embeddings service to call and no per-token bill for search. The graph is a PostgreSQL database on your own machine, and context is served over local MCP or HTTP.
Now multiply it

That was one job. You run hundreds.

Set how many jobs your agent runs in a day and what you pay per million tokens. The saving per job is measured; the price is yours, because we are not going to quote a rate that changes next month.

$100saved a month
$1,199saved a year
0ktokens not sent
0API calls not made
Computed from one typical job — 11,100 tokens saved on each, over 30 days. By repository, the saving ran from 2.6x fewer tokens to 16.5x.
Four codebases

The more scattered the answer, the more it saves.

Where a function and everything it touches sit in one file, reading is already cheap. Where they are spread across a codebase, only what the question needs is sent. Measured on four codebases.

  1. This engine, indexing itself177 files · 6,595 symbols
    9.0× less
    88.4% fewer tokens
  2. Expresspublic — re-runnable141 files · JavaScript
    2.6× less
    53.8% fewer tokens
  3. OkHttppublic — re-runnable692 files · Java
    9.4× less
    90.1% fewer tokens
  4. Eighteen public repositoriespublic — re-runnable955 jobs · 11 languages · pooled · none failed
    10.1× less
    90.1% fewer tokens
And on a second repository

2,443 files of scripts, release tooling, a website and this engine’s own source: 18,682 tokens a job down to 766 — 96% fewer, and 25× less across the whole run. The function you asked about came back every time, against 1 time in 21 by searching.

How it was measured
  • One run: 955 jobs on 18 public repositories, none failed. The benchmark ships in the repository.
  • Answers were checked against the source on disk, not against the engine’s own database. A helper counts only if the code genuinely uses it.
  • Where it could be scored, it finds about six in ten of the helpers a change needs; searching and opening files finds almost none.
  • Typical figures are medians; pooled across all 955 jobs the saving is 10.1×.
Using it

How you use it

Index once, connect an agent, then ask questions instead of reading files.

  1. Clone the engine, point it at a codebase, and let it build the graph. Everything runs and stays on your machine — no code leaves it.

Why it exists

Stop reading the repository one file at a time.

WITHOUT CONTEXT ZEROIt opens one file, then the next, then the next0 of 19 files read5 NEVER GOT OPENEDWITH CONTEXT ZEROIt reads the whole thing once, then you ask1 question askedREADING IT ONCE
  • The code
  • What calls it
  • What it calls
  • What it touches
  • Tests for it
  • Rules it keeps
  • What it breaks
Both sides are the same codebase, started at the same moment. There is no stopwatch on this — it counts how many times you have to ask.

Developer tools — and the agents built on top of them — inspect source one file at a time. For any non-trivial change that means opening many files, tracing transitive effects by hand, and still missing contract assumptions or behaviorally similar code.

Context Zero indexes the repository once into a PostgreSQL-backed code graph, then exposes the same investigation as structured queries: source, callers, callees, effects, tests, invariants, and impact. The goal is practical — make repository context easier to verify, audit, and reuse.

Measured

What it costs to understand a codebase.

Measured on 18 public repositories, 11 languages

One real job: change a function. To do it safely an assistant must see the function, the code it uses from other files, and the code that calls it. Collecting those three things was measured 955 times — searching and reading files, against one Context Zero request.

Every repository is a public checkout pinned by commit, and the benchmark ships in the engine repository.

0%Fewer tokens13,321 → 2,221 on a typical job
0.0×Fewer, across the whole run23.3M → 2.3M tokens
0Lines of code, not 1,413What one request pulls in
0Functions measuredChosen at random

The same 955 answers, side by side

Both bars answer identical questions. The baseline is deliberately conservative: capped at the 25 files an agent would plausibly open before giving up, and limited to distinctive symbol names where searching by name is a fair proxy for what an agent would actually do.

File-reading baseline0 tokens
Context Zero0 tokens
0×fewer tokens across the whole run — and the search itself, plus deciding which files to open, is charged to the other side for free.

Spending less is only half the question

Cheap is easy — an empty answer costs nothing. So both sides were given the same tokens to spend, and what came back was checked against the real source code on disk. Searching for a name finds the places that mention it, not the things it needs, which is why the cheaper answer is also the more complete one.

The function you asked to change
Every time
1 time in 9
The code that calls it
46%
23%
The helpers it uses from other files
6 in 10, where measured
Almost none
A test that covers it
28%
—
One Context Zero request Searching and reading files

How much it saves depends on how far the answer is spread

Four of the eighteen repositories, in four languages. What decides the gap is not repository size but how many files you have to open to answer one question.

Where a function and everything it touches sit in one file, reading is already cheap; where they are scattered, a capsule replaces work that no longer fits in a context window. Both sides draw on the same indexed set of files.

Express141 files · JavaScript
2.6×
GitHub CLI937 files · Go
5×
OkHttp692 files · Java
9.4×
Django3,043 files · Python
16.5×

Savings shown are token reduction against the exact-symbol baseline: Express 53.8% · GitHub CLI 70.7% · OkHttp 90.1% · Django 89.2%.

Query latency on the indexed snapshot

Measured against the self-ingest snapshot on consumer-grade hardware — no server hardware, no clustering.

0ms
Symbol details
0ms
Strict context capsule
0ms
Blast radius, depth 2

One full index, end to end

The engine indexing its own source, measured 2026-09-08: symbol extraction, relation resolution, dispatch resolution, lineage, effect signatures, contract mining and concept families — 47 seconds from a cold start, no failures.

Clone the repository and run it yourself.

0Files indexed
0Symbols extracted
0Structural relations
0Files failed
every file indexed, none failed

Fourteen languages, thirteen engines, sixty-one tools

TypeScript and JavaScript use full AST analysis through the TypeScript compiler; Python uses LibCST; the rest use tree-sitter with language-specific walkers.

TypeScriptJavaScriptPythonCC++GoRustJavaC#RubyKotlinSwiftPHPBash13 analysis engines61 MCP tools

Tokens are estimated as ceil(bytes / 4) — a deterministic approximation chosen so runs are repeatable; exact counts differ by model, but the ratios hold. Every figure on this page reproduces with the benchmark in the repository. Absolute timings vary with corpus, hardware and database configuration.

Reproduce the per-repository figures on your own repository with node scripts/bench-context-quality.mjs 60 /path/to/your/repo, and the ingest figures with node scripts/bench-e2e.mjs /path/to/your/repo name --fresh. The full method, every per-repository table, and the jobs where reading the files was cheaper are in BENCHMARKS.md.

What it computes

Context in one call

Token-budgeted

Context packages — source, dependencies, contracts, and effects in one call, with a five-level degradation ladder.

Blast radius

Five dimensions

Structural, behavioral, contract, homolog, and historical impact analysis, with severity and confidence scoring.

Effects & behavior

Nine typed effects

Every function classified pure / read-only / read-write / side-effecting, with the effects propagated transitively.

Contracts

Derived invariants

Input and output types, error and security contracts, guard clauses, and invariants extracted from the source.

Semantic search

No embeddings service

Find code by what it does — TF-IDF plus MinHash LSH similarity. No external APIs.

Smart context

One call, 8+ lookups

One call returns source, blast radius, callers, tests, and contracts — replacing eight or more separate lookups.

Self-maintaining index

No re-ingest

The graph follows the code. Edits are folded into the snapshot seconds after they hit disk — no scheduled job, no editor plugin.

Coverage

Fourteen languages across thirteen grammars: TypeScript, JavaScript, Python, C, C++, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, and Bash — C is parsed by the C++ grammar. TypeScript and JavaScript use full AST analysis through the TypeScript compiler; Python uses LibCST; the rest use tree-sitter with language-specific walkers. Thirteen analysis engines are exposed through sixty-one MCP tools.

FAQ

Common questions

What is Context Zero Engine?
Context Zero Engine is a free, self-hosted code-intelligence engine for AI agents. It indexes a repository into a PostgreSQL-backed code graph and serves targeted context — symbols, callers, effects, contracts, similar code, and blast radius — over the Model Context Protocol (MCP) and HTTP, so an agent stops reading files one at a time.
How does it reduce token usage for AI coding agents?
An assistant changing one function needs three things: the function, the code it uses from other files, and the code that calls it. On a typical job, searching and opening files costs 13,321 tokens; one Context Zero request costs 2,221 — 83% fewer, and 10.1× fewer pooled across 955 jobs on 18 public repositories. The benchmark ships in the repository.
What is MCP, and how does Context Zero use it?
MCP (the Model Context Protocol) is an open standard for connecting AI assistants to tools and data. Context Zero exposes thirteen analysis engines through sixty-one MCP tools, so any MCP-capable agent — including Claude Code — can query the code graph directly.
Which programming languages does it support?
Fourteen, across thirteen grammars: TypeScript, JavaScript, Python, C, C++, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, and Bash — C is parsed by the C++ grammar. TypeScript and JavaScript use full AST analysis, Python uses LibCST, and the rest use tree-sitter.
How is it different from grep or embedding-based code search?
Grep matches text and embeddings match surface similarity; neither understands structure. Context Zero builds a real graph of symbols, calls, effects, and contracts, so it can answer questions like what breaks if I change this and which functions have side effects — not just where a string appears.
Is Context Zero Engine free?
Yes. It runs entirely on your own machine. Get it at github.com/Classevelabs/context-zero-engine.
What is context saving, and how much does Context Zero save?
Keeping an agent's context window for the actual change: definitions, callers, dependencies and blast radius come from a persistent code graph instead of re-reading files. Measured across 955 jobs on 18 public repositories, a typical job took 13,321 tokens and 2 tool calls file by file, 2,221 tokens and 1 call through Context Zero Engine — 83% fewer.