What is Magic Context?
masterMagic Context is a plugin for OpenCode and Pi (>= 0.74.0) designed to provide coding agents with persistent memory and automated context management. It solves the problem of 'starting from zero' in new sessions by capturing decisions, constraints, and conventions into project memory.
Core Capabilities
- Persistent Memory: Project memories persist across different sessions and across both OpenCode and Pi harnesses.
- Automated Context Management: A background 'historian agent' compresses older conversation parts into tiered compartments without interrupting the user's flow or requiring manual compaction pauses.
- Full Recall: Instead of discarding old data, Magic Context compresses and indexes it. The agent can expand compressed compartments back to the original transcript or search across memories and git commits.
Key Agent Tools
ctx_expand: Used to expand a compressed compartment back to its original transcript on demand.ctx_search: Allows the agent to search across memories, compressed session history, and indexed git commits in a single call.