Add to your ~/.config/opencode/opencode.json:
{
"plugin": ["opencode-working-memory"]
}Restart OpenCode. OpenCode Working Memory activates automatically — no manual setup needed.
Note: The correct key is
plugin(singular), notplugins.
- Edit
~/.config/opencode/opencode.json - Add
"opencode-working-memory"to thepluginarray - Verify the config file was saved correctly
After restarting OpenCode, memory context appears automatically in system prompts. You'll see:
Workspace memory (cross-session, verify if stale):
decision:
- ... (if any long-term memories exist)
---
Memory candidates:
- [project] ... (candidates for long-term memory)
Hot session state (current session):
active_files:
- path/to/file.ts (action, count)
open_errors: (none, or listed)
No tools to call. OpenCode Working Memory works automatically via hooks.
Persists across sessions. Automatically extracted during compaction when you say "remember this" or when important decisions are made.
Tracks current session:
- Active files (what you're working on)
- Open errors (unresolved issues)
- Recent decisions (for compaction candidate promotion)
Symptom: No memory context in system prompt
Solution:
- Check
~/.config/opencode/opencode.jsonuses"plugin"(not"plugins") - Restart OpenCode to trigger automatic installation
- Check OpenCode logs for any download errors
Symptom: No ~/.local/share/opencode-working-memory/ directory
Solution:
- Ensure OpenCode has write permissions in home directory
- Trigger memory operations by working normally (memory files are created on-demand)
- Check that
opencode-working-memoryis listed in config
Symptom: Workspace memory empty after restart
Solution:
- Verify you're in the same workspace (different workspace = different memory)
- Ensure
Memory candidates:were captured during compaction - Check
workspace-memory.jsonexists
Symptom: TypeScript errors when modifying the plugin source
Solution:
- Run
npm installto install dev dependencies - Run
npm run typecheckto check for errors - Run
npm testto verify functionality
Remove "opencode-working-memory" from the plugin array in ~/.config/opencode/opencode.json.
Memory files in ~/.local/share/opencode-working-memory/ persist unless manually deleted.
cat ~/.local/share/opencode-working-memory/workspaces/*/workspace-memory.json | jqcat ~/.local/share/opencode-working-memory/workspaces/*/sessions/*.json | jqrm ~/.local/share/opencode-working-memory/workspaces/*/workspace-memory.jsonrm -rf ~/.local/share/opencode-working-memory/workspaces/*/sessions/*.json- Read Architecture Documentation to understand how the three layers work
- See Configuration Guide for customization options
Last Updated: April 2026