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.

Local-firstContent-addressedExact-source gateApache-2.0
MEASURED PILOT / SELECTED ARTIFACT92.2% smaller
RAW SOURCE36,674text tokens est.
KERN IL5,795text tokens est.
DENSE PAGE2,877image tokens est.
END-TO-END RECEIPT

Dense pilot run: 18,107 uncached input tokens across four turns; 73,403 cumulative. Representation size and complete agent-loop cost are different measurements.

Methodology
KERN / QUICK INSTALLv0.2.0
$codex plugin marketplace add enoch3712/KERN && codex plugin add kern@kern
Marketplace plugin · configure the compiler model independentlyFull setup

THE 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.

KERN/ILillustrative cache module source hash 9c21… verified
CHANGED SOURCEauthoritative
  1. from hashlib import sha256
  2.  
  3. def load_entry(path, expected_sha):
  4. data = path.read_bytes()
  5. current_sha = sha256(data).hexdigest()
  6. if current_sha != expected_sha:
  7. raise StaleSource(path)
  8. return parse(data)
FULL SOURCEauthoritative bytes

IR COMPILER PROFILE

Luna

Example route for Codex
parse structurelower semanticsdeclare omissionsbind source hash
L2 structure tier
COMPILED KERN ILabridged · derived · cached
KERN-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-literals
COMPACT WORKING SETderived · disposable
KERN IL WORKING SETtask-selected pages

RUNTIMEGPT-5.6 Sol

BEFORE WRITEFAULT EXACT SOURCE

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.

SOURCE REPOSITORYauthoritative
src/agent.ts a84f
src/cache.py 9c21
tests/cache.py 41bd
EXACT SOURCEif current_sha != expected_sha: reject_stale_commit()
IL
KERN MIRRORderived cache
manifest.json
ir/src/agent.ts
ir/src/cache.py
images/src/cache.py
JIT COMPILELuna
PAGE
MODEL CONTEXTworking set
repo map
cache.py · KERN IL
cache.py · exact source
WRITE GATEHASH MATCH

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.

1950s

Punch cards

Humans speak machine.

Every instruction explicit, physical, and expensive.

1957–1985
C++

Compilers

Humans write source.

Translation separates how software reads from how it runs.

1995–2002
JVMCLR

VMs + IL

Compile once. Optimize later.

Portable bytecode, JIT compilation, runtime specialization.

2020–2025
ClaudeOpenAICursor

Raw prompts

Paste the repo into chat.

Our smartest models reread every import, brace, and comment.

2026
KERN/IL

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

Inspect the protocol. Improve the compiler.