Smarter Compact: MCP server trims agent context, 72% cheaper long sessions with full recall

goost95 · reddit · 2026-11-06

An open-source (Apache-2.0) MCP server + local proxy that stores sessions in SQLite, trims old turns at your token limit, and gives the agent search/SQL/recall tools to fetch trimmed context. On ContextBench with Haiku 5.5, the longest log task went from 0.35 to 1.00 score, peak prompt 762k→95k, cost $6.07→$0.38; average savings 72%. Key lessons: the trim note must name the tools explicitly (otherwise the agent never searches), and trimming to half the limit beats cutting deeper.

Related event: Smarter Compact Cuts Long Agent Session Costs 72%(2 posts)→

Original post →

More from coding & agent

coding & agent channel →