Codex Agent Memory: Keep Context Between Sessions

Give Codex a reliable starting point with project instructions, reviewed memory, and a short handoff. Test a fresh session before trusting what carries forward.

Updated 5 min read

Codex agent memory works best when you separate required project instructions, remembered context, and the current task’s progress. Keep lasting requirements in AGENTS.md, check the memory controls available in your Codex client, and verify a fresh session against a written handoff before letting it continue.

Tools like fenbs keep shared decisions and progress outside one Codex installation, so another supported assistant can read the same work record. You still need to choose what to save and check that the next session actually reads it.

What should you do before ending a session?

  1. Record what changed, which checks ran, and what remains unfinished. Include the relevant file names and task references so the next session can inspect the evidence.
  2. Put requirements that must always apply in project instructions. Put this task’s unfinished work in its handoff, where it can be replaced when progress changes.
  3. Review memory settings in the client you use. Decide separately whether a chat can read previous memories and contribute information to future memories.
  4. Start a fresh session with the same project and ask for the current goal, applicable rules, completed checks, and next step. Compare its answer with your record.

Suppose you are updating a signup form. The useful handoff says the form now accepts the approved fields, validation tests passed, and a phone check is still outstanding. “Signup work finished” loses the distinction the next person needs. Write the handoff for someone who cannot see your current conversation.

Which kinds of context are you relying on?

A conversation, an instruction file, and a memory entry do different jobs. Agent memory is information available across interactions; the model’s current context is the material it has available while answering. A restart check reveals whether you saved something durably or merely mentioned it during the conversation.

Choose a home by what must survive
InformationPractical homeHow to check it
Required repository behaviorAGENTS.md and project documentationAsk a new session which instructions apply and where they came from.
Useful recall from earlier workSupported local Codex memoriesCheck the controls and ask for a harmless fact from a completed earlier task.
An existing conversationThe saved sessionReopen it and check the repository’s actual current files.
Shared decisions and remaining workA reviewed project recordAsk another connected assistant for the same decision and next step.

Do not turn every chat detail into a permanent instruction. A temporary workaround belongs with the task and its reason. A lasting team rule needs an owner and a clear scope. The distinction between memory and context helps you decide what needs saving before you close the window.

How do instructions and local memories differ?

OpenAI’s AGENTS.md documentation (opens in a new tab) explains that Codex discovers guidance from global and project locations at the start of a run. More specific guidance can affect the work beneath it. Put a rule where it applies and ask Codex to identify the files it read when the behavior seems wrong.

OpenAI’s memory guide (opens in a new tab) describes a separate local memory store for local Codex clients, with /memories controls for individual chats. Generated memories can update in the background rather than immediately when a chat ends. Treat them as useful recall, while required guidance remains in reviewed project files.

Keep the first test simple. Save a harmless project preference, finish the session, and later ask a fresh session to identify its source. If it cannot, check whether reading or contributing memories was disabled. Do not assume failure means every kind of persistence is broken; a saved file may still be available even when remembered context is absent.

For rules and progress that several assistants need, fenbs project context gives the work a shared home. A local preference can remain local, while the person-approved form decision and outstanding check stay with the project.

How can you test a restart without guessing?

Use a read-only check before asking for more changes. Give the next session the project name and ask it to identify the goal, relevant instructions, completed work, and remaining check. Request the file or record behind each answer. An accurate answer with a source is stronger evidence than “I remember.”

Test reopening an old conversation separately from starting a new one. OpenAI’s Codex CLI guide (opens in a new tab) documents codex resume for returning to saved chats. Resuming helps continue that conversation; it does not prove that an unrelated fresh session will know the same project facts.

For terminal-specific setup and commands, use the Codex CLI memory guide; the checks here focus on continuity across sessions and assistants.

  • Pass: it finds the current decision, names its source, and keeps the pending phone check unfinished.
  • Needs correction: it recalls an earlier design without noticing the newer approved version.
  • Needs investigation: it cannot read the expected project location or cannot reach the external record.
  • Unsafe to continue: it invents a test result or treats a proposed change as an approved decision.

Correct the source first, then repeat the same question. Adding another reminder to a growing chat can conceal the underlying problem. For broader handling of sensitive or misleading stored information, use the agent memory security guide.

How fenbs helps

Give Codex a reviewed starting point

Add the project’s approved decisions, current tasks, and unfinished checks to fenbs. Ask Codex to read the AI context before working and save progress before stopping. Another supported connected assistant can then read the same record without depending on your local Codex memories.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

How to do this with fenbs

  1. Create a free account, then add a project with the goal that Codex should continue toward. Start with one active piece of work.
  2. Add the current tasks and record the choices a person already made in Decisions and rules. Keep open questions open; an assistant cannot decide or sign off.
  3. Follow the Codex setup guide in Integrations. MCP, a standard connection for outside tools, lets the supported client read and update the work after browser sign-in.
  4. Ask Codex to read the project context at the start, including Rules and Where we left off. Before stopping, ask it to save what changed, what was checked, and where to resume.
  5. Open a fresh session and repeat the read-only check. If you switch to another supported assistant, have it read the same project before changing anything.

fenbs is free for one person, no credit card. It is not the right fit if you only want to resume one local conversation or keep private coding preferences on one machine. It does not automatically import Codex chats or synchronize the local memory store.

What makes the record useful after several sessions?

Replace outdated progress, preserve the reason behind decisions, and attach uncertainty to the task that owns it. After the phone check passes, record what you checked and remove it from the next step. If it fails, save the visible problem and reproduction steps rather than a vague warning.

Review continuity whenever you change machines, clients, or assistants. Those changes are useful moments to check what your workflow truly shares. The AI memory topic hub covers related approaches; your practical standard stays simple: the next session can find the current rule, explain the evidence, and begin with the right unfinished task.

Questions people ask.

Does a fresh Codex chat automatically know every earlier task?

Do not assume it does. Available context depends on project instructions, memory settings, the client, and any records the assistant can read. Check a fresh session against a short written handoff.

Should I put task progress in AGENTS.md?

Keep required project guidance there. Rapidly changing task progress is usually clearer in a separate handoff or task record, so yesterday’s unfinished work does not become a lasting instruction.

Why is a memory missing immediately after I finish?

OpenAI documents background memory generation that may wait until a chat has been idle. Check the relevant settings and keep important progress in an explicit record instead of relying on immediate recall.

Can fenbs move my local Codex memories into another AI app?

fenbs does not import the local memory store. You choose which project decisions, tasks, and progress to record, then supported connected assistants can read that shared work.

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.