Magic Context
A self-managing memory system for coding agents that captures durable project knowledge during context compaction, consolidates and verifies it against the codebase overnight, and recalls the right memories automatically each turn.
Magic Context gives a coding agent a persistent memory so a session does not start from zero each time and does not lose context at a compaction pause. As the agent's conversation history is compressed, a capture step lifts durable knowledge, such as decisions, constraints and conventions, into project memory automatically, from work the agent is already doing.
Overnight, separate consolidation agents verify stored memories against the current codebase, remove duplicate or stale entries, and promote memories that recur across sessions. During ordinary work, the relevant memories surface automatically each turn, and the agent can also search across memories, past conversations and git history on demand, so one long-running session can act like a teammate who has been on the project from the start.
It works with OpenCode, Pi and OMP, is configured through an interactive setup wizard that detects the available models, and is written in TypeScript under the MIT license.