# Anyone have insights into how compaction works under the hood? — retained record

> Retained reddit record from reddit:ClaudeAI.

Canonical: https://highsignal.app/data/records/a57c91e986d41380

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeAI)  published 2026-10-30 20:26 ingested 2026-10-31 02:36

[original source ↗](https://www.reddit.com/r/ClaudeAI/comments/1xjqf2s/anyone_have_insights_into_how_compaction_works/)

## retained text



```
I’m building a chat app to talk to Claude models via the API and my next step is to create an auto-compaction mechanism for when the chat grows too long. Yes I know the API has a server-side function for this, but I’m building my own. Does anyone know how compaction works under the hood on Claude.ai? I’m not trying to copy them (I want to build something better) but trying to understand how it currently works as a baseline. For example the way the claude.ai currently shows it is a progress bar saying “making room for more conversation” which quickly fills to 60%, then slower to 95%, and then stays at 95% for a long while. I wonder what’s going on in the background to explain that.
```



document fetched 2026-10-31 00:21 · canonical https://reddit.com/r/ClaudeAI/comments/1xjqf2s/anyone_have_insights_into_how_compaction_works
