Compressing small tool results destroys structure silently; consider excluding shell/file reads by default
headroom-ai 0.26.0, via headroom wrap claude (Claude Code).
Compressing short tool results destroys their structure in a way that's hard to notice. ls -la came back to the agent as:
128 448 09:26 1760 09:28 11980 16767 2394 1262
Numbers and quoted strings survive; filenames, paths and prose don't. Same for git status, grep -n, small JSON dumps.
The problem isn't lost bytes, it's that the result still looks structured. Truncation announces itself and you retry. This doesn't — the agent reads it as data. Mine nearly reported project state off that output before catching it.
It also costs more than it saves at this size. One session: 8-10 extra round-trips re-running commands, routing output through scratch files, and calling headroom_retrieve. At ~36k context, a single wasted retry burns about 4.6 requests' worth of the compression savings reported for that session.
My daemon was running with HEADROOM_MIN_TOKENS=120 rather than your 500 default — I haven't traced where that came from and it may well be my own setup, so treat the specific number as mine, not yours. The shape of the problem holds at any low floor though.
Setting HEADROOM_EXCLUDE_TOOLS=Bash,Read,Grep,Glob with a 2000 floor fixed readability completely, and session savings stayed around 20%. The wins clearly come from large repetitive payloads and re-sent history, not from a 200-token ls. So the two goals don't seem to be in tension — excluding shell and file-read tools by default, or documenting that pairing somewhere findable, would cost you very little.
Related: #3588 (changing these settings needs a manual daemon kill).
Source: headroomlabs-ai/headroom