Tutorial 8 min read | November 20, 2026

Does OpenAI Codex remember across sessions? What carries over, how Codex memories work, and how to keep a task list

A new Codex chat starts blank. Here is what it loads at startup, how local Codex memories actually work (off by default, written hours later, one store per machine), what codex resume brings back, and how to carry an exact task list from one session to the next.

Give every new Codex session the same task list

Codex memories keep preferences, not your open tasks. Leave your email and we'll send the Codex setup tutorial. You can tell us you use Codex before any price is shown.

Step 1 of 4

This needs to be a real email — we'll email you in a few minutes.

No spam. Unsubscribe anytime.

You worked with Codex for two hours yesterday. Today you open a new chat in the same repo and it knows nothing: not the plan, not the bug you already fixed, not the approach you ruled out. You heard Codex has memory now. So why doesn't it remember?

Short answer: Codex has three different things that carry over between sessions, and none of them is "the conversation". This guide explains each one, based on OpenAI's Codex documentation and the open-source openai/codex repo, and shows how to make tomorrow's session start where today's ended.

What a new Codex session actually loads

WhatCarries into a new chat?Notes
AGENTS.mdYes, every session~/.codex/AGENTS.md, then each AGENTS.md from the repo root down. You write it.
~/.codex/config.tomlYesModel, settings, feature flags and [mcp_servers.*] entries
Local memoriesOnly if enabledOff by default. Model-written, generated in the background hours later
The earlier chat itselfOnly if you resume or fork itcodex resume reopens a saved chat; a new chat does not see it
Your exact task list and progressNo, unless it is on diskOnly what you keep in a file or a tool the agent reads at the start

How Codex memories work

OpenAI's memories documentation describes local Codex memories as a way to "carry useful context from earlier work into future work". The details matter, because they explain most of the "it didn't remember" surprises.

Off by default

Turn them on in ~/.codex/config.toml:

[features]
memories = true

Or, in the ChatGPT desktop app, Settings > Personalization > Enable Codex memories. Then, in an interactive Codex session, /memories controls the current chat: whether it can use existing memories and whether it can become input for future ones. Chat-level choices do not change your global settings.

Written later, in the background

Memories are not saved when a chat ends. According to the docs and the memories README in the Codex repo, the pipeline starts in the background when you start a new (non-ephemeral, non-subagent) session. It looks for earlier chats that are eligible, has a model extract a memory from each, and then a separate consolidation step merges them into the memory files. Defaults from the official configuration reference:

  • memories.min_rollout_idle_hours = 6 (range 1–48). A chat must be idle this long before it is considered, so work from the last few hours is not picked up yet.
  • memories.max_rollout_age_days = 30. Older chats are not used.
  • memories.min_rate_limit_remaining_percent = 25. If less than that remains in your Codex rate-limit windows, generation is skipped so it does not spend your quota.
  • memories.max_rollouts_per_startup = 16. Each pass handles a bounded number of chats.

Codex also skips short-lived and still-active chats. In practice: if you stop at 6 PM and start again at 9 AM, yesterday's chat may be eligible, but the memory is generated in the background after you start, so it may not be ready in the first minutes of the new session. If you work in bursts during the day, lowering min_rollout_idle_hours (minimum 1) makes memories appear sooner.

One store per machine, chosen by the model

Memories live under your Codex home directory (~/.codex by default, or CODEX_HOME). A fresh home uses ~/.codex/memories_v2/; if ~/.codex/memories/ already exists, Codex keeps using it unless you set memories.version. The configuration reference describes the merge step as "global memory consolidation", so it is one store for that Codex home, not one per repo.

What goes in is whatever the extraction model judged useful: preferences, corrections, things that took time to find out. You do not pick the items, and OpenAI describes the files as generated state that you can inspect but should not rely on hand-editing. Its own guidance is to keep required rules in AGENTS.md and "treat memories as a helpful recall layer".

MCP and web-search chats

memories.disable_on_external_context defaults to false. If you set it to true, chats that used MCP tool calls, web search or tool search are kept out of memory generation. Worth knowing if most of your Codex sessions use MCP tools: with that option on, those sessions never become memories.

Other settings: memories.use_memories (inject existing memories into new sessions, default true), memories.generate_memories (let new chats become inputs, default true), and memories.extract_model / memories.consolidation_model to override the models used.

What codex resume brings back

codex resume opens a picker of saved chats, and codex resume --last reopens the most recent one from the current directory. That is the way to continue the same conversation after closing the terminal. It reopens the chat as saved: if it compacted, you get the compacted version back. We cover that case in Codex CLI compaction lost your context?

Resume is also one chat at a time. If you split work across several chats, or switch to a new chat because the old one got long, the new chat does not see the old one's plan.

