Make Codex remember your project with Memories
Turn on Codex memories in the ChatGPT desktop app so Codex recalls your stack and habits across chats, with fixed rules in AGENTS.md, in 15 minutes.

What you need
OpenAI lists Memories as limited availability on every plan, so the setting may not show for every account yet.
Step 1: Turn on Codex memories
2 minLocal Codex memories are off by default, and the switch works per computer.
- Open the ChatGPT desktop app and press
Cmd+,on a Mac orCtrl+,on Windows to open Settings. - Go to Settings > Personalization and turn on Enable Codex memories.
- Decide on Allow memories from tool-assisted chats. Turn it on only if chats that use MCP tools or web search should feed memories.
- Using the Codex CLI instead? Add the lines below to
~/.codex/config.toml.
Your config (CLI)[features] memories = true
You should see Enable Codex memories switched on for this computer.
No Enable Codex memories setting?
OpenAI lists Memories as limited availability, so your account may not have it yet. Until it does, keep your project notes in AGENTS.md, as in step 2.
- Open the ChatGPT desktop app and press
Step 2: Write the rules that must always apply
4 minMemories help Codex recall things. OpenAI says rules that must always apply belong in AGENTS.md instead.
- In your project's root folder, create a file named
AGENTS.md. - Paste the template below and fill in your stack, your test command and your rules.
- For rules that cover every project, put them in
~/.codex/AGENTS.mdinstead.
Your AGENTS.md# AGENTS.md ## Project - Stack: [LANGUAGE], [FRAMEWORK], tests with [TEST LIBRARY]. - Run `[TEST COMMAND]` after every change. ## Rules - Use TypeScript strict mode. - Ask before adding a new dependency. - Never commit secrets or `.env` files.
You should see an
AGENTS.mdfile at the root of your project, with your stack and rules in it.Codex seems to skip the end of the file?
Codex stops reading instruction files at 32 KiB in total by default. Keep the file short, or move folder rules into an
AGENTS.mdin that folder.Codex reads AGENTS.md before it starts any work, so these rules apply in every chat.
- In your project's root folder, create a file named
Step 3: Do real work in the project
5 minCodex builds memories from real chats. It skips short chats and ones that are still running.
- In the app, pick Codex, open your project's folder, and start a New chat.
- Paste the prompt below, with a real task from your list in place of [YOUR TASK].
- Correct Codex in plain words when it gets something wrong. Those corrections are useful context.
Your promptLook through this project and tell me its language, framework, test command and folder layout in 5 bullet points. Then [YOUR TASK]. Follow AGENTS.md, and run the tests when you're done.
You should see a 5-point summary of your project, then the task done and the tests run.
Codex doesn't follow your AGENTS.md rules?
Check that the file sits in the folder you opened, or in a parent folder up to the Git root. Then start a new chat, since Codex reads it once per run.
Memories don't update the moment a chat ends. Codex waits until the chat has been idle for a while.
Step 4: Choose what each chat remembers
2 minSome chats should stay out of memory, such as quick experiments or someone else's code.
- In any Codex chat, type
/memoriesin the message box. - Choose whether this chat can use the memories you have, and whether it can feed future ones.
- Your choice covers this chat only. Your setting in Personalization stays the same.
You should see the memory choices for the current chat, set the way you want.
The /memories command isn't there?
Turn on Enable Codex memories first, as in step 1. In the Codex CLI, add the config lines from step 1 and start a new session.
- In any Codex chat, type
Step 5: Review what Codex stored
2 minMemories are files on your own computer, so you can check them before you share anything.
- Open a terminal and run the command below to list the memory files.
- Open a few files and read what Codex kept about your project.
- To start over, go to Settings > Personalization and select Delete Codex memories.
Run this (Mac or Linux)ls ~/.codex/memories*
You should see one or two memory folders, with files that sum up your past chats.
A memory is wrong or out of date?
Don't edit the files by hand. Put the correct rule in AGENTS.md so it applies every time, or delete your memories and let Codex rebuild them.
Codex removes secrets it finds, but OpenAI says to check these files before you share your
~/.codexfolder.
You get
Codex that recalls your stack and habits across chats, with the rules that matter fixed in AGENTS.md
Try next
Did this guide work for you?
Thanks. It helps us fix the steps.


