Ask Codex what you decided last week and it usually has no idea. Each new session starts with an empty context, and the only thing that comes back on its own is the set of instructions you wrote in AGENTS.md. There's also a second layer now, Codex memories. It's off by default and works quite differently.
Below: how each one works, and why neither is enough for knowledge a team shares.
Codex has two kinds of memory
The first is AGENTS.md, a file you write. Codex reads it before doing any work, every time it starts. It's the place for rules: how to run the tests, which package manager to use, what to ask before adding a dependency.
The second is memories. When you turn them on, Codex reads your earlier chats and turns the useful bits into memory files on your computer, then brings them into later sessions. You don't write these. Codex does.
Codex's two memories
AGENTS.md | Memories | |
|---|---|---|
| Who writes it | you | Codex |
| What it holds | rules and instructions | context from earlier chats |
| On by default | ||
| Where it lives | in the repository and ~/.codex | in ~/.codex |
OpenAI's documentation says which one to lean on. Required team guidance belongs in AGENTS.md or checked-in docs, and memories should be treated as a recall aid, never as the only source for rules that must always apply. It's a sensible line to draw.
How AGENTS.md loads
Codex builds an instruction chain when it starts: once per run, or once per session in the terminal interface. The order goes like this.
First the global file in your Codex home, ~/.codex unless you set CODEX_HOME. Codex reads AGENTS.override.md there if it exists, otherwise AGENTS.md. Then it walks from the project root, usually the git root, down to the folder you're working in. In each folder it takes at most one file: AGENTS.override.md first, then AGENTS.md, then any names you listed in project_doc_fallback_filenames.
What Codex reads, in order
~/.codex/AGENTS.mdglobal, read firstrepository/AGENTS.mdproject rulesservices/payments/AGENTS.override.mdclosest, read last, so it wins
The files are joined from the root down, so the ones closest to your current folder come last and override earlier guidance. Empty files are skipped.
Then there's the size cap. Codex stops adding files once the combined instructions reach project_doc_max_bytes, which is 32 KiB by default. You can raise it, or split the instructions across nested folders. We ran into this with our own files and wrote it up in CLAUDE.md vs AGENTS.md: a file can look short in lines and still be far over the limit in bytes.
To check what actually loaded, the docs suggest asking Codex directly: codex --ask-for-approval never "Summarize the current instructions.".
Codex memories: what they are and how they're made
Memories are off until you turn them on. In the ChatGPT desktop app it's Settings > Personalization > Enable Codex memories. If you'd rather use the config file, add this to config.toml:
[features]
memories = true
After that, Codex doesn't write a memory at the end of every chat. It skips sessions that are still active or very short, waits until a chat has been idle for a while, and then updates memories in a background pass. It can also skip that pass when your remaining rate limit is below a threshold, so it doesn't spend quota when you're close to the edge.
The files go under your Codex home, in memories/ or, on newer setups, memories_v2/. OpenAI calls them generated state: fine to open when troubleshooting, but not something you should edit by hand as your main way of steering Codex. Codex redacts secrets from what it generates, and the docs still tell you not to store secrets there and to check the files before sharing your Codex home.
You get a few controls. /memories in a chat decides whether that one chat can use existing memories and whether it can feed new ones. In the config, memories.use_memories and memories.generate_memories do the same globally, and memories.disable_on_external_context keeps chats that used MCP tools or web search out of memory generation. To wipe everything on a machine, there's Delete Codex memories in the same settings page.
On macOS there's an extra layer called Computer History, for Pro, Business and Enterprise users. It turns activity across the apps you allow into memories that ChatGPT and Codex can reference. It's off by default and requires memories to be on. And if what you actually need is yesterday's conversation, not a summary of it, codex resume reopens a recent chat from the current repository.
What Codex memory doesn't cover
Put the two layers side by side and the gaps show up quickly.
AGENTS.md travels with the repository, which is good for rules. But it's static, it's capped at 32 KiB by default, and it's the wrong place for a running log of decisions. Every decision you add there is loaded into every session, whether the task needs it or not.
Memories fix the "static" part, with limits of their own. The docs describe the memory store "for the selected machine", so your laptop and your desktop each learn separately. The files sit in your home folder, where a colleague's Codex never sees them. ChatGPT is another world too: on the web it uses ChatGPT memory, while local Codex clients keep a separate store. A decision made in a chat with ChatGPT doesn't reach Codex, and neither does anything Claude or Claude Code learned. Claude Code has the same shape of problem with its own auto memory, which we covered in Claude Code memory.
| Codex memories | Shared notes over MCP | |
|---|---|---|
| On another computer | ||
| A colleague sees it | ||
| ChatGPT and Claude read it | ||
| You edit it by hand | not recommended |
There's also the question of control. Generated memory decides on its own what's worth keeping. That's handy for small preferences. For a decision like "we dropped the old payment provider in March, and here's why", a note someone wrote on purpose, and that anyone can point to, works better.
A memory Codex shares with your other AIs
Codex supports MCP, the open protocol that lets an AI use tools and data from other systems. It handles remote servers over HTTP with OAuth sign-in (codex mcp login when a server needs it), and the ChatGPT desktop app, the Codex CLI and the IDE extension share the same MCP configuration in config.toml. Set a server up once and every Codex client sees it.
That gives you a third place for knowledge. Keep AGENTS.md short, about how to work in the code. Leave memories on, if you like, for personal habits. And put project decisions in shared Markdown notes that Codex reaches over MCP, the same notes Claude, ChatGPT and Claude Code read and write. Two lines in AGENTS.md are enough to tell Codex where to look at the start and where to write what it decides.
Because Codex searches the notes and reads only what a task needs, this costs less context than piling everything into the instruction file. We explain why in context costs.
That's what Cobrain is for. Each client or project is a folder, you can share a folder with a colleague, and the Codex guide gets you connected in three steps from the terminal.
Quick answers
Does Codex remember previous conversations?
Not by default. With memories turned on, it turns useful context from earlier chats into local memory files and brings them into later sessions. To reopen an actual past chat, use codex resume.
Where does Codex store its memories?
Under your Codex home, ~/.codex by default, in memories/ or memories_v2/. They're generated files, meant to be inspected rather than edited.
What's the difference between AGENTS.md and Codex memories?
You write AGENTS.md, and Codex loads it at every start, up to 32 KiB by default. Codex writes memories from your past chats, and OpenAI recommends keeping required rules in AGENTS.md, not in memories.
Is Codex memory the same as ChatGPT memory? No. ChatGPT on the web uses ChatGPT memory, and local Codex clients use a separate memory store with their own controls.
Can my team share Codex memories?
Not directly: memories are stored per machine, in your home folder. To share knowledge, keep it in the repository's AGENTS.md for rules, or in shared notes that every teammate's Codex reaches through MCP.



