OpenCode Working Memory plugin
An OpenCode plugin that keeps project decisions and agreements across context compactions and sessions with no extra model calls.
- 199 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Stores project facts in local memory files and adds them to model requests.
Install
- Works in
Manual install
{"plugin": ["opencode-working-memory"]}The plugin is connected by an entry in `.opencode/opencode.json` and `.opencode/tui.json`: `{"plugin": ["opencode-working-memory"]}`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Stores project facts in local memory files and adds them to model requests.
This is third-party code. Review the repository files before installing.
What it does
OpenCode Working Memory adds a memory layer for a project. Durable memory keeps facts, preferences, decisions and references across sessions, while hot context keeps active files and unresolved errors of the current session fresh. Memory is injected into the prompt automatically and piggybacks on OpenCode compaction, so there are no extra LLM or API calls. To save a rule, just say "remember this" or "記住". In the TUI the `/memory` command opens a menu with status, help and a search over `[M#]` entries. Quality guards filter noise, redact credentials, remove repeats and let weak entries fade.
Who it is for. OpenCode users whose project agreements get lost after context compaction or a session change.
Good fit when
- The agent forgets code conventions after another context compaction.
- You want to say "remember" once and not repeat the rule in every session.
- You want to see exactly what is remembered and find an entry by number.
- Extra LLM calls for memory are undesirable because of cost.
Not a fit when
- You do not work in OpenCode.
- You need memory across different projects or teams, while here memory is tied to the workspace.
- The provider rejects multiple system messages and you do not want to enable merge mode.
Example request
Remember: in this project we use pnpm and write tests next to the code.Limitations
Memory is tied to the workspace. For the `/memory` menu the plugin must be added to both settings files, `.opencode/opencode.json` and `.opencode/tui.json`, followed by an OpenCode restart. Strict OpenAI-compatible providers, for example some GWDG and Qwen endpoints, reject multiple system messages: then enable `mergeSystemMessages` or the `OPENCODE_WM_MERGE_SYSTEM_MESSAGES` variable. Filters redact credentials, but review memory contents before publishing. The license is MIT. The last commit is dated October 2026.
How to disable. Remove `opencode-working-memory` from the plugin lists in `.opencode/opencode.json` and `.opencode/tui.json` and restart OpenCode. Delete memory files separately.
FAQ
How do I install the plugin?
Add `opencode-working-memory` to the `plugin` array in `.opencode/opencode.json` and `.opencode/tui.json` and restart OpenCode. Memory activates automatically.
How do I save a rule?
Tell the agent "remember this" or "記住" with the rule text. It goes into project memory.
Does it spend extra model calls?
No. The plugin uses OpenCode built-in compaction and calls no LLM or API to extract memory.
What if there is a system message error?
Enable `mergeSystemMessages` in the plugin options. For older hosts use the variable `OPENCODE_WM_MERGE_SYSTEM_MESSAGES=true`.
How do I view memory?
With `/memory` in the TUI: status, help and a search over `[M#]` entries. The menu only displays data.
Discussion
No questions or reviews yet.
Related
PluginsLong-term memory for OpenCode: preferences and project decisions survive restarts, context wipes and fresh chats.
A long-term memory plugin for OpenCode and Pi: a background historian compresses chat history, a nightly agent curates memory.
Coding memory across sessions, machines and teammates: decisions and dead ends flow into later prompts on their own.
A local context store for coding agents that captures project knowledge and reuses it across Codex, Claude Code and OpenCode
Local long-term memory for agents: decisions, mistakes and preferences are stored on your machine and pulled into new sessions
Semantic code search, cross-session memory and shell command checks for OpenCode. Runs locally on Ollama, with MCP and CLI modes
README in short
The README explains the purpose of memory, a feature table, installation into two settings files, options for strict providers and the `/memory` menu. A diagram shows the flow from "remember this" to context injection.