Compile large codebases for machine attention.
Lazy semantic context for repositories too large to keep raw in a model window, with an exact-source path before every write.
KERN is designed for large codebases. It maintains a lazy, content-addressed intermediate-language mirror of a software repository, gives coding agents a compact semantic working set, recompiles files only when their contents change or become relevant, and faults authoritative source back into context before an edit.
Compression first
In the initial pilot, a 3,704-line Python file moved through three representations:
Stage
Representation
Estimated tokens
Compression vs. source
Source
Authoritative Python
36,674
1.00×
KERN IL
Verified semantic text
5,795
6.33×
Dense
Two lossless-WebP IL pages
2,877
12.75×
That is an estimated 92.2% representation reduction from raw source to dense pages. The selected dense layout passed the pilot's five-fact retrieval check; a more aggressive 9 px layout drifted and is not recommended.
[!IMPORTANT]
These are representation estimates from one redacted pilot file—not total agent-loop savings. System instructions, tool schemas, reasoning, repeated turns, and resident context add cost. The retrieval check was small and compressor-selected; it is not a patch-correctness benchmark or a general accuracy claim.
For project-local installation, updates, uninstallation, and compiler-model routing, see the installation guide.
Use it
KERN activates when an agent needs to understand a large repository, refresh changed context, answer from compressed code, or prepare an exact-source edit. A useful first request is:
Use KERN to map this repository. Report changed, stale, and missing IR pages,
then load the architecture without editing source.
KERN creates a disposable .kern/ mirror beside the repository: