Your personal memory, across sessions, agents, and devices.

Codex Memory v2: How It Works and How to Turn It On

memU Team memU Team

OpenAI shipped Codex CLI 0.165.0 on October 27, 2026. Its changelog says the release "enabled memory v2 by default for fresh profiles" and lets Codex import memories from other agents. For memory, the only supported source is Claude Code. Turn on memory in a new profile now and you get v2, where earlier releases gave you v1. This post covers what v2 stores and how the Claude Code import feeds it.

What is Codex memory v2, in one sentence?

Codex memory v2 is Codex's second local memory pipeline: it summarizes idle past sessions into one memory_summary.md file that loads at every new session start.

OpenAI's Memories documentation does not cover v2 yet. The v2 details below come from the open-source Codex code and may change.

Memory v2 arrived on September 8, 2026 as an opt-in setting with its own storage. Release 0.165.0 made it the default for fresh profiles.

How does memory v2 differ from v1 and from Claude Code memory?

Many developers run Claude Code next to Codex, so the table puts its auto memory beside v1 and v2.

Codex memory v1 Codex memory v2 Claude Code auto memory
Default state Off until you enable memories Off until you enable memories, then the default for fresh profiles On by default in local sessions
Who writes it Background extraction and a consolidation agent Background extraction and a consolidation agent Claude, during the session
Main files raw_memories.md, session summaries, MEMORY.md, memory_summary.md, a skills folder Session summaries and memory_summary.md only MEMORY.md plus topic files
Size limit Not stated in the docs Summary under 10,000 bytes, each session summary within 9,000 bytes First 200 lines or 25KB loaded
Location ~/.codex/memories ~/.codex/memories_v2 A memory folder per project under ~/.claude/projects
How you correct it Hand edits are not the intended control Ask Codex, which writes a correction note for the next consolidation Edit the Markdown or use /memory

Codex sources: the memory README in OpenAI's code, plus the changes that set the 10,000-byte summary limit and the 9,000-byte session limit. Claude Code: Anthropic's memory docs.

Memory v2 keeps two kinds of output: one summary per session and the single memory_summary.md. It drops the raw memories file and no longer requires a MEMORY.md file. The skills folder that v1 kept is not part of it either.

How does Codex memory v2 work?

The pipeline starts when you open a session. OpenAI's pipeline notes say sub-agent sessions and ephemeral sessions are skipped. The pipeline runs in the background in two phases.

Phase 1 looks at earlier threads that have gone quiet. The config reference sets the defaults: a thread must be idle for 6 hours and no older than 30 days. Generation also waits until at least 25% of your Codex rate limit remains. For each eligible thread, a model writes a summary of the task history. v2 gives priority to what you typed and to the agent's final answers. Commentary and tool output rank lower. Secrets are redacted before the summary is cut to size.

Phase 2 is consolidation. An internal sub-agent reads a diff of what changed and rewrites the summary file. The pipeline notes say this agent runs without approvals or network access and can only write locally. The v2 prompt asks for four fixed sections. The last one indexes recent work by project and date. The prompt also tells the agent that later corrections win and that single-task requests stay with their task.

At read time, Codex gets the summary plus a read instruction. It tells the agent to open an older session summary only when that evidence could change its answer. It also says memory "is not proof of current behavior." That is the right default, in our view. A memory that says "tests use Jest" should not beat the package.json in front of the agent.

How do you turn Codex memory on or off?

Memories are still off by default, per OpenAI's Memories page. Release 0.165.0 changed which pipeline you get after you opt in. You opt in one of two ways:

  • In the ChatGPT desktop app, open Settings, then Personalization, and turn on Enable Codex memories.
  • In the CLI, add this to config.toml:
[features]
memories = true

The memories.version key takes v1 or v2. "Fresh profiles default to v2 when memories are enabled," the schema says, while existing v1 profiles stay on v1. A fresh profile is one with no memories folder yet. If you already used memories, nothing switches under you. Set the version to v2 yourself to move. Since Codex CLI 0.164.0, a profile on v2 also stops writing v1 memories.

Two more keys matter day to day. Setting generate_memories to false stops new threads from becoming memory input. With use_memories set to false, Codex leaves existing memories out of the prompt. The /memories command toggles both for the current chat only. If you use MCP tools or web search on private material, disable_on_external_context keeps those threads out of memory.

Can you read, edit or delete Codex memories?

