Context Bonsai
A plugin for OpenCode that lets the LLM self-edit its own context. It works like compaction but can retrieve compacted information when needed; rather than only compacting when the context is completely full or compacting everything, it picks individual messages and tool calls whose details are no longer necessary, such as a solved debugging session or a completed feature implementation. It has also been made to work in Claude Code via tweakcc, with planned versions for open source coding agents like Codex, pi, and Gemini, and the development process is livestreamed.
What it addresses
Standard context compaction is lossy, kicks in only when the context is completely full, and compacts the entire context, discarding details that may still be needed.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
Context Bonsai
A plugin for OpenCode that lets the LLM self-edit its own context. It works like compaction but can retrieve compacted information when needed; rather than only compacting when the context is completely full or compacting everything, it picks individual messages and tool calls whose details are no longer necessary, such as a solved debugging session or a completed feature implementation. It has also been made to work in Claude Code via tweakcc, with planned versions for open source coding agents like Codex, pi, and Gemini, and the development process is livestreamed.
Problem: Standard context compaction is lossy, kicks in only when the context is completely full, and compacts the entire context, discarding details that may still be needed.
Posted by @planckscnst · Original source ↗
Source text · @planckscnst · · Source ↗
I'm working on "context bonsai" which is currently a plugin for OpenCode that allows the LLM to self-edit its own context. It works like compaction, but it can retrieve back the compacted info if needed.