supermemory·Guides
Which memory plugin should I use for OpenCode?
OpenCode keeps no memory between sessions on its own: it loads AGENTS.md and your config and starts cold. Plugins add memory, and they differ in where it lives. opencode-supermemory, the official supermemory plugin, installs with one command, injects your profile on the first message, searches memory on each prompt, saves completed turns and shares one memory per repository with Claude Code, Cursor and Codex; it runs hosted or against supermemory local. Mem0 publishes @mem0/opencode-plugin for the Mem0 platform. Community plugins such as opencode-mem and opencode-agent-memory keep memory in local files or a database on your machine.
What does OpenCode remember on its own?
Instructions and configuration. AGENTS.md is read each session, opencode.json (or .jsonc) holds providers, MCP servers, permissions and the plugin list, and a session can be resumed. There is no store of what earlier sessions learned, so the first message of every session is the first time OpenCode has heard of your project.
How do I install the supermemory plugin for OpenCode?
- Run
bunx opencode-supermemory@latest install(add--no-tuiif an agent is running it). The installer adds the plugin to~/.config/opencode/opencode.jsoncwith one config that works on OpenCode 1 and 2, and allows the recall permission. - Sign in:
bunx opencode-supermemory@latest loginopens the browser. An API key from the console works too, asSUPERMEMORY_API_KEY. - Check it with
bunx opencode-supermemory@latest status, then run/supermemory-indexin a chat to seed memory with the codebase.
bunx opencode-supermemory@latest install
bunx opencode-supermemory@latest login
bunx opencode-supermemory@latest status{
"plugin": ["opencode-supermemory@latest"],
"plugins": ["opencode-supermemory"],
"permission": { "supermemory_recall": "allow" }
}What does opencode-supermemory do in a session?
- Context injection. On a session's first message, your profile facts go into the agent's context.
- Direct recall. On every substantive prompt it searches the current project and injects up to five fresh matches.
recallModecan be"advisory"(the agent decides) or"off". - Automatic capture. Completed turns are saved every
captureEveryNTurnsturns, and the remainder when the session ends or OpenCode shuts down. - Compaction. On OpenCode 1 it summarises the session at 80% of context; on OpenCode 2 it enriches native compaction. Either way the summary is saved as a memory.
- Privacy. Anything inside
<private>tags is never stored.
The agent also gets a supermemory tool with add, search, profile, list and forget modes, and the chat commands /supermemory-index, /supermemory-login, /supermemory-logout and /supermemory-status.
Which memory plugins exist for OpenCode?
| Plugin | Where memory lives | Automatic recall and capture | Shared with other tools |
|---|---|---|---|
| opencode-supermemory | supermemory, hosted or local | Yes | Yes, one memory per repository with Claude Code, Cursor and Codex |
| @mem0/opencode-plugin | Mem0 platform | Mem0's plugin; see its README | Mem0's other integrations |
| opencode-mem | Community plugin (MIT); storage on your machine | See its README | No |
| opencode-agent-memory | Community plugin (MIT); storage on your machine | See its README | No |
| AGENTS.md and notes files | The repository | No | Anything that reads the file |
The repository container is what makes the supermemory plugin different from a local store. A plugin keys memory to the repository: one container named repo_<project>__<hash>, where the hash comes from the normalised Git remote. Clones and worktrees of the same repository share it; two repositories with the same folder name do not collide. The Claude Code, Cursor, Codex and OpenCode plugins all write to the same container, so a decision saved in one tool is there when you open the next.
Can I keep the memory on my machine?
Run npx supermemory local, point the plugin at it with SUPERMEMORY_API_URL="http://localhost:6767" (or baseUrl in its config file) and use the API key printed on first boot. supermemory local is free for up to 10,000 stored documents and keeps everything on your machine; it is not open source, and memories do not move between it and the hosted service.
Questions
Does OpenCode have memory across sessions?
Not on its own. It reads AGENTS.md and its config each time. A memory plugin such as opencode-supermemory adds recall and capture.
Does opencode-supermemory work on OpenCode 2?
Yes. The installer writes one config that OpenCode 1 and 2 both read. If OpenCode will not start after an older install, run the installer again to update the config.
Do I need an API key?
No. bunx opencode-supermemory@latest login signs you in through the browser. SUPERMEMORY_API_KEY works as an alternative.
Where is the plugin configured?
~/.config/opencode/supermemory.jsonc: similarity threshold, how many memories to inject, recall mode, capture frequency and the repository container override.
Is the memory shared with Claude Code?
Yes. OpenCode, Claude Code, Cursor and Codex plugins write to one container per repository, so they share memory for the same repo.
Plugin facts from the supermemory docs and github.com/supermemoryai/opencode-supermemory. OpenCode configuration from opencode.ai/docs. Other plugins from their npm and GitHub pages. Checked November 10, 2026. The setup steps restate the docs page for this integration; when the two differ, the docs are current.