← ClaudeAtlas

ccrlisted

ccr — reversible payload compression: shrink any blob (tool output, log, RAG chunk, file) BEFORE it enters an LLM's context, while caching the full original locally so it can be expanded byte-for-byte on demand. The payload-axis counterpart to a knowledge-graph loader (the retrieval axis): the model sees a compact lossy view + a handle (ccr://<sha256>), and calls retrieve(handle) only when it needs the bytes back. Content-routed deterministic compactors (json skeleton / code outline / text head-tail); stdlib-only, no ML. Lifted from the CCR component of github.com/chopratejas/headroom. USE WHEN — a tool output / log / RAG chunk / file is too large for context and you want to compress it reversibly; "compress this payload", "shrink this before the model", "reversible compression", "cache the original and give me a handle". NOT FOR — loading knowledge-graph entities (that's the kg loader, the retrieval axis); lossless whole-file compression (use gzip); semantic summarization that does not need byte-exact recove
broomva/skills · ★ 3 · AI & Automation · score 69
Install: claude install-skill broomva/skills
# ccr — reversible payload compression (the payload axis) `ccr compress <file|->` · `ccr retrieve <handle>` · `ccr stats` Shrink any blob — a tool output, a log, a RAG chunk, a file — **before** it enters context, while keeping the original recoverable. The **payload-axis** counterpart to a knowledge-graph loader (the **retrieval axis**): kg shrinks *which* entities reach the model; ccr shrinks *each blob* that does. Lifted from the **CCR / reversible-compression** component of [Headroom](https://github.com/chopratejas/headroom) (28.5k★, Apache-2.0). We lifted the *pattern*, not the dependency. Anchor: **BRO-1521**. ## The one idea > Compression is reversible because the **full original is cached locally**, > keyed by content hash. The model sees a compact lossy *view* + a handle > (`ccr://<sha256>`); it calls `retrieve(handle)` only when it needs the bytes. So the view can be aggressively lossy without losing information — the loss is recoverable on demand. Same shape a KG loader uses on the other axis: a lossy catalog projection that expands to the full entity body on load. ## Mechanism Dispatch by detected content type (a file-extension hint beats the content heuristic, which beats nothing): | Type | Compact view | Reversible? | |---|---|---| | `json` | type/shape skeleton (keys + value types + collection sizes; **no leaf data**) | yes (cache) | | `code` | structural outline (imports + `def`/`class`/`fn` signatures w/ line numbers; **bodies elided**) | yes (cache)