Carry an exact task list to the next session (free)

Memories are fuzzy and delayed. A file is exact and immediate. Keep a short NOTES.md at the repo root and point to it from AGENTS.md, which every session loads:

## Sessions
- At the start of every session, read NOTES.md and run git status.
- Keep NOTES.md current: goal, done, open (in order), decisions,
  ruled out, next step. Update it before you stop.
- Do not redo items marked done.

At the end of a session, ask Codex to update NOTES.md. Tomorrow's chat reads it in the first turn. No waiting six hours, no rate-limit threshold, and you can read and correct it in a normal text editor.

If you want it injected automatically, a Codex SessionStart hook can print the file when a session starts (the compaction guide linked above has a tested example). Use both memories and the file if you like: memories for preferences, the file for the plan.

Where a file runs out

  • Nobody enforces the update. If the session ends before NOTES.md is updated, tomorrow starts from stale notes.
  • A flat file has no status or dependencies, so "what is in progress and what does it block?" depends on the last edit.
  • Several chats editing one file at the same time can overwrite each other.
  • If you also use Claude Code or Cursor, each needs its own wiring to the file. See How to add memory to Claude Code, Cursor and Codex.

Where Todo-MCP fits, honestly

Todo-MCP is a local MCP server that Codex runs over stdio. Tasks, their status and dependencies, and named context keys live in a SQLite file on your machine. Codex reads them only when it calls the tools, usually context_resume at the start of a session, which returns the current task, stored context and a suggested next step. It is a paid download, and the data stays on your machine. To see the options, leave your email in the form on this page first: it sends the setup tutorial and then shows plans.

Setup is one line (details in the Todo-MCP guide for Codex CLI):

codex mcp add todo-mcp -- ~/.local/share/todo-mcp/bin/todo-mcp --mode stdio

What it will not do:

  • It is not Codex memories and does not change them. Memories are Codex's own feature; Todo-MCP is a separate tool Codex can call.
  • It does not load itself. Add a line to AGENTS.md such as "at the start of a session, call context_resume", and the agent still has to make the call.
  • If you set memories.disable_on_external_context = true, chats that call it (or any MCP tool) will not feed Codex memories. The tasks themselves stay in the store either way.
  • In ChatGPT it runs from the desktop app (Work or Codex, Settings → MCP servers), not from the ChatGPT website, which connects only to remote MCP servers.

Whichever route you take, the rule is the same: the next Codex chat starts blank, so the plan has to live somewhere it will read on the first turn.

Give every new Codex session the same task list

Codex memories keep preferences, not your open tasks. Leave your email and we'll send the Codex setup tutorial. You can tell us you use Codex before any price is shown.

Step 1 of 4

This needs to be a real email — we'll email you in a few minutes.

No spam. Unsubscribe anytime.

Frequently asked questions

Does OpenAI Codex remember previous sessions?
Not the conversation. Each new Codex chat starts with a fresh context window. What it loads at the start is your AGENTS.md files, your config.toml (including MCP servers) and, only if you turned them on, local memories that Codex generated from earlier chats. To continue an actual earlier chat, use codex resume, which reopens that saved chat.
How do I turn on Codex memories?
Local Codex memories are off by default. Add memories = true under [features] in ~/.codex/config.toml, or turn on Enable Codex memories under Settings > Personalization in the ChatGPT desktop app. In an interactive session, /memories controls whether the current chat can use existing memories and whether it can feed future ones.
Why does Codex not remember what I did today, even with memories on?
Memories are written in the background, not at the end of each chat. By default a chat has to be idle for 6 hours before it is considered (memories.min_rollout_idle_hours, 1 to 48), and generation is skipped when less than 25% of your Codex rate limit remains (memories.min_rate_limit_remaining_percent). Short-lived and still-active chats are skipped. So same-day work often is not in memory yet.
Where does Codex store memories, and can I edit them?
Under your Codex home directory, ~/.codex by default. A fresh home with memories enabled uses ~/.codex/memories_v2/; if ~/.codex/memories/ already exists, Codex keeps using that store unless you set memories.version. OpenAI calls these files generated state: you can read them when troubleshooting, but hand-editing them is not meant to be your main control. Put rules that must always apply in AGENTS.md instead.
Can Codex memories hold my task list for tomorrow?
Not reliably. Memories are model-written summaries of what seemed useful, merged into one store per Codex home and updated hours later. They are good for preferences and lessons. For an exact list of open tasks, keep it in a file in the repo (for example NOTES.md, referenced from AGENTS.md) or in a task store the agent reads at the start, such as a local MCP server.

Continue Reading

Back to all articles