← All articles
Aug 13, 2026

deja-vu: An AI Coding Agent Memory Tool That Searches Past Claude Code Sessions

deja-vu is a free, open source AI coding agent memory tool that indexes months of Claude Code, Cursor, and Codex session logs already sitting on disk, then surfaces the earlier fix the next time the same problem comes up. No LLM calls, no embeddings, fully local.

Every coding agent starts a new session with total amnesia, even if it solved the exact same bug three weeks ago in a different chat window. deja-vu is an AI coding agent memory tool that fixes this by pointing at something already sitting on disk: the raw session logs Claude Code, Cursor, Codex, and 14 other agent harnesses have been writing the whole time. It indexes that history and hands the earlier answer back automatically, instead of making the agent re-derive it.

What deja-vu actually does

deja-vu is a single, zero-dependency binary that builds a local search index over agent transcripts. It does not require an LLM, an embedding model, or an API key to work, and it does not send anything to a server. The core mechanism is a fast local inverted index, similar in spirit to how a search engine indexes text, tuned for the kind of natural-language questions a developer or an agent would ask about past work: "have we dealt with JWT refresh rotation before?"

The maker's own benchmark, which ships inside the repo so it can be rerun rather than taken on faith, reports 84.9% hit@1 on the LongMemEval-S retrieval benchmark and 69.8% on LoCoMo, with a median search latency of about 1.5 milliseconds over a 3.5 GB corpus. Those are real, checkable numbers rather than launch-copy claims, since the harness for producing them is public in the repository.

How it indexes and surfaces old sessions

This is the part worth being precise about, since "memory tool" gets used loosely. deja-vu parses the JSONL and SQLite session stores that coding agents already write locally, across 17 supported harnesses including Claude Code, Cursor (IDE and CLI), Codex CLI, opencode, aider, Gemini CLI, Copilot CLI, Cline, Roo Code, and Goose. It builds a local inverted index from that history, including months of sessions that predate installing the tool, and strips credentials (API keys, JWTs, PEM blocks) at index time so the cache itself is safe to keep around.

Retrieval happens two ways. A direct deja "connection pool exhausted" search from the terminal, or an MCP recall tool call the agent itself makes mid-session, so the agent can say "we fixed this three weeks ago" instead of re-debugging from scratch. With hooks wired in, it goes further: a SessionStart hook injects relevant memory before the first prompt, and a PreToolUse hook names the prior decision on a file before the agent edits it again. A deja promote command lets a session get marked accepted, rejected, or superseded, so a fix that was later reverted shows up flagged as tried-and-rejected rather than resurfacing as if it still applies.

Setup for Claude Code and other agents

Installation is a shell script, a Go install, or Homebrew. Claude Code users have a shortcut through the plugin system:

claude plugin marketplace add vshulcz/deja-vu
claude plugin install deja-vu@deja-vu

That wires the session-start, per-prompt, pre-compaction, and PreToolUse hooks plus the MCP server and a /deja command in one step. deja install --all does the equivalent across whichever agents it finds already installed on the machine, and deja install --auto adds the session-start auto-recall on top. The first install also builds the initial index from whatever history already exists, so the very next Claude Code session has memory to draw on immediately rather than starting from zero.

Where it differs from other memory tools

AIOS Guide has previously covered a memory tool built around a HUMAN.md context file that an agent reads at the start of each session. deja-vu solves a different problem. A HUMAN.md-style file is memory the user writes by hand, once, as durable context. deja-vu is memory the agent already generated by working, retroactively indexed, searchable by content rather than pre-declared as a fact sheet. The two are complementary rather than competing: one holds what you decided to tell the agent, the other holds what the agent already figured out on its own.

The honest limits

deja-vu only knows what's in the session logs on the machine it runs on. A fresh laptop or a wiped .claude directory means an empty index until deja sync pulls history from elsewhere, and sync is a manual, append-only SSH transfer rather than an always-on cloud sync. The lexical search approach that makes it fast and dependency-free also means it will occasionally miss a session that used different wording for the same problem; an optional deja embed mode against a local Ollama or LM Studio model exists for that gap, but it's opt-in, not the default. This is also a young project, created in July 2026, so the promote/trust-scope machinery is less battle-tested than the core search.

It is unambiguously a tool for people running coding agents daily, not a general productivity tool. Someone using Claude Code or Cursor occasionally, for small one-off tasks, won't accumulate enough session history for the index to pay off. It earns its place for anyone running agent sessions across multiple projects for months, hitting the same class of bug or config decision more than once, and wanting the second occurrence to be faster than the first.

The verified numbers

As of today, the deja-vu GitHub repository shows 627 stars and 43 forks, up from 579 stars at last check, a real climb that tracks with its "rising" flag rather than contradicting it. It's MIT licensed, meaning it can be forked, self-hosted, or bundled into another product without restriction. The code, the benchmark harness, and the install path are all in the open repository rather than gated behind a landing page, which is the detail that matters most for a tool that asks to read months of an agent's private conversation history: nothing about how it works is hidden.

Join the newsletter

AI workflows and systems, straight to your inbox.

No spam. Unsubscribe anytime.