Skip to content
DAY ZERO

Lab · technical verification

Token compression reproduction

Verdict

PARTIALLY REPRODUCED

Three of five pre-registered claims supported at their thresholds; two not. Probe retention 1.0000, 0 transformation errors — the compression is genuinely lossless. Both halves of this verdict matter, and neither is a statement about the project’s honesty.
46.30%
JSON vs raw
median savings
28.41%
JSON vs minified
the pre-registered decisive comparison
0.00%
Coding vs raw
at every quantile — min, median, max
0.00%
Agent context vs raw
median — but bimodal, see below

01

The published claims, verbatim

Two public descriptions of the same project differ. Both are recorded exactly; the discrepancy was resolved against the experiment, not in it — the protocol tests the lower coding bound (15%).

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

CLAIM-SRC-AGitHub repository description

60–95% fewer tokens (for JSON data), 15-20% fewer tokens (for coding agents)

CLAIM-SRC-BREADME.md, branch main

The repository description says 20% for coding agents; the README says 15–20%. Where a published range and a published point differ, the experiment tested against the lower bound — a deliberately generous reading.

02

Experiment design

The protocol — dataset, baselines, thresholds and verdict rules — was committed and hashed before any measurement was taken. The dataset was constructed by the analyst, not chosen by the project.

35
Samples
1.57 MB total
12 · 12 · 11
JSON · coding · agent
structured JSON, coding context, agent context
2 tokenizers
o200k_base · cl100k_base
primary: o200k_base
4 baselines
RAW · MINIFIED · COMPACT_JSON · GZIP_B64
primary comparison: HEADROOM vs MINIFIED

Why MINIFIED is the primary baseline: pretty-printed JSON is largely whitespace, and stripping whitespace costs one line of code. A compression tool earns its place by what it saves beyond that. Defaulting the comparison to RAW would make every result look stronger than it is — so this page defaults to MINIFIED everywhere, and shows RAW as the labelled marketing comparison.

protocol sha2560c8aa36e13d554177bf18a57ba263f2fe5c678ea53929c6caa6b778b8469eaf0dataset manifest sha256c16472c28c06194bfc0ffcf57c0acc77363847866835014e6a19b4680f3622bf

One input is withheld from the public repository

The run used all 35 samples and its results are reported unchanged. Thirty-four of them ship in the public repository; one structured-JSON sample is a slice of a raw GitHub profile cache carrying names, locations, bios and contact fields, and redistributing it in bulk would break this project’s own privacy rules. Its metadata and original SHA-256 are published in its place.

Re-running the pre-registered analysis on the 34 distributable samples returns the same verdict, the same claim outcomes, the same 0.00% coding and agent results and the same 1.0000 retention; the structured-JSON medians move by −0.28 pp against raw and −1.36 pp against minified — a slightly less flattering picture, not a more flattering one, because the withheld sample was highly compressible and its removal trims the best case.

03

Results, by category and baseline

Every dot is one sample. Switch the category and the baseline — the default is the decisive one, HEADROOM vs MINIFIED. Negative values mean headroom's output tokenised larger than the baseline.

12 samples · canonical median 28.41% · the comparison that matters: whitespace minification costs nothing and takes one line

-100%-50%0%50%100%← output grew vs baseline · token savings · output shrank →median 28.41%json_out_review_queue: -4.90%json_out_source_yield: 0.00%json_papers: 14.16%json_out_holdout_results: 14.52%json_out_negative_controls: 18.34%json_out_graph: 27.05%json_out_signals: 29.78%json_out_attention_vs_construction: 48.66%json_repos_40: 64.60%json_repos_all: 85.34%json_contributors: 86.59%json_users_120: 86.85%
Per-sample values as a table (12 rows, tokenizer o200k_base)
SampleRaw tokensMinifiedHeadroomvs MINIFIEDProbe retention
json_out_review_queue26,64918,17819,068-4.90%1.0000
json_out_source_yield6914534530.00%1.0000
json_papers2,7601,9851,70414.16%1.0000
json_out_holdout_results1,35293079514.52%1.0000
json_out_negative_controls1,6951,19497518.34%1.0000
json_out_graph83,77461,98845,22027.05%1.0000
json_out_signals129,03598,19068,94829.78%1.0000
json_out_attention_vs_construction3,6392,3861,22548.66%1.0000
json_repos_4014,77410,2903,64364.60%1.0000
json_repos_all37,09425,7943,78185.34%1.0000
json_contributors21,28111,9531,60386.59%1.0000
json_users_12013,4149,0361,18886.85%1.0000

Canonical distributions (o200k_base, pre-registered quantiles)

Categorynvs raw — median (p25 · p75)vs minified — median (p25 · p75)minify alone vs rawretention
Structured JSON1246.30% (39.00 · 86.19)28.41% (14.25 · 80.16)30.84%1.0000
Coding context120.00% (0.00 · 0.00)-8.00% (-9.52 · -3.68)7.40%1.0000
Agent context110.00% (0.00 · 28.94)-8.67% (-10.57 · -0.11)8.69%1.0000

