I built a cache-friendly context compacting plugin for OpenCode
github.com/lennartschoch/opencode-cache-compact The default context compacting mechanism in OpenCode strips a bunch of tokens from the beginning of the conversation (system prompt, tools etc). This is fine for hosted models, but on a local model this means you'll prefill the entire conversation that's already cached. I built a plugin that keeps the conversation as-is, prompts the model to write a summary and then transforms the conversation to erase everything aside from system prompt, tools and summary - because the entire conversation is cached, this is super fast (usually around 1-2 minutes on my Strix Halo, previously >10min). Would love to get some feedback on this - is this useful for anyone else? This is my first open source project in the local LLM space so I'd love to know your thoughts!