Adding memory to Copilot CLI

its MCP schema is its own, and the wiring follows it

Copilot CLI records each session and starts the next one empty. The events are still on disk, next to whatever you did that week in the other agents on the machine.

What Copilot already has

Sessions live under ${COPILOT_HOME:-~/.copilot}/session-state/<sessionId>/events.jsonl as a stream of {type, data, timestamp} records. Complete, and read by nothing. How Copilot's store is read has the event shapes and the quirks behind them.

Adding recall

deja install copilot

Copilot keeps its MCP servers under mcpServers in ${COPILOT_HOME:-~/.copilot}/mcp-config.json, but its entries are not the common shape — each carries a type and a list of enabled tools, so the entry is written in Copilot's own form rather than copied from another harness. The same install writes the deja-history skill to ${COPILOT_HOME:-~/.copilot}/skills/, which Copilot also lists as the /deja-history command.

deja install copilot-auto

does the same and writes deja's hooks to ${COPILOT_HOME:-~/.copilot}/hooks/deja.json, a file Copilot loads as user-level hooks and VS Code Copilot Chat reads too. The session opens with this project's recent work (sessionStart), each prompt gets recall from earlier sessions (userPromptSubmitted), an edit gets the file's prior decision (preToolUse), a failed command gets what fixed the same error before (postToolUse and postToolUseFailure), and a compaction is captured from the session's events.jsonl and handed back on the next tool call (PreCompact). Copilot reads only a flat {"additionalContext": "…"}, which is what the --copilot commands print; each hook has ten seconds, and a deja that fails or is slow leaves the prompt as it was. Two more entries, on preMcpToolCall and sessionEnd, tell deja which session is open, so a recall over MCP never answers with the session asking it. Older installs wrote the entries into settings.json; the install moves them. deja uninstall copilot-auto takes the file back out.

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

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

What you can ask it

Once the server is wired, the useful questions are the ones a fresh session cannot answer on its own: what this error meant the last time it appeared, how this project's build is actually invoked here, what was decided about a file and why. Agents & MCP lists the tools and what each is for.

The part that is not about this harness

The index covers every agent's transcripts on the machine — forty-one 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). With copilot-auto the hooks above inject unasked, each deduplicated per session; everything else is the tool and the skill. What memory costs has the measured comparison.

Getting started · How Copilot's store is read · Agents & MCP

Found this useful? Star deja-vu on GitHub.