OPEN-SOURCE CONTEXT COMPILER FOR LARGE CODEBASES · v0.2.0
12.75× smaller.
Exact source when it matters.
Built for large codebases, KERN compiles repositories into a compact intermediate language, caches unchanged pages, and faults exact source back in before every edit.
Selected-representation reduction in one 3,704-line Python pilot—not total agent-loop savings.
Dense pilot run: 18,107 uncached input tokens across four turns; 73,403 cumulative. Representation size and complete agent-loop cost are different measurements.
Methodologycodex plugin marketplace add enoch3712/KERN && codex plugin add kern@kernTHE COMPILER, NOT A DIAGRAM
Watch source become task-ready context.
The host changes. The KERN IL contract does not. Select a provider to see an example compiler/runtime route around the same source transformation.
from hashlib import sha256def load_entry(path, expected_sha):data = path.read_bytes()current_sha = sha256(data).hexdigest()if current_sha != expected_sha:raise StaleSource(path)return parse(data)
IR COMPILER PROFILE
Luna
Example route for CodexKERN-IL/0.2
source_rel=src/cache.py
source_sha256=9c21…
generator=kern-det/0.2 lang=python frontend=pyast tier=L2
F load_entry(path, expected_sha) -> Any @L3-8 ^e4b9095a64a4face ~L2
CALLS path.read_bytes, sha256(data).hexdigest, sha256, StaleSource, parse
EFFECTS fs:read, unknown-calls=4
RAISES StaleSource
IF
RAISE
RET
OMIT assignments=2 blank=1 comments=0 docstrings=0 bodies-tier=L2
FAULT-BEFORE edit(any), exact-literalsRUNTIMEGPT-5.6 Sol
IR means Intermediate Representation: a machine-oriented form between source and consumption. KERN IL is its portable semantic language. Model names above are example routing profiles, not protocol requirements.
REPOSITORY VIRTUAL MEMORY
Keep the map hot. Page detail in only when needed.
KERN keeps a cheap index resident, compiles on demand, and treats exact source like a protected page fault before mutation.
if current_sha != expected_sha: reject_stale_commit()01Watch changesHash the repository. A changed file gets a new identity; unchanged pages stay cached.
THE FULL CIRCLE
We taught machines to read code. Then we forgot.
Each generation separated human expression from machine consumption—until the raw-prompt era convinced us to paste large codebases into a model window. KERN puts the compiler boundary back where it belongs.
Punch cards
Humans speak machine.Every instruction explicit, physical, and expensive.
Compilers
Humans write source.Translation separates how software reads from how it runs.
VMs + IL
Compile once. Optimize later.Portable bytecode, JIT compilation, runtime specialization.
Raw prompts
Paste the repo into chat.Our smartest models reread every import, brace, and comment.
KERN IL
Compile context again.Reason over compact IL. Fault exact source only on demand.
Once again, software goes full-circle—by adding another layer in the middle.
RECOGNIZED SOURCE FORMATS
Ten languages. One portable contract.
Python is structured by default. JavaScript and TypeScript use the optional pinned tree-sitter frontends; the other seven formats use KERN's labeled generic baseline while language-specific lowering matures.
OPEN SOURCE · APACHE-2.0