Skip to content
Kodinn

Caveman · .NET

Compress, don't cut.

Caveman is a .NET context-compression library, published on NuGet and used by Kodinn and KodinnCli. When the conversation grows it does not throw pieces away: it compresses them, with rules that leave code, commands and critical content alone.

How it works

Per content type

Every piece of content (text, tool result, document) follows the right strategy, deterministically: the same input gives the same output.

Cache-aligned

Compression aligns with the provider's cache, so it does not invalidate the prefix already stored.

Guard over critical content

Code protection, and a check for destructive commands: code stays as it is.

Safe and Maximum modes

Choose how much to compress: more careful (Safe) or more aggressive (Maximum), for project instructions and for memories.

In Kodinn

Project instructions

Instruction compression has three levels: off, light or maximum.

Memories

Memories compress too: off, light (default) or maximum.

/organize

If an instruction file stays above 40,000 characters after compression, /organize splits it into KODINN.md plus a folder of documents, with a backup and a verified recomposition. AGENTS.md is never touched.

In KodinnCli

Caveman deterministically compresses the largest tool results before they go back to the model. You turn it on and off with /caveman, just like /privacy for privacy: they are designed to work together.