Adding memory to Gemini CLI
one command, because Gemini installs a repository directly
Gemini CLI writes every chat to disk and starts the next one without them. The answer to today's question is often in one of those files — or in whatever other agent you used last week.
What Gemini already has
Chats live under ~/.gemini/tmp/<project-hash>/chats as JSON or JSONL. Complete, and read by nothing: the directory name is a hash of the working directory, which is why Gemini itself can only list the sessions of the project you are standing in.
Adding recall
gemini extensions install https://github.com/vshulcz/deja-vu
That reads gemini-extension.json at the root of the repository and wires the deja MCP server plus a short context file. Measured on Gemini CLI 0.55.1: gemini mcp list then reports deja (from deja): deja mcp (stdio) - Connected.
The other path also wires the hooks:
deja install gemini-auto
Hooks are the difference between the two. Gemini runs them only when hooksConfig.enabled is set in your settings.json, and an extension cannot write that file — so the extension gives you recall on demand, and the CLI install adds recall that arrives on its own at session start and on each prompt.
Both name the extension deja, which is deliberate: Gemini keys extensions by that name and answers a second install with Extension "deja" is already installed. Having both wired is not a state you can reach by accident.
Either way it needs the binary, since an extension delivers files rather than runtimes:
brew install deja-vu # or curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh
Qwen Code takes the same file
Qwen Code is close enough to Gemini CLI that the same manifest serves it: qwen extensions install https://github.com/vshulcz/deja-vu installs the same MCP server, context file and deja-search skill. Memory for Qwen Code has that side.
The part that is not about this harness
The index covers every agent's transcripts on the machine — twenty 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.
Getting started · How Gemini's store is read · Memory for Qwen Code