Agent context is the interesting distribution: a median of 0.00% hides a bimodal split — structured-ish agent outputs (API pages, log streams) compressed by as much as 72.48%, while code-like agent outputs were routed to a protected class and left untouched. The router’s protectiveness is a defensible design choice; it is also why the headline coding claim does not show up here.

04

Pre-registered claims, scored

ClaimThresholdMeasuredResult
CLAIM-AReduces tokens relative to raw input (structured JSON)> 0% vs raw (structured_json)46.30%● SUPPORTED
CLAIM-BReduction exceeds trivial minification (structured JSON)>= 25.0% vs minified28.41%● SUPPORTED
CLAIM-CTask-relevant information survives — “same answers”>= 0.95 probe retention1.0000● SUPPORTED
CLAIM-DJSON reduction reaches the published 60–95% band60.0-95.0% vs raw46.30%✕ NOT SUPPORTED
CLAIM-ECoding-agent reduction reaches the published 15–20% band>= 15.0% vs raw0.00%✕ NOT SUPPORTED

The verdict rule was itself pre-registered: PARTIALLY REPRODUCED means at least one claim supported at threshold and at least one not.

05

The baseline is part of the claim

Step through the three comparisons. The measured data never changes — the same tokens, the same samples, the same run. What changes is the zero point.

46.30%median token saving · vs RAW (pretty-printed)

The published comparison. Measured against pretty-printed JSON, the median saving is large.

vs raw
46.30%
minification alone
30.84%
vs minified
28.41%

For structured JSON, headroom saves a median 46.30% against pretty-printed input — but trivial whitespace minification alone saves 30.84% (median) on the same samples. Measured against minified input, headroom’s own contribution is a median 28.41%.

That remaining 28.41% is real, lossless, and worth having. But a majority of the headline number is supplied by a baseline choice, not by the compressor — which is why any compression claim is unevaluable until you know what it was measured against. The baseline is part of the claim.

06

The coding claim, and three attempts to rescue it

All 12 coding samples produced 0.00% savings versus raw — at the minimum, median and maximum. Before concluding anything, the experiment tried to prove itself wrong three ways.

SUPP-1

The 0% coding result is an artifact of presenting a single recent tool output; real savings come from compressing OLDER conversation turns.

Six-file multi-turn coding session (read_file tool calls interleaved with assistant turns), headroom.compress(model_limit=200000).

FALSIFIED. Every message was routed to a protected class. Multi-turn framing does not change the result.

SUPP-2

Context pressure triggers compression that a large model_limit does not.

Same session with model_limit=20000 against 16,803 tokens of content.

FALSIFIED. Tight context pressure produced no additional compression.

SUPP-3

Code compression requires the optional [code] extra, which the base install omits.

pip install 'headroom-ai[code]', then re-run a single source-file tool output.

FALSIFIED for the library path. The extra installs, but the router still protects recent code.

The mechanism is visible in the router traces: recent code and user messages are routed to a protected class and passed through untouched. On this benchmark, the published coding-agent savings did not materialise under the library’s default entry point — including with the [code] extra installed, under context pressure, and in multi-turn framing. Versus minified, the coding median was -8.00% — negative, because headroom’s structural wrapping adds tokens it cannot recover on content it declines to compress.

07

What this result is — and is not

  • Headroom is real engineering

    The structured-data path is a genuine, working, content-aware compressor with reversible transforms — not a fake wrapper. Retention 1.0000 across 35 samples and zero transformation errors is a strong engineering result.

  • The structured-data result is strong

    A median 28.41% beyond minification, lossless, reaching 86.85% on compatible schema structure. On the right workload this is significant, real savings.

  • The coding claim did not reproduce here

    0.00% at every quantile versus raw, on all 12 coding samples, under the library's default entry point — with three pre-registered rescue attempts falsified.

  • This benchmark is limited

    One environment, one entry point, 35 samples, and several untested configurations (proxy, wrap, MCP, the prose model, cross-agent memory). It is a reproducible data point about claim scope — not a universal verdict on the project, and not an accusation of dishonesty.

Untested configurations (6)
  • headroom proxy (--port) path
  • headroom wrap <agent> path, which also installs Serena semantic code navigation
  • MCP server path
  • Kompress-v2-base prose model (HuggingFace download; 8 GB RAM machine)
  • cross-agent memory and `headroom learn`
  • sessions substantially longer than 17k tokens

Environment: headroom-ai 0.36.5, tiktoken 0.14.0, Python 3.14.3, macOS-26.3-arm64-arm-64bit-Mach-O. Zero paid API calls. The protocol, dataset manifest and results are committed in the repository — see the methodology timeline for the commit ordering.