Skip to content

Codex CLI memory across sessions

Codex reads AGENTS.md before it starts work, so that is where hippo init adds its block. Lessons from earlier sessions, and from your other agents, then come back when they match the task. Our repeat-mistake test ran on Claude Code only, so we have no measured result for Codex.

Set it up

$ npm install -g hippo-memory
$ hippo init
$ hippo hook install codex

Init adds two hook entries for Codex, and Codex runs them only after you trust them in /hooks. The prompt hook sends up to 5 memories that match each prompt. Capturing sessions is a separate, opt-in step. hippo hook install codex wraps the Codex launcher, and hippo hook uninstall codex removes the wrapper.

What hippo adds to AGENTS.md

The block sits between <!-- hippo:start --> and <!-- hippo:end --> markers, so the rest of your AGENTS.md stays yours. It tells Codex that the prompt hook injects pinned rules and matching memories, and to run hippo context --auto --budget 1500 only when no memory block has appeared in the session.

Codex's own memories

Codex has a Memories feature of its own, off by default, that writes local memory files under ~/.codex/memories/ (OpenAI docs (opens in new tab), checked 25 October 2026). When it is on, hippo reads memory_summary.md from that folder at init, at every sleep and in the daily run, and copies it into your global store so your other agents can recall it. Hippo never writes to Codex's folders. Notes that look like secrets are skipped, and email addresses are masked.

What the wrapper does

After hippo hook install codex, each launch goes through hippo codex-run, which starts the real Codex. When Codex exits, a background worker runs hippo sleep and captures lessons from the session transcript into the folder's store, or into the global store when the folder has none.

Codex questions

All 14 questions

How do I give Codex memory across sessions?

hippo init adds its instructions to your AGENTS.md, which Codex reads before it starts work. Capturing Codex sessions is opt-in, with hippo hook install codex.