r/opencodeCLI • • 16h ago

Cross-agent session memory for opencode (SQLite + Claude Code/Codex/Cursor in one 477-token MCP tool)

I built an opencode plugin and local Go index (deja-vu, MIT) so opencode searches its own SQLite alongside Claude Code, Codex, Cursor, Gemini CLI, and 47 other harnesses on the same machine without a background daemon.

Install directly into opencode:

opencode plugin add opencode-deja

When benchmarking 7 memory tools against 19,195 real transcripts already on disk, deja-vu cold-built in 13.6 s (vs 3m 56s for agentsview and ~3 h for MemPalace) and loads 1 stdio MCP tool at 477 schema tokens (vs 8,183 across 45 tools in MemPalace or 2,307 across 15 in claude-mem). On interleaved opencode runs in a 329-file Go repo, median spend fell from 103,443 to 52,815 tokens and 7.1 vs 17.8 tool calls (53,558 vs 126,222 overall in Study 1).

Caveat: noisy recall raised average spend in a control run (124,960 vs 119,140), and pure lexical matching drops to 43.3% hit@1 on keyword-free preference paraphrases vs 88.9% overall on LongMemEval-S 470q unless optional deja embed is on.

Source, CLI installer, and Windows winget/scoop commands are in the repo: https://github.com/vshulcz/deja-vu

2 Upvotes

2 comments sorted by

2

u/songokussm 10h ago

Very interested. I have tried about 20 memory tools and when testing their usage was much higher then just using md files.

My current system is a set of 8 md files. Each one gives the model the current status of the app. Like how it's written, how to test, how major parts work, what not to change, etc. there is an archive folder for milestones and past work that is not accessed but default and only when requested.

How does your to solve the usage issue and how is it better then just using md files?

1

u/VShulcz 6m ago

honestly, keep the 8 md files. standing architecture and "do not touch" boundaries belong in curated docs, not a memory tool. the part deja replaces is manually maintaining that archive folder: it indexes the raw transcripts opencode already writes, so you can pull up a debugging dead end or weird flag from last month without stopping to document it.

most memory tools blow up token spend with bloated multi-tool schemas and chatty auto-injections on every prompt. deja runs locally with zero LLM calls. per-prompt recall is capped at 1,536 bytes and stays silent on a miss, and over MCP (deja install opencode-auto) everything sits behind one 477-token tool. if you want the exact on-demand behavior of your archive folder, setting "autoRecall": false in opencode-deja drops unasked injections so you only spend tokens when a lookup actually runs.