You can read them. The memory folder is plain files under your Codex home directory (~/.codex unless you set CODEX_HOME). OpenAI calls them "generated state" and suggests reviewing them before you share that directory.

Editing works through the agent. OpenAI's docs say hand edits should not be your main control. The v2 read instruction describes the intended path. When you explicitly ask Codex to forget something, it appends a short Markdown note to an ad hoc notes folder, and the next consolidation applies it. The agent itself is told not to edit generated memory files.

Deleting is a button in the desktop app: Delete Codex memories resets the memory store on that machine. The docs do not describe a delete command for CLI users. The same page notes that ChatGPT Work uses your account memory settings and skips the local store. The IDE extension uses the store of the Codex host it connects to.

What does the Claude Code memory import do?

Codex can import setup from other agents. Per OpenAI's import guide, the desktop app imports from Claude Code, Claude Cowork and Cursor. The CLI command /import covers Claude Code and Cursor. For memory, the guide names one source: "Project memories from Claude Code." The guide also says importing does not change or delete your existing agent setup.

The importer scans every project folder under Claude Code's projects directory and collects every Markdown file in its memory subfolder. That matches where Anthropic says auto memory lives. Cursor is a supported import source, but the migration code marks it as not supporting memory.

Since 0.165.0, imported files always go into the v2 store, in one folder per project. Codex then queues a consolidation, and the agent works them into the summary. Check the summary after that consolidation, because your original wording will not survive.

Since 0.165.0, an import that starts during a consolidation fails with a busy error. Retry it when consolidation finishes. Earlier releases could leave a partial import in that case.

What should you read in the fine print?

Every Codex fact here comes from OpenAI's own pages and code. We found no independent test of whether v2 summaries make Codex better at real work.

The 10,000-byte cap keeps the injected context small. For a long-running user, we expect older work to lose detail as it is compressed. The full session summaries stay on disk, and Codex can open them when they matter.

The Memories page says required team guidance belongs in AGENTS.md or checked-in docs, where someone reviews it. A rule kept only in memory can be compressed out of the summary, and it never reaches a teammate's machine.

The bottom line

If you already use Codex memories, read your current summary first. Then set the version to v2 in a test profile and compare. New to Codex memories? Turn them on and let v2 build. Use the Claude Code import if you have useful project notes there, and check the resulting summary after the next consolidation.

How do you share one memory across Codex and Claude Code?

Say Codex learns how your test setup works on Monday. Once that session has sat idle for 6 hours and been consolidated, Codex remembers it. Open Claude Code on Tuesday and it knows nothing about your tests. The import only copies into Codex, so nothing Codex learns goes back.

Codex memory v2 memU
Who reads it Codex only. Claude Code notes can be imported, one way One memory shared by every supported host, including Codex and Claude Code
Fixing a wrong memory Plain files, but hand edits are discouraged. Ask Codex, and the next consolidation applies your note Readable Markdown you open and fix
How it scales One summary under 10,000 bytes loads every session. Older detail is compressed, and Codex opens past session summaries when needed The agent retrieves the relevant memory before it answers
Skills The v2 consolidation writes only the summary. v1's skills folder is not part of it Distills reusable skills from agent history, as Markdown
Devices A local store. Delete resets one machine Hosted on memu.so, free and synced across devices

If you only use Codex on one machine, v2 is enough. It is built in and turns on with one config switch. Your memories also never leave that machine.

To try the hosted version, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted setup and the per-host support matrix are in the memU GitHub repository. More on the design is at memu.pro.

FAQ

Is Codex memory on by default?

No. OpenAI's Memories page says local Codex memories are off by default. Since Codex CLI 0.165.0, enabling them on a profile with no existing memory folder selects the v2 pipeline.

Where does Codex store memories?

Under your Codex home directory, which is ~/.codex unless CODEX_HOME points elsewhere. v1 uses the memories folder and v2 uses memories_v2, with its own database.

How do I switch an existing profile to Codex memory v2?

Set memories.version to v2 in config.toml. Existing v1 profiles stay on v1 until you change it.

Can Codex import memories from Cursor?

Not as of Codex CLI 0.165.0. The import code reads memory only from Claude Code project folders. Cursor is supported for the other import items.

How do I make Codex forget something?

Ask it explicitly. In v2, Codex writes a correction note that the next consolidation applies. In the desktop app, Delete Codex memories resets the whole store on that machine.