Adding memory to VS Code Copilot Chat

one config file, the shape VS Code actually reads, and one honest gap

Copilot Chat opens every conversation from nothing. The chat you had in this repo last week is on disk, in the editor's own store, and nothing consults it while you work — nor the sessions from the terminal agents beside it.

What VS Code already has

Sessions live in the VS Code User folder, one file per conversation under workspaceStorage/<hash>/chatSessions, with chats from windows that had no folder open under globalStorage/emptyWindowChatSessions. Current builds write a JSONL mutation log — a first line holding the session, then one line per change — and older ones a flat .json. deja reads both, and takes the log when a session has both files, the way VS Code does.

Adding recall

Copilot Chat takes memory as an MCP server in agent mode:

deja install vscode

writes mcp.json in the User folder — one per host you have, Code, Insiders or VSCodium. VS Code's config is its own shape: a top-level servers map rather than the mcpServers most agents use, and every entry carries a type. A file in the other shape loads nothing and the chat quietly gets no tools.

Your own servers and any comments in the file are left alone, and uninstall takes only deja's entry.

The same command writes <User>/prompts/deja.instructions.md. VS Code applies a custom-instructions file to every chat when its frontmatter says applyTo: "**", and that is what makes recall arrive without being asked for: the block is in front of the model before it reads your question, and it says to search history first.

What arrives, and what does not

The deja tool with its eight modes, in agent mode, and the instruction to use it. Measured on VS Code 1.134.0: with the instructions file installed and deja never mentioned in the question, "the packer keeps refusing our manifest — why?" made Copilot Chat call recall on its own, and answer from a session it had never seen.

deja install vscode-auto

adds hooks. VS Code reads hook files from ~/.copilot/hooks, the directory Copilot CLI reads too, so deja writes one file there and both hosts use it (copilot-auto writes the same file). Copilot Chat runs SessionStart, UserPromptSubmit, PreToolUse, PostToolUse and PreCompact: the chat opens with this project's recent work, each prompt gets recall, an edit gets the file's prior decision, a failed terminal command gets what fixed the same error before, and a compaction is captured and handed back on the next turn. It has no session-end event. This is read from VS Code 1.140 and Copilot Chat 0.68 source; the same file is measured end to end on Copilot CLI.

Both installs also write <User>/prompts/deja.prompt.md, which the chat box lists as /deja: a way to ask directly, not something that fires on its own.

The part that is not about this harness

The index covers every agent's transcripts on the machine — forty-three 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). Copilot Chat's own store carries a GitHub account label in the part deja does not read.

Getting started · How the Copilot Chat store is read · Copilot CLI is a different harness

Found this useful? Star deja-vu on GitHub.