opencode-plugin-memory gives an OpenCode agent memory that a human has to approve: the agent proposes an entry, a bot opens a pull request, you merge it. Markdown in Git, no vector database.
0.7.0 is the biggest release since the first version. Until now that memory lived inside one repository. Now it can live in two places at once.
A global store, next to the project store
There are now two stores:
- Global — one private repository of yours, cloned on your machine, injected into every session.
-
Project — the repository's own
memory/folder, shared with whoever has that repo.
A proposal names its store and picks global by default once the clone exists. Everything else keeps working: with no global clone, memory stays inside each project exactly as it did in 0.6.0, and the prompt says so in one line instead of failing.
The split matters because knowledge has two lifetimes. How an API behaves, or a review rule you hold everywhere, belongs in global. A repository's architecture and business definitions belong to it alone.
Prompt space is shared, not stolen
Both indexes now share one character budget. The global section is capped at a configurable share (70% by default), and the project section keeps at least the rest reserved, so a large global store can never push project entries out of the prompt. Budget one side does not need flows to the other, and a truncated section says so instead of silently vanishing.
Publish once, one pull request per store
Publishing now covers every store with pending proposals and returns the pull request links grouped by store. A global proposal opens its pull request in your private memory repository; a project proposal opens it in the project repository.
Each store has its own staging folder, lock, and publish state, so a failure in one never blocks the other.
Memory has an exit: implemented
Memory is for what the code cannot say. If a rule will be stated by the code, the tests, or a design document once it is built, it does not belong in memory, because a second copy drifts at the next refactor.
0.7.0 makes that a first-class retirement reason. implemented means the artifact took over: the pull request is marked as graduated, so a reviewer sees the memory is leaving because the code replaced it, not because the rule stopped being true.
Publishing stopped touching your checkout
The bot works in a throwaway git worktree and only removes worktrees it can prove it created. If Git refuses a removal, it leaves the directory alone. A leftover worktree from an earlier crash no longer blocks later runs, and an unreadable memory file is counted and skipped instead of taking the whole index with it.
Upgrading
No action is needed. Existing project memories stay where they are.
If you want the global store, create a private repository, clone it to ~/.local/share/opencode/memory, and give it memory/active/, memory/retired/, and a .gitignore containing .memory/. The next session picks it up without a restart. Prefer the old behavior? Turn the global store off.
Known limitations
- Nothing is retired automatically, including a memory a finished feature made redundant.
- After merging, you pull. The plugin does not sync from GitHub for you.
- The background audit reads memories in batches and can miss a relationship between two entries it never sees side by side.
- The global store is yours to create; it is not scaffolded for you.
Try it
opencode plugin add @chncaesar/opencode-plugin-memory@latest
Requires OpenCode 2.x.
Top comments (0)