Back to all articles
TutorialNovember 30, 2026·10 min read

Does Codex Have Memory? - How It Carries Context Across Chats and From ChatGPT (2026)

You spent Monday explaining your project's quirks to Codex: the test command that needs a flag, the folder nobody should touch, the way your team names branches. On Wednesday you open a new chat and wonder whether Codex remembers any of it. ChatGPT seems to know your preferences, so you'd expect Codex to as well, since they share a login and now even a desktop app. But it's not obvious what carries over, or from where.

Codex does have memory, but it works differently from ChatGPT's. OpenAI's documentation says: "Memories let ChatGPT and Codex carry useful context from earlier work into future work. ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local memory store and controls." Local Codex memories are off by default. When you turn them on, Codex builds memory files on your machine from eligible past chats, in the background, and uses them in future sessions.

This guide covers what Codex remembers by default, how local memories work once you enable them, where they're stored, how to control them per chat, how they relate to ChatGPT memory, Computer History, and AGENTS.md, and how to keep the context you care about in a form you control.

What Codex remembers without memories turned on

Without the memories feature, each new Codex chat starts fresh, apart from what Codex reads from your project.

The main thing it reads is AGENTS.md. OpenAI's documentation says: "Codex reads AGENTS.md files before doing any work." That's where project rules belong, and it's why the memories documentation draws a line: "Keep required team guidance in AGENTS.md or checked-in documentation. Treat memories as a helpful recall layer, not as the only source for rules that must always apply."

So if you want Codex to always know your test command, put it in AGENTS.md. Memories are for the softer context that builds up over time.

Local Codex memories are off by default

The documentation is clear: "Local Codex memories are off by default."

To turn them on in the ChatGPT desktop app, open Settings > Personalization and turn on Enable Codex memories. That setting applies to the selected machine.

For config-based setup, the documentation says to add the feature flag to config.toml: set memories to true under [features].

How local memories are built

Once memories are on, Codex works in the background. The documentation explains: "After you enable memories, Codex can turn useful context from eligible prior chats into local memory files. Codex skips active or short-lived sessions, redacts secrets from generated memory fields, and updates memories in the background instead of immediately at the end of every chat."

That has a practical effect. Something you said ten minutes ago may not be in memory yet. The documentation says: "Memories may not update right away when a chat ends. Codex waits until a chat has been idle long enough to avoid summarizing work that's still in progress."

Memory generation also pays attention to your usage. It can skip a background pass when your remaining Codex rate limit is below a configured threshold, "so Codex doesn't spend quota when you're near a limit."

Where memories are stored

Codex keeps memories on your machine, under your Codex home directory, which is ~/.codex by default.

There are two folders to know about. The documentation says: "When you enable memories in a fresh Codex home, the CLI uses $CODEX_HOME/memories_v2/ by default. If $CODEX_HOME/memories/ already exists, the CLI continues to use that store by default." You can choose a version explicitly with the memories.version setting.

In the desktop app, the documentation says to check both folders for generated summaries and supporting evidence from prior chats.

These files aren't meant as your main way to edit memory. The documentation says: "Treat these files as generated state." You can look at them when troubleshooting or before sharing your Codex home directory.

Control memory for one chat

You don't have to choose all or nothing. In the ChatGPT desktop app and the Codex TUI, /memories controls memory for the current chat. The documentation explains: "Chat-level choices let you decide whether the current chat can use existing memories and whether Codex can use the chat to generate future memories."

Those choices are local to the chat: "Chat-level choices don't change your global memory settings."

This is useful for one-off work. If you're experimenting in a repository you won't come back to, you can keep that chat out of future memories.

Memory on each Codex surface

The documentation describes memory a little differently depending on where you use Codex:

  • ChatGPT desktop app. Use /memories in a chat, Enable Codex memories in Settings > Personalization to turn the feature on or off for the machine, and Delete Codex memories to reset that machine's store.
  • Codex CLI. Use /memories in an interactive session to control whether the current chat can use existing local memories or become an input for future memories. If the command isn't available, the documentation points you to the configuration section.
  • IDE extension. The documentation says: "The IDE extension uses the connected Codex host's local memory store." When memories are enabled for that host, you use the same chat-level controls as the CLI.
  • ChatGPT Work on the web. It uses the memory settings available to your account and workspace, not a local Codex store.

The common thread is that local Codex memory belongs to a machine, or to the host the IDE extension connects to. If you use Codex on two computers, each one has its own store.

Settings that shape what's remembered

The documentation lists the common memory settings in config.toml:

  • memories.generate_memories controls whether newly created chats can be stored as memory-generation inputs.
  • memories.use_memories controls whether Codex injects existing memories into future sessions.
  • memories.disable_on_external_context, when true, keeps chats that used external context, such as MCP tool calls, web search, or tool search, out of memory generation.
  • memories.min_rate_limit_remaining_percent sets how much rate limit must remain before memory generation starts.

In the desktop app, Allow memories from tool-assisted chats under Settings > Personalization covers the same idea as the external-context setting.

Does Codex share memory with ChatGPT?

Not directly. The documentation says ChatGPT web uses ChatGPT memory and local Codex clients use a separate local store. For ChatGPT Work on the web, it adds that Work "doesn't use a local Codex memory store or local memory controls."

Your chat history is separate too. OpenAI's article on the new desktop app says Codex "remains a separate view; its workflows are unchanged, and its history remains separate from ChatGPT history."

So the preferences ChatGPT has learned about you don't automatically appear in Codex, and Codex's local memories don't appear in ChatGPT on the web.

