flatten-mcp
Cut the tokens every Claude Code session carries — real money on the API, more headroom before the limit on a subscription — without compacting your history into a lossy summary or losing a single line.
340,071 → 132,800 tokens — a 61% lighter session, every line of history intact.
Most of a long session's tokens are bulk the model already distilled into prose — the
2 MB log it boiled down to one line, the screenshot it described, the five files it
summarized. That raw source has done its job. flatten-mcp sets it aside in a local backup
and leaves a small [FLATTENED …] marker, so every resumed turn carries far fewer tokens.
Your prompts and the exact timeline stay verbatim — nothing is rewritten, nothing is
summarized away, and any block is one call (or one unflatten) from coming back.
Who it's for: heavy Claude Code users — large file reads, long command logs, or screenshot-heavy (Playwright) sessions — who want to pay for fewer tokens without losing their history.






