Unbounded context. Memory that manages itself. One session, for life. The hippocampus for coding agents, part of CortexKit.
Repo cortexkit/magic-context, read from GitHub 2 h ago. cortexkit has not joined Take My Repo.
This patch fixes doctor --fix for Pi, which could delete files outside Magic Context's caches. Upgrade before you run doctor --fix or doctor --force again.
Update the plugin with npx @cortexkit/magic-context@latest doctor, then restart OpenCode, Pi or Oh My Pi. No database migration is needed.
doctor --fix for Pi could delete a linked folder's contents: while looking for old copies of Magic Context in Pi's caches, doctor followed linked folders. If a project's Pi package folder was a link to a checkout, which a local or linked install creates, doctor walked into that checkout. When the checkout held an older Magic Context version, doctor deleted it as a stale cache. Doctor no longer follows links when it looks for caches. Before it clears anything, it checks that the folder is a real folder inside the cache, with no linked folder on the way, and it checks again right before it deletes. A folder that fails the check is left alone, and doctor says so. The same check now guards every cache doctor clears: Pi, Oh My Pi, OpenCode 1 and OpenCode 2. Real stale caches are still cleared as before.doctor --fix for Pi treated a beta or other tagged install as stale: with Pi set to @cortexkit/pi-magic-context@beta (or another tag), doctor compared the installed copy with the latest release and deleted it when they differed, even when the installed copy was newer. Doctor now looks up the tag you chose and clears only a copy that is older than it, as the OpenCode 2 check already did. When it can't tell which version you want, it keeps your installed copy.This patch fixes two cases where Magic Context could act on stale text: an OpenCode 2 side question after you edit an earlier message, and nightly memory verification after a memory is corrected mid-run.
Update the plugin and restart OpenCode, Pi or Oh My Pi. No database migration is needed.
This patch makes /ctx-wrapup shrink the prompt on your next message, and stops it from planning with the wrong context window after a restart.
Update the plugin and restart OpenCode, Pi or Oh My Pi. No database migration is needed.
/ctx-wrapup didn't shrink the prompt until the next rebuild (#967, thanks @JohanTG): below the execute threshold, a finished wrapup saved its new summaries, but the next request still carried every raw message they covered. The summaries only reached the model at the next natural rebuild, which could be many turns later. A successful wrapup now applies its new history on the very next message, as /ctx-flush does: the summaries come in and the covered raw messages leave the request. The cached baseline isn't rebuilt. A wrapup that adds no summaries changes nothing. If the host restarts before your next message, the summaries apply at the next rebuild instead, and the completion message says so./ctx-wrapup planned with a 128,000-token window after a restart (#967): when no model had been used yet in the running host, the command sized its chunks for a 128,000-token window, which made a wrapup on a large-window session take far longer than needed. It now uses the session's selected or last model and that model's real window, and refuses with a clear message when no window is known.This patch stops a search from sending a project's whole memory store to the embedding provider at once, and stops effort changes from rewriting the prompt cache on newer Claude models.
Update the plugin and restart OpenCode, Pi or Oh My Pi. No database migration is needed.
This patch fixes the docs upkeep maintenance task, which failed on every run for projects whose docs have subsections.
Update the plugin and restart OpenCode, Pi or Oh My Pi. No database migration is needed.
### subsections didn't count as part of its ## section. When the model proposed an update to a whole ## section, including its subsections, the check refused it. One refused entry then discarded the whole proposal, and the task never moved past it, so it failed the same way on every run. A section now runs from its heading to the next heading of the same or a higher level (headings inside code blocks don't count). Replacing or removing a ## section includes its subsections, and protected regions are still kept byte for byte. Each proposed change is now checked on its own: an invalid one is dropped with its reason recorded, the valid ones are kept, and the run completes and moves on.This patch fixes summaries on Oh My Pi 19.1 and two doctor gaps for Pi and Oh My Pi users.
Update with npx @cortexkit/magic-context@latest. No database migration is needed.
doctor --fix now repairs Pi (#961, thanks @VibePDF): --fix never reached the Pi doctor, so only --force could repair a Pi install. --fix now repairs Pi's config and clears stale extension caches, and --force clears them even when they look current. Before clearing, the doctor now checks that no running Pi or Oh My Pi still has those files or Magic Context's database open. If one does, it leaves the cache alone and names the process to quit. If it can't check, it refuses, as it already did for OpenCode.--fix or --force it now says how to upgrade: run omp plugin install @cortexkit/pi-magic-context@latest, then restart running Oh My Pi sessions. Config repairs for Oh My Pi still need --force.