← Back to directory
D

deja-vu

Community
One local memory shared by twenty-five coding agents, built from the session history already on disk.
GitHub source repository ↗
★ 796 Stars Category · Dev Tools Very popular
72FMRS · B

deja-vu is a local-first agent-memory tool maintained by vshulcz (Vladislav Shulcz) under the MIT license; it is not an official project of any agent vendor. Its distinguishing claim is where memory comes from: it indexes the session histories already on disk, so it is useful immediately after install and can surface work done months before, rather than starting empty and recording forward. The README reports 85.3% hit@1 on LongMemEval-S, 69.6% on LoCoMo, and about 0.4 ms median in-process lookup over a 5.2 GB store of 1,551 sessions. On the MCP side it exposes one tool, deja, with a mode switching between six behaviors, and it also hooks into PreToolUse/PostToolUse for recall at the point of action. It suits developers running multiple coding agents who value local-only, LLM-free retrieval, and is a poor fit for those who need hosted shared memory or cannot accept the limits of pattern-based redaction.

Reliability
11/20
Security and permissions
14/20
Maintenance
15/20
Documentation
18/20
Setup experience
14/20
Read the FMRS scoring method →

deja-vu is a local-first memory layer that indexes the session histories coding agents on your machine have already written to disk (Claude Code, Codex, Cursor, Copilot CLI, OpenClaw and roughly twenty others in total) and hands the relevant memory back to whichever agent asks. Nothing leaves the machine by default: indexing and search are local, and credentials are redacted at index time. Per the project's README, lexical retrieval needs no LLM and no embedding key; semantic recall is optional and requires pointing deja embed at a local Ollama/LM Studio instance or an OpenAI-compatible endpoint. It serves MCP over stdio and exposes a single tool named deja whose mode argument selects behavior (recall, context, blame, fix, how, remember); six older tool names (recall, recall_context, blame, fix, how, remember) still answer for existing wiring. Install paths include the install script, Homebrew, go install, Scoop, and npx @vshulcz/deja-vu, and deja install wires MCP recall into the agents it detects.

Tools

deja
The single MCP tool; its mode argument selects behavior: recall returns matching snippets; context returns a Markdown digest of the best-matching session; blame returns sessions that discussed a given file; fix returns what this machine ran or changed after the same error previously; how returns the real invocation this machine uses; remember stores a durable decision for later recall. Readable arguments include query, path, error, what, text, tags, harness, project, since, limit, offset, and all.

Setup

1) Install: on macOS/Linux run curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh; alternatives are brew install deja-vu or go install github.com/vshulcz/deja-vu/cmd/deja@latest; on Windows use scoop install deja-vu (the install script exits with 'unsupported OS' there). 2) Run deja install --auto to wire MCP into every agent it detects, enable session-start recall where supported, and build the first index; add --all to skip session-start recall, or --no-guidance to avoid writing per-harness guidance files. 3) To configure MCP by hand, use the stdio command npx @vshulcz/deja-vu mcp, or invoke deja mcp directly. 4) Verify with deja doctor [--deep].

claude_desktop_config.json
{"mcpServers":{"deja-vu":{"command":"npx","args":["@vshulcz/deja-vu","mcp"]}}}

Fit and risk

Best for

  • Developers who run several coding agents (Claude Code, Codex, Cursor, Copilot CLI, OpenClaw, opencode, Gemini CLI, Qwen Code, Kimi Code, Zed and more) and want them to share one history
  • Users who want memory to stay entirely local, with no LLM or embedding key required for default search
  • Engineers who need to reach back into months-old sessions to reuse prior fixes and decisions

Not for

  • Users looking for a hosted or cloud knowledge base rather than local session history
  • Users unwilling to send (redacted, truncated) indexed text to a remote embedding endpoint, unless they configure a local Ollama or LM Studio runtime
  • Organizations that need a managed, multi-tenant, centrally administered memory service
  • Users expecting semantic recall with zero configuration, since it requires setting DEJA_EMBED_URL and related variables explicitly

Required permissions

  • Reads the session-history directories of the agents on this machine (for example Claude Code's `~/.claude/projects`, Codex's `~/.codex/sessions`, Cursor's state.vscdb)
  • Writes a local inverted index and vector sidecar (.vectors.bin) under `~/.cache/deja`
  • `deja install` writes user-level guidance files (or a marked block inside them) for each harness it detects; `--no-guidance` opts out
  • Some harness parsers rely on local tooling: Cursor, Grok Build, Hermes, opencode, Crush and Zed need sqlite3; DeepSeek Harness and Zed need zstd
  • Network access is used only by `deja update`, `deja sync ssh`, and the version check in `deja doctor`; a remote endpoint receives redacted indexed text only after DEJA_EMBED_URL is configured

Risks and side effects

  • Redaction is pattern matching, not secret detection: a shape it does not recognize can pass through into digests, share output or sync exports
  • Secrets already present in the original harness files stay in those files; deja-vu does not modify the sources
  • With a remote embedding endpoint configured, redacted indexed text (truncated to about 2k characters) leaves the machine; Ollama or LM Studio keeps embedding local
  • `deja forget` removes sessions from a rebuilt index and writes tombstones, but does not delete the underlying harness files
  • Session formats vary per harness and can change across versions, affecting parser completeness

Troubleshooting

  1. MCP not wired up: run `deja doctor`; the README notes that on a binary-only setup every MCP target reports `not-wired`, which is that setup working as intended, and `deja install --auto` rewires it
  2. On Windows the install script exits with `unsupported OS`: use Scoop instead, or take `deja-vu_<version>_windows_amd64.zip` from the latest release and put `deja.exe` on PATH (e.g. `%USERPROFILE%\.local\bin`)
  3. No results for a harness: check the required helper is present (sqlite3, zstd) and use the `DEJA_*_ROOT` variables for custom store locations
  4. Semantic recall not working: set `DEJA_EMBED_URL` (with it unset, deja probes localhost:11434 and localhost:1234), then run `deja embed`; `DEJA_EMBED_OFF=1` disables the probe
  5. Stale or incomplete index: re-run `deja index` (it is incremental) and use `deja doctor --deep` to check the index against the sources
  6. To wipe everything: `deja uninstall --all` followed by `rm -rf ~/.cache/deja`

Use cases

Recall, in Claude Code, a fix that was originally worked out in Codex
Search sessions from before deja-vu was installed (an indexed session stays searchable after Claude Code deletes transcripts older than 30 days)
Surface a file's prior decisions or a command's working invocation before an agent edits that file or runs that command
Look up what this machine ran after the same command error previously, when the error did not come back
Read your whole memory as one local HTML file (deja view), or expose the same search as a SKILL.md under `~/.agents/skills` for agents without MCP
Move memory between machines with `deja sync ssh`, or package live context for another agent with `deja handoff --to codex`

Supported clients

Claude CodeFull support
Codex CLIFull support
CursorFull support
Copilot CLIFull support
VS Code Copilot ChatFull support
Gemini CLIFull support
Qwen CodeFull support
opencodeFull support
ZedFull support
ClineFull support
GooseFull support
Kimi CodeFull support
OpenClawFull support
Roo CodeFull support
ContinueFull support
CrushFull support
aiderPartial support