Best memory for Codex in 2026
Codex carries instructions well and history poorly. The options that fix the history problem are narrower than for Claude Code, and this page is the short list.
Competitor details and pricing checked 2026-09-25. Sources at the bottom of this page.
What the field is
The built-in layer is AGENTS.md: global, project, and subtree files loaded in a documented order, with a size cap that can truncate large files silently. That covers instructions and conventions.
Around it, three approaches exist. Resume a session where the tool supports it and accept that compaction still rewrites history. Use an MCP memory server and rely on the model to call it. Or install a hook package that answers Codex lifecycle events, which is the only one that captures completed turns without the model choosing to.
What MemoryRouter is
MemoryRouter publishes the Codex hook package: security-conscious install with an option that pipes the key from your clipboard, recall before the model runs, capture after each completed turn, and re-injection after compaction.
It writes to a vault shared with Claude Code, OpenClaw, editors over MCP, and chat products, so Codex memory is not a separate island. 14-day free trial, then $20 per month.
Side by side
| MemoryRouter | the field | |
|---|---|---|
| AGENTS.md | Built in, free, carried with the repository | Instructions only; truncation risk; nothing captured from sessions |
| Hook packages (MemoryRouter) | One command, automatic capture and recall | Managed service after a trial |
| MCP memory servers | Callable from Codex where MCP is available | Model-directed; recall depends on the model choosing to look |
| Manual handoff files | Free and reliable when maintained | Depends on a human writing them at the right moment |
| Team usage | Shared vault per project with per-user keys | Depends on the option you choose |
Where the field is the better choice
- You want only instructions, and AGENTS.md already carries them.
- You prefer everything in files that ship with the repository, even at the cost of keeping them current.
- You are testing vendors: MCP servers let you trial mem0, Zep, Letta, and others against the same client.
Where MemoryRouter fits better
- You want the decision you made at 4pm to be available at 9am without a handoff file.
- You want capture that does not depend on the model deciding to store something.
- You want one vault for Codex and the rest of your stack, including Claude Code.
Which one should you use?
Keep AGENTS.md. It is the right layer for conventions, and it is free.
Add a hook package when you want history handled automatically, and prefer one whose memory is portable, because the tool you use next year may not be Codex.
Secure install options, verification, and removal on the Codex page. 14-day free trial.
Related
FAQ
Sources
- OpenAI Codex AGENTS.md guide
- openai/codex issue 36712: automatic context compaction destroys context
- MemoryRouter Codex page
Sources checked 2026-09-25. Tool behavior changes; check the vendor docs before relying on a detail.