Context Compiler
Context Compiler is a compiler layer for coding agents and managed agents that turns a raw code repository into a compact, graph-structured execution manifest.
Core trick
Parses the repo with Python ASTs into a compact graph manifest, then Gemini enriches key nodes to route tasks and patch only relevant files.
Description
Context Compiler is a compiler layer for coding agents and managed agents that turns a raw code repository into a compact, graph-structured execution manifest. Instead of dumping an entire codebase into an LLM prompt, it parses the repo with Python ASTs, extracts functions/classes/imports/calls/routes/line ranges, and produces a compressed manifest that acts like a map of the codebase. Gemini then enriches the important nodes with semantic cards, routes the task to the exact relevant files, generates a targeted patch, applies it to a safe copied sandbox, and validates the result. It cut token use by 46% in our demo while keeping all important code information and structure intact
README excerpt
# Context Compiler — Codebase Compaction Compiler & Rich Semantic Agent Substrate > **“Stop dumping entire repositories into agent prompts. We built a deterministic AST compiler front-end coupled with a cheap Gemini semantic enrichment layer to condense your codebase into a task-focused substrate — reducing context size by up to 85% while guaranteeing execution safety.”** --- ## 🚀 One-Sentence Pitch Context Compiler is a hybrid deterministic/semantic compiler pass that transforms raw codebases into high-density, task-specific substrates for coding agents, enabling ultra-cheap Gemini orchestration, high-speed routing, and serverless sandboxed verification. --- ## 💡 Why Context Compilers Win Current software engineering agents suffer from a fatal flaw: **they dump the entire codebase (or massive chunks of it) into the LLM context window.** 1. **It is incredibly expensive:** Thousands of lines of boilerplate and irrelevant library definitions are passed repeatedly, costing dollars per task invocation. 2. **It degrades model performance:** The "lost in the middle" phenomenon causes agents to miss crucial line-specific details when buried under massive prompt dumps. 3. **It lacks validation:** Traditional agents generate patches in the dark, hoping they compile, without running real-world unit tests or sandbox safety gates. **Context Compiler solves this by treating the codebase like compiler source code:** * **Deterministic AST Front-End (Quantizer):** Compiles code files i