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 natively into REX, ClassEve’s desktop AI — so REX understands large codebases by meaning, not just text.

Open source under Apache-2.0 — clone it or browse the repo:

git clone https://github.com/classeve-public/context-zero-engine.git
Open repository on GitHub
How you use it
  1. Index your repository. 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.
  2. Connect your agent. Add the engine as an MCP server in Claude Code or any MCP-capable client, or call the HTTP API directly.
  3. Ask structured questions.“Who calls this?” “What breaks if I change it?” “Where is similar code?” The agent gets a compact, token-budgeted answer instead of reading files one by one.
  4. Keep working. The index updates incrementally as the code changes — no full re-index on every edit.
Why it exists

Stop reading the repository one file at a time.

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 behaviourally 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

Five analysis tasks, one indexed graph.

Across five repository-analysis tasks on the same codebase — 91 files, 4,374 symbols — the file-by-file workflow opened 43 files and read 28,963 lines across 65 tool calls. The same investigation through Context Zero opened zero files directly and used six MCP calls, cutting tokens consumed from 115,852 to 22,056.

What it computes

Capsule compilation

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

Blast radius

Five-dimensional impact analysis — structural, behavioural, contract, homolog, and historical — with severity and confidence scoring.

Effects & behaviour

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

Contracts

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

Semantic search

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

Smart context

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

Coverage

Fifteen languages: TypeScript, JavaScript, Python, C, C++, CUDA, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, and Bash. 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

Frequently asked 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?

Instead of opening dozens of files to answer a question, an agent makes a few MCP calls that return only the relevant symbols, dependencies, and contracts. In a measured run across five analysis tasks it cut tokens consumed from about 115,000 to 22,000 and replaced 65 file-reading tool calls with six.

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?

Fifteen: TypeScript, JavaScript, Python, C, C++, CUDA, Go, Rust, Java, C#, Ruby, Kotlin, Swift, PHP, and Bash. 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 and open source?

Yes. It is released under the Apache-2.0 license and runs entirely on your own machine. The source is on GitHub at github.com/classeve-public/context-zero-engine.