Compactions Are Good Actually
Recently, in our team (& on the internet), compaction has been a hot topic. We have been trying to get people to compact more often because there is a belief that compactions are good, with the current state of models, and are absolutely needed for good outcomes. There’s obvious pushback around it “losing context” or “it being really slow”. I get the complaints and it is definitely annoying to compact but below I will try to make a case that it will be slower & shittier to not compact at the right time.
The dumb zone#
There is a stretch in every long session where the model is still replying and doing the job but is getting worse after each turn. Anthropic wrote this up in September 2025 in Effective context engineering for AI agents, where they call it context rot. I like the more sophisticated term, the “dumb zone”.
as the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases
Anthropic calls it an attention budget. Every token can attend to every other token across the whole context, so n tokens create n² pairwise relationships, and the same budget has to cover all of them. Models also learn their attention patterns from training data where short sequences are far more common than long ones, so they have had less practice with the long ones.
In Lost in the Middle, researchers found that models do best when the information they need sits at the start or the end of the context, and get noticeably worse when it sits in the middle. LOCA-bench asks the same questions of agents, instead of just focusing on models. It grows the agent’s context by changing the environment while keeping the task identical. Agent performance still took a dive. Interestingly, they also found that context management brought the success rate back up.
Putting it in practice#
One of the things I do at work these days is make sure people get a high quality Claude Code platform they can build with, while keeping costs in check. We believe that people should be compacting more often, and it should be done manually rather than getting hit by the auto compactor, which, honestly, is pretty annoying to work with.
So we started nudging people in their sessions. We started with a hook that fires when a session crosses 100 user prompts or 200k tokens in the context window, and offers /clear or /compact. The challenge is that a threshold is just a number we invented & it doesn’t say what you are doing. Crossing 200k tokens halfway through a refactor is a terrible time to be told to compact. I believe that it is still a good idea to compact at that point but the message potentially doesn’t arrive at the right moment.
So, we decided to add some more that fire at logical conclusions instead:
- a plan or a design doc gets written to
docs/superpowers(we have loads of superpowers users internally!) - a Linear document is saved
gh pr createorgh issue createsucceeds
The logic is that since people have saved their work in an “artifact”, this is the right time to compact because even if the summarizer is shit, they can still get their context back.
I don’t have concrete numbers to share yet on whether these new nudges are working, but I believe that it is the right direction to be heading in. People should be compacting more and more, and doing so manually at logical milestones!