العربية
Back

AI

Codex Memories: How They Work and How to Control Them

How local Codex carries context between chats, where it stores it, which settings control it, and what not to keep in it.

Last reviewed:

The idea

Memories let ChatGPT and Codex carry useful context from earlier work into future work. ChatGPT on the web uses ChatGPT memory, while local Codex clients use a separate local memory store with its own controls. OpenAI advises keeping required team guidance in AGENTS.md or checked-in docs and treating memories as a recall layer, not the only source.

How local memories work

After you enable it, Codex turns useful context from eligible prior chats into local memory files. It skips active or short-lived sessions, redacts secrets from generated memory fields, and updates in the background rather than right at the end of each chat. It waits until a chat has been idle, and may skip a pass when remaining rate-limit percentage is below the configured threshold.

Turn it on

  1. In the ChatGPT desktop app: Settings, then Personalization, then Enable Codex memories.
  2. Or in config.toml: set memories = true under [features].
  3. Per chat: use /memories in the CLI or app to decide whether the chat uses existing memories and whether it can feed future ones. This does not change the global setting.

Memory settings

  • memories.generate_memories: whether new chats can be stored as memory-generation inputs.
  • memories.use_memories: whether Codex injects existing memories into future sessions.
  • memories.disable_on_external_context: when true, chats that used external context such as MCP or web search are kept out.
  • memories.min_rate_limit_remaining_percent: the minimum remaining rate-limit percentage before generation starts.
  • memories.extract_model and memories.consolidation_model: override the models used for extraction and consolidation.

Where it is stored

Under your Codex home directory, by default ~/.codex. In a fresh Codex home the CLI uses $CODEX_HOME/memories_v2/ by default, and keeps using $CODEX_HOME/memories/ if it already exists. In the desktop app check both. Treat these files as generated state: inspect them when troubleshooting or before sharing your Codex home, and do not rely on hand edits as the main control.

Review and delete

Do not store secrets in memories. Codex redacts secrets from generated fields, but review files before sharing your Codex home. To reset the selected machine's store, choose Delete Codex memories and confirm; on the local machine this also clears Computer History when that feature is available.

Common mistakes

  • Putting must-always-apply rules in memories instead of AGENTS.md.
  • Sharing the whole ~/.codex folder without reviewing memory files.
  • Letting memories capture chats that used external tools when you do not want that. (Our tip: enable disable_on_external_context)

Next steps

  • For standing project guidance: the AGENTS.md guide.
  • For settings: config basics.

Latest updates

No dated update on this topic was found on the official page read on 2026-11-30. We add updates when they appear.

Similar tools

Standalone pages for similar items are added after their official sources are read. We name nothing without a full page.

Related pages

Sources

Wording is ours, from the official source. Images and video belong to their owners and are credited with a link to the official page.

#ai#codex#memories#privacy#settings#dev

Frequently asked questions

Are memories on by default?

No. Local Codex memories are off by default; turn them on in settings or with memories = true under [features]. (OpenAI)

Codex Config Basics: config.toml and Precedence

Should team rules go in memories?

No. OpenAI says to keep required guidance in AGENTS.md or checked-in docs; memories are a helpful recall layer. (OpenAI)

AGENTS.md in Codex: Durable Instructions for Your Project

Do MCP tool chats feed memories?

You can control it: the disable_on_external_context setting keeps chats that used MCP or web search out of memory generation. (OpenAI)

Connect Codex to MCP Servers: App, CLI and config.toml