Semantic compression
A summarization model reads the old region and writes a condensed natural-language state transfer.
It does not ask another LLM to summarize old turns. It converts retired conversation history into a compact transcript, prints that transcript onto model-tuned PNG pages, and feeds those pages back through the current model’s vision input.
Both retire old messages from the active provider request. The difference is what replaces them.
A summarization model reads the old region and writes a condensed natural-language state transfer.
A local deterministic pipeline serializes the old region and rasterizes it. No summarization model is called.
The normal OMP compaction machinery chooses the boundary first. Snapcompact begins only after it receives the prepared “old” region.
OMP decides what can leave the live context while retaining a recent tail.
Compaction appends a first-class session entry. It does not visually erase your scrollback, but it changes which path entries are rebuilt into the next provider request.
Tool calls and results are paired, noise is bounded, and repeated role prefixes are elided. The goal is high information density before rasterization.
¶user:Track down why the parser test is failing. ¶call:read(path="src/parser.ts")//inspect parser <out> …bounded source listing… […middle elided…] …error tail… </out> ¶ai:The branch treats an empty token as EOF. I’ll patch the guard.
Tool results are indexed by call ID and merged into the originating ¶call: block. Orphans remain standalone.
Zero-width control markers switch the native renderer to gray ink, so conversation text visually dominates tool noise.
A result explicitly flagged contextually useless—and its paired call—does not enter the archived source.
The TypeScript layer controls text shape and pagination. Rust owns the hot path from prepared page text to PNG bytes.
Serialize, normalize, choose shape, calculate cell geometry, paginate, plan HQ/LQ regions, and launch frame renders concurrently.
Prepared page text plus font, cell dimensions, ink variant, columns, repetition, and target width cross into native code.
Draw bundled bitmap/TrueType glyphs, apply dim spans and newline cells, hug actual row height, encode PNG, return base64.
The real implementation is cell-aware and Unicode-aware. This calculator mirrors the core geometry with character-level approximations so the layout is understandable.
A Claude routed through another gateway still gets Claude-oriented glyph geometry. The API carrying the request determines image token estimation and detail hints.
| Reader line | Current auto geometry | Frame width | Why | Billing family |
|---|---|---|---|---|
| Claude Opus 4.7+ / Fable / Mythos | 11on16-bw | 1932 px | Extra tracking; high-res line can use a larger square under the visual-token cap. | Actual request API |
| Older Claude | 11on16-bw | 1568 px | Same readable tracked glyphs, conservative size for lines that downscale larger inputs. | Actual request API |
| Gemini 3.x | 8on22-bw | 2048 px | Extra leading keeps rows legible; OMP models image cost as fixed per image. | |
| GPT / Codex | 8on22-bw | 1568 px | Extra leading; larger frames do not improve characters per estimated patch token. | OpenAI |
| Kimi | 8on22-bw | 1568 px | Current source rule; image processing reportedly downscales beyond the useful range. | Route-dependent |
| GLM | 8on16-bw | 1568 px | Denser 8×13 glyphs on a 16 px pitch. | Route-dependent |
| CJK-heavy / unsafe fallback | silver16-bw | model default | Unicode-focused Silver font when the bitmap shape cannot safely render the text. | Actual request API |
Every later Snapcompact pass unfolds the bounded prior archive source, appends newly retired history, replans the entire layout, and renders fresh frames.
CompactionEntry {
type: "compaction",
summary: "reading guide + FILES + HISTORY",
firstKeptEntryId: "e07",
tokensBefore: 184320,
preserveData: {
snapcompact: {
text: /* bounded normalized source */,
textHead: /* oldest verbatim edge */,
frames: [
{
data: "iVBORw0KGgo…",
mimeType: "image/png",
cols: 175,
rows: 120,
chars: 20841,
font: "8x13",
variant: "bw"
}
],
textTail: /* newest verbatim edge */,
totalChars: 612044,
truncatedChars: 0
}
}
}
A caller may lower it, but the core compactor clamps the persisted frame count to the default upper bound.
On context rebuild, OMP keeps the newest frames that fit and inserts a chronological omission notice for older images.
Archive, system-prompt, and tool-result images share a per-request image budget.
OMP treats Snapcompact as one strategy inside a larger maintenance system, not as an unconditional replacement.
OMP also has a request-time transformer that can rasterize large prompt material without creating a compaction entry.
Runs when context maintenance chooses a compaction boundary.
Runs per request after messages have been converted for the provider.
Snapcompact is clever because it exploits a different provider billing and representation channel. It is not universally superior to a good semantic summary.
The settings are separate so archive compaction can be enabled without also imaging system prompts or tool results inline.
compaction.strategy = "snapcompact"Selects local bitmap archival instead of the usual summarizer for eligible compactions.
snapcompact.shape = "auto"Lets model ID choose geometry and the request API choose billing estimation.
snapcompact.systemPromptSeparate inline mode: none, context/AGENTS-style sections, or all prompt text.
snapcompact.toolResultsSeparate inline switch for older large historical tool results.
# Conceptual settings paths compaction.strategy = "snapcompact" snapcompact.shape = "auto" snapcompact.systemPrompt = "none" snapcompact.toolResults = false # Manual behavior /compact # honors configured strategy /compact <instructions> # directed LLM summary instead
The explainer prioritizes current source behavior over prose when they differ.