Adding memory to Codex CLI
the MCP server, the hook you have to approve, and the marketplace
Codex CLI records every session and opens the next one empty. The rollout files are still on disk, along with the work you did the same week in whichever other agent was open.
What Codex already has
Rollouts live under ${CODEX_HOME:-~/.codex}/sessions/YYYY/MM/DD/rollout-*.jsonl, with the prompts you typed in history.jsonl beside them. Complete, and read by nothing. How Codex's store is read has the format and the quirks it took to parse it.
Adding recall
deja install codex-auto
That writes the deja MCP server into ~/.codex/config.toml and a hook that carries the recall into the session. The server alone is deja install codex.
One catch worth knowing before you go looking for a bug: Codex will not run a hook it has not been shown. Open Codex once and approve it under /hooks, otherwise every file on disk looks right and no memory ever arrives — codex exec included.
This repository is also a Codex plugin marketplace:
codex plugin marketplace add https://github.com/vshulcz/deja-vu codex plugin add deja-vu@deja-vu
Running both is safe rather than doubled: MCP servers are keyed by name and every manifest we ship calls this one deja, so the two resolve to one server rather than listing every tool twice.
Either path needs the binary, since a plugin ships files and not runtimes:
brew install deja-vu # or curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh
Why this matters more in Codex than most
Codex sessions are short and many — a day's work is spread over a dozen rollout files rather than one long thread. That makes the thing you settled on Tuesday hard to find by scrolling and easy to find by search. Finding a session is the command side of that.
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 Codex's store is read · Switching agents