CLASSEVE
RouteLearn
Learn / Context saving

What is context saving for coding agents?

Context saving is keeping an AI coding agent's context window for the actual change by serving structural answers — definitions, callers, dependencies, blast radius — from a persistent code graph instead of having the agent re-read source files. In a five-task measurement on one codebase, the code-graph route used 22,056 tokens and 6 tool calls against 115,852 tokens and 65 calls file by file.

Also called:context savingsave context tokensreduce token usage of a coding agentcontext window optimizationtoken savings for AI coding agentscontext engine for coding agentscode graph MCP servercodebase context for AI agentscontext zeroContext Zero Engine

Where an agent's context goes

A coding agent's context window is its working memory, and most of it is spent on orientation rather than on the change: opening files to find a definition, reading more files to find the callers, reading again to judge what a change would break. Every re-read costs tokens that are then unavailable for the work, and the structure it rediscovers is thrown away when the session ends.

That cost repeats on every task and every session, because file reading transfers source when the agent only needed an answer about it. A list of callers is a few hundred tokens; the files that contain those callers are tens of thousands.

What a code graph changes

Context saving replaces the re-reading with a query. The repository is indexed once into a code graph — symbols, references, dependencies, effects — and the agent asks it questions over MCP: where is this defined, who calls it, what does it depend on, what is the blast radius of changing it. The answers are computed, so orientation becomes a one-time index cost instead of a per-session token cost.

Measured on one TypeScript codebase of 91 files and 4,374 symbols across five tasks coding agents perform daily — locating definitions, tracing callers, assessing the impact of a change, finding related code and summarizing a subsystem — the file-by-file workflow opened 43 files, read 28,963 lines and used 115,852 tokens over 65 tool calls. The same investigation through Context Zero Engine's code graph opened no files directly and used 22,056 tokens in 6 calls: about a fifth of the tokens and one call in eleven. Method, numbers and limits are on the research page.

What it does not do

The graph answers questions about structure; it does not replace reading the code the agent is about to edit, and it does not judge whether a change is a good idea. The saving is in the orientation phase, which is where most of a task's tokens went in the measurement. The measurement covers one codebase and five task types; the ratio will differ with repository size and with how much an agent already knows.

From ClassEve

Context Zero Engine is ClassEve's open-source code-graph server: index a repository once, and any MCP-capable coding agent asks it for symbols, callers, dependencies and blast radius instead of reading files.

Context saving · FAQ

Common questions.

How much context does a code graph save?
In ClassEve's five-task measurement on a 91-file codebase, 22,056 tokens and 6 tool calls through the code graph against 115,852 tokens and 65 calls reading files — about a fifth of the tokens. The saving comes from answering questions instead of transferring source.
Is context saving the same as prompt compression?
No. Compression shrinks text that is already in the context. Context saving avoids loading that text at all: the agent asks an index for the fact it needed — a caller list, a dependency, a blast radius — and never reads the files that contained it.
Does it work with my coding agent?
Any agent that speaks MCP can use it; support is the norm among serious coding agents. Context Zero Engine also answers over HTTP for tools that do not.
What does ClassEve build for context saving?
Context Zero Engine, an open-source local code-intelligence engine: it indexes a repository into a code graph and serves symbols, effects, contracts, similar code and blast radius over MCP and HTTP, so agents stop re-reading files one at a time.