Install the plugin
Authenticate
Browser login (recommended):- macOS / Linux (zsh)
- macOS / Linux (bash)
- Windows (PowerShell)
~/.config/opencode/opencode.jsonc. This one config works on both OpenCode v1 and v2:
How it works
Once installed, the plugin runs automatically:- Context Injection — On a session’s first message, your profile facts are injected into the agent’s context.
- Direct Recall — On every substantive prompt, the plugin searches the current project and injects up to five fresh matches. Set
recallModeto"advisory"to let the agent decide when to search, or"off"to disable it. - Automatic Capture — Completed turns are saved every
captureEveryNTurnsturns (fresh installs use0, which saves only at the end), and any remainder is flushed when the session ends or OpenCode shuts down. - Keyword Detection — Phrases like “remember” or “save this” nudge the agent to save to memory.
- Smart Compaction — On OpenCode v1, sessions are summarized at 80% context capacity; on OpenCode v2, the plugin enriches native compaction. Both save the summary as a memory.
- Privacy Protection — Content within
<private>tags never persists.
Sessions without automatic memory
Automatic recall, capture and compaction memory run only for sessions you drive yourself. By default the plugin skips:- Subagent sessions — child sessions spawned by the
tasktool (OpenCode v1) or thesubagenttool (OpenCode v2). SetcaptureSubagents: trueto include them. - Headless runs (OpenCode v1) —
opencode runandopencode github run. SetcaptureHeadless: trueto include them. OpenCode v2 gives plugins no signal foropencode run, so v2 runs are treated as interactive.
captureOrchestrated: false to skip them.
Two local indexes under ~/.supermemory-opencode/ keep repeated prompts from being re-sent:
- Opening prompt (
dedupeOpeningPrompt) — an opening prompt of 200+ characters already captured from this machine for the same container in the last 24 hours is replaced by a one-line marker. This applies to the legacy API only; v5 uploads the transcript unchanged. - Recall query (
dedupeRecallQueries) — the same query against the same container within 10 minutes reuses the first result instead of searching again.
SUPERMEMORY_CAPTURE_SUBAGENTS, SUPERMEMORY_CAPTURE_HEADLESS, SUPERMEMORY_CAPTURE_ORCHESTRATED, SUPERMEMORY_DEDUPE_OPENING_PROMPT or SUPERMEMORY_DEDUPE_RECALL_QUERIES. Set it to true or false; it takes priority over the config file.
Memory scopes
Both scopes write to one repository container,repo_{project-name}__{repository-hash}, shared with the Claude Code, Codex, and Cursor plugins. sm_scope metadata keeps them apart.
Memory types
Commands
The installer adds these in-chat commands:Tools
The agent has access to asupermemory tool with these modes:
Configuration
Create~/.config/opencode/supermemory.jsonc:
Logging
View plugin activity:Next steps
GitHub repository
Source code, issues, and detailed README.
Claude Code plugin
Memory plugin for Claude Code.