Memory here means notes the harness saves from your sessions and brings back in later ones. Instruction files you write yourself, such as AGENTS.md or CLAUDE.md, are on the Instructions page.
Built-in memory
| Question | Codex CLIOff until you turn it on, checked at 0.162.1 |
|---|---|
| Is it on, and how do I switch it? | Codex has built-in local memories, off by default. Turn them on with The feature is marked stable but still defaults to off; the old key Admins can force it on or off for managed users with In the ChatGPT desktop app the switch is Settings > Personalization > Enable Codex memories. |
| Who writes memories, and when | A background job writes memories, not the chat you're in. Each time you start a turn in an interactive root session, Codex looks at your other threads that have been idle for at least 6 hours and are at most 10 days old. It summarizes up to 2 of them per pass with a low-effort model. At most every 6 hours, a sandboxed consolidation agent with no network access merges those summaries into the memory files. The agent in your chat only adds a note when you explicitly ask it to. Only CLI/TUI, IDE extension and ChatGPT desktop threads feed memories. Generation is skipped while less than 25% of your Codex rate limit remains ( Tunable with Set Secrets are redacted from the generated memory fields. |
| Where they are kept | Memories are stored under $CODEX_HOME/memories (default ~/.codex/memories). Setting Files include memory_summary.md, MEMORY.md, raw_memories.md, rollout_summaries/, skills/ and extensions/. The folder is also a local git repository that Codex uses to track changes between consolidation runs. 0.165.0: with memories turned on and no 0.165.0 App Server can import Claude Code project memory ( |
| What a new session loads | At the start of each thread, Codex injects memory_summary.md as developer instructions, truncated to 2,500 tokens, together with guidance on how to use the memory folder. MEMORY.md (the searchable index), rollout_summaries/ and memory skills/ are not loaded. The agent searches or opens them on demand when a task looks related, usually in 4-6 search steps or fewer. A change to When the agent uses a memory file, its reply ends with a memory citation block.
|
| See and edit them | Partly There's no memory browser. To see what Codex remembers, open the Markdown files in ~/.codex/memories (start with memory_summary.md and MEMORY.md). /memories in the TUI only toggles "Use memories" and "Generate memories" and offers "Reset all memories". OpenAI calls these files generated state: you can read them, but don't edit them by hand to control behaviour, because the next consolidation rewrites them. In 0.162.1 the /memories toggles are written to config.toml as 0.165.0 adds an experimental App Server request, |
| Make it remember something | Partly Ask the agent directly, for example "remember that we deploy with make ship". When you explicitly ask, it writes a small note to ~/.codex/memories/extensions/ad_hoc/notes/<timestamp>-<slug>.md. The next background consolidation merges the note into the memory files, so it is not available immediately. Rules that must always apply belong in AGENTS.md instead. Notes are treated as information only, never as instructions, and remembered facts are tagged "[ad-hoc note]". |
| Correct or forget something | To correct or remove one fact, ask the agent to forget or update it. It records your request as an ad-hoc note, and the next consolidation applies it. To wipe everything, run /memories > Reset all memories in the TUI, or the hidden Memories that haven't been used for 30 days drop out of consolidation ( The ChatGPT desktop app offers the same wipe as Settings > Personalization > Delete Codex memories. |
| Share with a team or another machine | Not supported No. Memories stay local to one machine's Codex home and don't sync, and there's no project-level memory file to commit. Put shared team knowledge in AGENTS.md or checked-in docs, which the official docs recommend. The IDE extension uses the memory store of the Codex host it is connected to. Review the memory files before you share your ~/.codex directory. |
| Memory for subagents | Partly Subagents have no memory of their own. They inherit the parent's config, so they read the same global memory summary, but their threads never feed memory generation. A custom agent role can turn memory off for itself with |
Notes and sources
Codex CLI, 33 sources
- Generated state is not a documented external write contract.
- Background generation can lag idle chats and skip active or short-lived chats.
- Local filenames and layouts remain observations until version-bounded evidence establishes their contract.
Is it on, and how do I switch it?, 5
Who writes memories, and when, 7
Where they are kept, 13
- mod.rs
- codex-rs/features/src/lib.rs
- codex-rs/features/src/lib.rs
- codex-rs/app-server/src/external_agent_migration/processor.rs
- codex-rs/app-server/src/external_agent_migration/processor.rs
- migration_source.rs
- cla.rs
- memory.rs
- codex-rs/external-agent-migration/src/memory_import.rs
- codex-rs/external-agent-migration/src/memory_import.rs