Measured on real sessions, not promised
14 days of the maintainer's Claude Code transcripts, replayed offline through the same function the hook runs. Token counts are local o200k_base estimates, not billing.
| Tool results | Count | Tokens | Cut |
|---|---|---|---|
| All third-party MCP results | 11,058 | 7.17M → 5.85M | 18.3% |
Supabase execute_sql | 6,571 | 4.97M → 4.03M | 18.9% |
| Search Console analytics | 223 | 702k → 434k | 38.2% |
Vercel list_deployments | 43 | 250k → 210k | 16.1% |
Lossless, checked
All 3,144 SQL results rewritten as tables decoded back to the original rows. Run the replay on your own transcripts.
Where it did not help
Bash output in the same sessions was mostly ad-hoc scripts, and the filters saved under 1% there. Test and build logs are where they pay off. Your numbers depend on what your tools print.
What your agent actually receives
A Supabase-style SQL result. The rows become TSV with the keys once, the escaped {"result": …} wrapper goes, and the untrusted-data warnings stay word for word.
Generated by compact_mcp_text from a six-row fixture. The fixed warning text is most of what remains, so larger results cut further. A cell that parses as JSON is JSON, so null, 51 and "51" stay distinct.
What you get
Every feature earns its place with a measurement or a recovery path.
Lossless MCP compaction
A PostToolUse hook rewrites other servers' JSON rows, wrappers and indentation. Output is never allowed to grow.
Keep the failure
pytest, cargo, go, Docker, kubectl, eslint, tsc and CI logs fold their routine output. Errors stay verbatim, and usagetrim retrieve restores the rest.
Haiku for reading
scout and runner agents return conclusions, not files and logs. --cheap-explore moves Explore back to Haiku.
Read less
Symbol-level reads, an ast-grep index, hash-guarded symbol edits, and task checkpoints across compaction.
Install where you work
Plugins run the pinned release wheel through uv. The Claude Desktop extension installs its own copy.
/plugin marketplace add 00200200/usagetrim/plugin install usagetrim@usagetrimAdds the MCP tools, the Bash and MCP output hooks, the Haiku agents, and the usagetrim:lean output style.
- Download
usagetrim-<version>.mcpbfrom Releases. - Double-click it, or open Settings → Extensions → Install extension.
- Or add the marketplace
00200200/usagetrimunder Customize → Plugins.
codex plugin marketplace add 00200200/usagetrimcodex plugin add usagetrim@usagetrimThe Codex app shows it under Plugins once the marketplace is added.
uv tool install git+https://github.com/00200200/usagetrimusagetrim demousagetrim run -- pytest -qusagetrim demo runs offline on an authored fixture. It is a demo, not a measurement of your sessions.
Next, once it measures well
Ideas from the strongest tools in this space. None ships without a measurement behind it.
- Ranked repo mapAider-style PageRank over the symbol graph, fitted to a token budget.
- LSP references and renameSerena-style precision, falling back to the ast-grep index.
- Lossless log templatingDrain-style folding for dev-server, Docker and CI logs.
- Paired A/B harnessProvider-reported tokens and task pass rate, because smaller output can hide extra turns.