Codex CLI Memory: Instructions, Recall, and Saved Sessions

Codex CLI memory includes several different ways to carry context forward. Separate repository instructions, local memories, saved sessions, and shared project progress so each has a clear job.

Updated 5 min read

Codex CLI memory is best understood as separate layers: maintained instructions, optional local memories, and saved sessions you can resume. They carry different information and should not be treated as interchangeable. Required project rules need an explicit home, while yesterday's conversation may contain both useful evidence and ideas you later rejected.

A tool such as fenbs keeps current project decisions and progress readable by Codex and other connected AI apps. That is useful when the next session needs the team's agreed starting point rather than one person's local recollection. Keep the record small enough that you can check it yourself.

Which kind of memory do you need?

Start with what you want carried forward. “Use the repository's package manager” is a standing instruction. “We have not checked the Windows installer yet” is current progress. “Show me the earlier error output” calls for the previous session. Putting all three in one growing instructions file makes them harder to maintain.

Different context layers answer different questions
LayerUseful forWhat to watch
Maintained instructionsRequired repository conventions and checks.Keep them accurate, explicit, and appropriate to their directory.
Local memoriesHelpful recall from earlier work where enabled.Check controls and correct stale information; do not make this the only home for rules.
Saved sessionContinuing a specific conversation and its investigation.The files or project decisions may have changed since that conversation.
Shared work recordCurrent decisions, task status, and next steps for people and assistants.Save progress deliberately and distinguish checked work from unfinished work.

This distinction also helps when recall seems unreliable. First establish which layer was supposed to contain the fact. Then ask Codex to identify what it read. Repeating “remember this” without choosing a destination leaves you unsure where to correct it next time.

What belongs in AGENTS.md?

An AGENTS.md file holds written guidance for work in a repository. OpenAI's instructions documentation (opens in a new tab) describes an instruction chain assembled from global guidance and applicable project directories. Guidance closer to the working directory can override earlier guidance. The starting directory therefore matters when you check what was loaded.

Write rules that a new contributor could follow: the package manager, the right test command, files that need special care, and what counts as finished. Keep changing task progress elsewhere. A rule that always matters should survive even when no earlier chat or local memory is available.

Example repository guidance to adapt to your project
Use the package manager pinned by this repository.
Read the applicable app instructions before editing.
Run the checks required for the files you change.
Report what passed, what failed, and what was not checked.
Read the current project handoff before starting work.

Treat an assistant-generated instructions file as a draft to review. Remove guesses about commands and permissions. Our Codex CLI best practices covers broader working habits; reusable task procedures belong to the separate Codex skills guide. Here the goal is a reliable starting point.

Does Codex also have native local memories?

Yes. OpenAI's memories documentation (opens in a new tab) distinguishes local Codex memories from ChatGPT web memory. They use separate stores and controls. Do not assume that something saved through ChatGPT on the web is automatically available as a local Codex memory, or that a teammate shares your local recall.

The purpose is useful carryover from earlier work. That can complement written project guidance, but OpenAI recommends keeping required team instructions in AGENTS.md or checked-in documentation. A recalled preference is helpful background; a project rule should be available through a maintained source that the team can inspect.

Check the memory controls in your installed CLI rather than assuming they match a different Codex surface. In particular, distinguish using existing memories from generating future ones. Disabling one behavior is not the same question as deleting stored information. Keep account, machine, and project scope clear when diagnosing a missing fact.

What does resuming a session bring back?

A saved session lets you return to a particular conversation. OpenAI's CLI command reference (opens in a new tab) documents codex resume, including --last for the most recent chat in the current working directory and --all to include sessions elsewhere. It also documents /memories for controlling memory use and generation inside the terminal interface.

Resume an investigation from your project directory
codex resume
codex resume --last

Resume the old conversation when its investigation is still the work you need. Start a separate session when you have a different outcome to deliver, and supply a concise handoff. The Codex commands reference covers the wider command set without turning memory management into a list of every terminal option.

Returning to a chat is not a reason to trust every assumption in it. Ask Codex to inspect the present files before continuing. A teammate may have fixed the error, replaced an approach, or changed the acceptance criteria while the conversation was closed. Earlier reasoning remains useful evidence, but it needs current confirmation.

How do you keep carried context accurate?

Give each fact one clear home and a reason to stay there. Say a developer learns that a particular test needs a running service. The repository instructions can explain that requirement. The task record can say whether the service was available during the latest check. Neither fact should be silently substituted for the other.

  • Keep stable instructions separate from the current task and its next step.
  • Distinguish a person's approved decision from an assistant's proposal.
  • Write the actual check and result, including anything that could not be verified.
  • When a rule changes, update its maintained source and identify the replacement clearly.
  • Keep secrets and unnecessary personal information out of reusable context.

For example, “upload flow works” is too broad if only file selection was checked. “File selection passed; upload delivery remains untested; start with the network request” gives the next session an honest boundary. In fenbs, project context and Where we left off keep that changing work record alongside its tasks and decisions.

How fenbs helps

Give the next Codex session a current starting point

Keep project rules, active tasks, and Where we left off in fenbs. Ask Codex to read the project context before acting, then save what changed and what remains before it stops. Another connected assistant can read the same record when the work moves beyond your terminal.

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, free for one person with no credit card, and add one active project.
  2. Add the current tasks and write a short starting point. Put a person's standing instructions in Decisions and rules and preserve unanswered decisions as open questions.
  3. Connect Codex through the setup guide on Integrations. The connection uses MCP, a standard way for an AI app to use an outside tool, with browser sign-in.
  4. Ask Codex to read the project context at the start and save task and project progress before stopping. Keep local repository instructions focused on how to work with the files.

fenbs does not import local Codex memories or saved conversations automatically. If you only need to reopen one investigation on one machine, session resume may be sufficient. The shared record becomes useful when people or AI apps change and the work still needs one agreed starting point.

How can you test a fresh start?

Save a real handoff, then open a fresh session and ask Codex to summarize the relevant rule, completed check, uncertainty, and next action before editing. Compare its answer with the maintained record. If something is missing, correct the source or starting instructions, then repeat the small check.

Keep this exercise narrow: one task, one rule, and one remaining check. You are testing whether the next session receives usable context. The broader AI memory guides explain how to carry useful work forward while keeping the record understandable to the people responsible for it.

Questions people ask.

Is AGENTS.md the same as a saved memory?

No. It is maintained written guidance for the repository. Local memories provide recall from earlier work and should not be the only place required team rules live.

Can I use ChatGPT web memory as Codex local memory?

Do not assume they are interchangeable. OpenAI documents separate local Codex memory storage and controls from ChatGPT web memory. Put required project guidance in an explicit maintained source.

Does codex resume --last choose a session from any folder?

It selects the most recent chat for the current working directory. The all option includes sessions outside that directory. Confirm that you resumed the intended conversation before continuing.

Should an assistant remember that tests passed?

Keep the exact check, result, and relevant task state in a maintained work record. A later change can make an earlier result outdated, so recall of a passing check does not prove the current files still pass.

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.