r/opencodeCLI • • Oct 25 '26

👍 New experimental background compaction in OpenCode

Post image
85 Upvotes

12 comments sorted by

View all comments

1

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.