My suggestion is use magic-context. In stead of compacting, context is treated like a garbage collected memory. Information is automatically added and removed. Combined with manually capping context length to 128k, agents run forever without issues.
I am very close to publishing a context management plugin that is a full replacement to compaction. To me, features like background compaction are like someone claiming to have made a better horse carriage after the Model T was about to be made available on the open market.
Also, background compaction won't work well with Claude models.
Anthropic introduced Preserved Thinking with Fable 5.1 and later. Any prefix edit invalidates thinking blocks after that edit. That means all the thinking blocks after the background compaction begins will be invalidated even if carried over. Meaning, all the agent gets to carry over is the file reads, tool calls, bash commands, and assistant text. Anything it thought during that work 'poof'. So, while it might seem convenient to use background compaction, the reality is that you will have degraded model performance while using Claude with that feature.
My context management plugin doesn't work as well for Claude as other models. But it's still far better than compaction, and I have workarounds to carry understanding past prefix edits.
I think it's more likely that messages sent after the background compaction threshold are simply retained as-is (maybe with with some deterministic pruning of tool calls). Faster and avoids the hassle of having to append/update to an existing summary.
Going by the docs, it isn't refreshed. The summary starts at 85% of the threshold and is just held; at the threshold it's swapped in and everything since then is kept as is, so alchninja's read is right. It also falls back to a normal compaction if too much conversation arrived after the held summary, or if the model, instructions or start of the conversation changed. It's skipped under about 64k tokens and right after a model switch, the held summary lives only in memory (lost on restart), and an unused one still costs tokens. If losing detail is the worry, compaction.keep.tokens (15k by default) is the knob for keeping more recent conversation verbatim.
4
u/GW2_Jedi_Master Oct 25 '26
My suggestion is use magic-context. In stead of compacting, context is treated like a garbage collected memory. Information is automatically added and removed. Combined with manually capping context length to 128k, agents run forever without issues.
3
u/Winston-Turtle Oct 25 '26
i donβt think is a big deal waiting for compactation. i like to manage my compactations manually xD
3
u/squirrelscrush Oct 25 '26
I rather use something like
opencode-dcpfor this lol1
u/MakesNotSense Oct 26 '26
I am very close to publishing a context management plugin that is a full replacement to compaction. To me, features like background compaction are like someone claiming to have made a better horse carriage after the Model T was about to be made available on the open market.
Also, background compaction won't work well with Claude models.
Anthropic introduced Preserved Thinking with Fable 5.1 and later. Any prefix edit invalidates thinking blocks after that edit. That means all the thinking blocks after the background compaction begins will be invalidated even if carried over. Meaning, all the agent gets to carry over is the file reads, tool calls, bash commands, and assistant text. Anything it thought during that work 'poof'. So, while it might seem convenient to use background compaction, the reality is that you will have degraded model performance while using Claude with that feature.
My context management plugin doesn't work as well for Claude as other models. But it's still far better than compaction, and I have workarounds to carry understanding past prefix edits.
1
u/Rustybot Oct 26 '26
Ew compaction.
1
u/shady_109 28d ago
doesnt frequent compaction cause a lot of cache hit misses ?
0
u/[deleted] Oct 25 '26
[deleted] β view deleted comment