Deja-vu: Zero-Dep Memory Layer for Coding Agents

GitHub repo vshulcz/deja-vu delivers a memory layer for agents like Claude Code and Codex, with search, MCP recall, auto-context and secret redaction.

Deja-vu: Zero-Dep Memory Layer for Coding Agents

The deja-vu project

vshulcz published

on GitHub. The project supplies a memory layer for coding agents through local indexing of their session logs. It adds search, MCP recall, auto-context injection, secret redaction, usage stats, and sync between machines. The entire system ships as one zero-dependency binary written in Go.

Core features

deja-vu scans the conversation files that Claude Code, Codex, and opencode already write to disk. Search runs against an embedded index and returns results in 7โ€“9 ms even on gigabytes of history. The MCP recall tool lets an agent query past sessions directly, so it can reference fixes applied weeks earlier instead of repeating work.

Redaction removes API keys, JWTs, and private keys at index time. The resulting store can stay on disk without additional safeguards. Stats output shows harness usage, project distribution, and an activity sparkline. The share command produces a sanitized digest of any session, while sync export and import move the append-only index between machines with idempotent merges.

Auto-recall works through a SessionStart hook. After deja install --auto, relevant excerpts load into context before the first user message. No separate daemon runs and nothing leaves the local machine.

Setup process

Installation uses the provided shell script, Go install, npm wrapper, or Homebrew tap. The binary detects common agent config locations and creates backups before editing them. Running deja install --all wires MCP recall into supported harnesses. The --auto flag additionally registers the context hook.

Indexing shells out to the sqlite3 CLI for opencode logs, which already ships on macOS and most Linux distributions. No model downloads or external services are required. The same binary handles query, stats, share, and sync subcommands.

Practical considerations

The approach depends on agents continuing to write plain-text logs in the expected locations. If a harness changes its format or storage path, indexing breaks until deja-vu is updated. Redaction occurs only at index time, so any secrets present in older unindexed logs remain in the original files.

Performance stays consistent because the index lives on local disk and queries avoid network calls. However, the tool provides no built-in encryption for the index itself. Users who need encrypted at-rest storage must handle that layer separately. Sync remains append-only, which prevents accidental overwrites but requires manual cleanup of stale entries over long periods.

---

๐Ÿ“– Related articles

Need a consultation?

I help companies and startups build software, automate workflows, and integrate AI. Let's talk.

Get in touch
โ† Back to blog