Dots are their own case. OpenAI's ChatGPT memory article says a dot has its own memory, and adds: "In ChatGPT Work and Codex cloud, the only chats your dot can refer to are the ones it started for you."

Where Computer History fits

Computer History connects activity to both products. OpenAI's Computer History documentation says it "turns your activity across apps and websites into memories and a timeline that ChatGPT and Codex can reference."

It has conditions. It's off by default for Pro, Business, and Enterprise users in the ChatGPT desktop app on macOS, and the documentation says it "also requires Memories". Your history starts only after you turn it on, and you can choose which apps and websites contribute.

Deleting Codex memories affects it too. The memories documentation says that selecting Delete Codex memories resets the selected machine's memory store and, on the local machine, "also clears Computer History when that feature is available."

How Codex memory compares to Claude's

If you also use Claude, the difference is mostly about where memory lives. Claude's chat memory is built from your conversations and managed in your Claude account settings. Codex's local memory is built on your machine from eligible Codex chats and stored under your Codex home directory. We explained Claude's side in our guide to how Claude memory works.

Either way, neither tool's memory moves into the other on its own.

Keep secrets out of memory

Codex redacts secrets from generated memory fields, but the documentation still advises care: "Don't store secrets in memories." It recommends reviewing memory files before you share your Codex home directory or generated memory artifacts.

What people try first

Assuming Codex remembers by default. Local memories are off until you turn them on.

Expecting ChatGPT's memory in Codex. They use separate stores.

Checking memory right after a chat. Codex waits until a chat has been idle.

Editing memory files by hand. The documentation calls them generated state.

Relying on memory for required rules. Put those in AGENTS.md.

Looking in only one folder. Check both memories/ and memories_v2/ in the desktop app.

The Fix: Give Codex the context it needs

Step 1: Put required rules in AGENTS.md

Test commands, folders to avoid, and naming conventions belong in the file Codex reads before every task.

Step 2: Decide whether to enable memories

Turn on Enable Codex memories if you want Codex to build recall from past chats on this machine.

Step 3: Use /memories for one-off chats

Keep experiments out of future memories with the chat-level control.

Step 4: Write down the context you want everywhere

Note your preferences, projects, and decisions in your own words, so they're available beyond one tool and one machine.

Setting this up in MemoryLake

Codex memory lives on one machine and stays separate from ChatGPT's. That's sensible for privacy, but it means the context you care about is split across places: ChatGPT memory, local Codex files, AGENTS.md, and whatever you've told other assistants. A single record you maintain makes that context available wherever you work.

MemoryLake is a memory layer for that kind of context, kept in one place you maintain and available to the assistants you connect, such as ChatGPT, Claude Code, and Codex.

You write the entries yourself, in your own words. Nothing is read out of, written to, or deleted from your Codex memory files, your Codex home directory, your ChatGPT memory, your AGENTS.md files, or any vendor's store. Codex memories work the way OpenAI describes them.

Step 1: Create an API key

Sign in and generate a key from the dashboard. Keep it somewhere private.

The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent
The MemoryLake console showing the API keys screen, where a new key is created and copied for use in an agent

Step 2: Upload your first memories

Start with what you wrote in Step 4 of the fix: preferences, projects, and decisions. One topic per entry.

The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory
The MemoryLake workspace with the first documents uploaded, listing each file as it becomes searchable memory

Step 3: Connect your AI & agents

Connect ChatGPT, Claude Code, Codex, and the other assistants you use, so the same context is there in each.

The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer
The MemoryLake integrations screen listing the AI clients and agent frameworks that can be connected to the memory layer

What this changes in practice

The first difference is one record across tools. ChatGPT and Codex can use the same context you wrote.

The second is portability across machines. Your notes don't live in one Codex home directory.

The third is control. You decide exactly what each entry says.

Best practices for Codex memory

Keep rules in AGENTS.md. Memory is a recall layer, not a rulebook.

Enable memories deliberately. They're off by default and set per machine.

Use /memories per chat. Keep experiments out of future memories.

Keep tool-heavy chats out if you prefer. Use the external-context setting.

Review files before sharing your Codex home. Secrets are redacted, but check anyway.

Keep your own record. It works across tools and machines.

Conclusion

Codex has memory, but local Codex memories are off by default and live on your machine, separate from ChatGPT memory. When you enable them, Codex builds memory files in the background from eligible past chats, skips active and short-lived sessions, redacts secrets, and waits until a chat has been idle. A fresh Codex home uses the memories_v2 folder, while an existing memories folder stays in use. You can control memory per chat with /memories and tune generation in config.toml.

ChatGPT on the web uses its own memory, Codex history stays separate from ChatGPT history, and Computer History is a feature both can reference. Required rules belong in AGENTS.md, which Codex reads before every task. Keeping the context you care about in your own words gives you one record that works across ChatGPT, Codex, and the other assistants you use.

Frequently asked questions

Does Codex have memory?

Yes. Local Codex memories build recall from past chats, but they're off by default.

How do I turn on Codex memories?

In the ChatGPT desktop app, open Settings > Personalization and turn on Enable Codex memories.

Does Codex use my ChatGPT memory?

No. OpenAI says ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local store.

Where are Codex memories stored?

Under your Codex home directory, ~/.codex by default, in memories_v2/ for a fresh home or memories/ if it already exists.

Why doesn't Codex remember what I just said?

Codex updates memories in the background and waits until a chat has been idle.

Can I keep one chat out of memory?

Yes. Use /memories in the desktop app or Codex TUI to control the current chat.

Should I put project rules in memory?

No. OpenAI recommends keeping required guidance in AGENTS.md.