Adding memory to Cursor

its chats live in SQLite, and the terminal agent beside it is the same history

Cursor keeps your chats, and opens the next one empty. What you worked out last week is still on disk — along with the work you did in whichever terminal agent you had open beside it.

The same question put to the same agent twice: without memory it has no record of it, with deja it answers with the decision from eight months earlier

same prompt before and after deja — local BM25 recall across past sessions on disk, zero LLM calls

Memories, rules, and the part neither covers

Cursor's own answer is two features. Rules — .cursor/rules/*.mdc in the repository, and the older .cursorrules — are instructions you write and it reads every time. Memories are short facts the editor derives from your chats and keeps for that project, which is closer to what people are asking for, and still a summary written by a model rather than the session itself: it holds the sentence it chose to keep, not the command you ran or the error you pasted.

Both are scoped to Cursor and to the project you are in. Neither answers the question people actually arrive with — what did I do about this before — when the before was a month ago, in a different repository, or in the terminal agent open beside the editor. That part is on disk already, in the chat store and in the other agents' transcripts.

What Cursor already has

The editor stores chats in SQLite rather than JSONL: state.vscdb under ~/Library/Application Support/Cursor/User on macOS and ~/.config/Cursor/User on Linux, split between globalStorage/ and one database per workspace. Nothing reads it back. How Cursor's store is read has the schema and what it took to follow it across versions.

Adding recall

deja install cursor-auto

That writes the deja MCP server into ~/.cursor/mcp.json and the hooks that carry recall into a session. The server on its own is deja install cursor. Cursor's plugin marketplace has the same wiring as a plugin (cursor-agent plugin marketplace add https://github.com/vshulcz/deja-vu); it needs the binary below, runs through sh so it is for macOS and Linux, and stands down where cursor-auto already wrote the hooks.

It needs the binary, which the MCP entry calls by name:

brew install deja-vu
# or
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh

The editor and the terminal are the same history

Cursor is usually not the only agent on the machine — there is a terminal agent open in the same repository, and the two never see each other's work. Indexing both is the point: a question asked in Cursor gets answered from the session where it was actually solved, whichever tool that was. Switching agents is the longer version of that argument.

The part that is not about this harness

The index covers every agent's transcripts on the machine — fifty-two of them today, each in its own format — so a fix found in one tool answers a question asked in another, including sessions from before any of this was installed. That is the reason to index rather than to capture.

Nothing here writes memories, so there is nothing to hallucinate into your history; indexing and search are local, and credentials are stripped as the index is built (privacy). An injection is capped at 1,536 bytes per prompt and about 4 KB per tool call — what memory costs has the measured comparison.

Repository memory & handoff

Share vetted project decisions and dead ends through git in .deja/memory.jsonl (deja repo candidates, deja repo add <id>). Entries are redacted on write, stored sorted with merge=union so parallel branches merge cleanly, and loaded for any teammate who clones the repository ({"activations":{"auto":{"repo":false}}} in the trust policy keeps them out of hooks). See repo memory.

Switching tools mid-task? Run deja handoff --to <agent> (or use handoff via MCP) to transfer the active session's goal, decisions, touched files, passed checks, and open work into another coding agent.

Getting started · How Cursor's store is read · Parallel sessions

Found this useful? Star deja-vu on GitHub.