The Practice Room / Codex / Episode 3

Codex

What goes in an AGENTS.md file?

Codex forgets everything about your project the moment you close the window.

By MstimajPublished 16 October 2026Level Start HereTool Codex

Sign in to save your place and mark this done. Free, no card.

It forgets when you close the window

Codex keeps nothing about your project once the window shuts. Every session starts from nothing unless you have written things down in one file, and the file has a name Codex goes looking for.

That name is AGENTS.md. Claude Code calls its version CLAUDE.md. Same idea, different name, and Codex will even offer to convert one into the other.

Do it yourself

  1. Open Codex in your folder.
  2. Type /init and press enter.
  3. Codex describes it plainly: create an AGENTS.md file with instructions for Codex.
  4. It reads the folder, then writes that one file.
  5. Read it back: type type AGENTS.md and press enter.

What closing the window costs you

you explainthe projectwhere things are, what matters
→
you close itit is gonenothing carries over
→
the fileit reads firstevery session, without being asked

It is not memory, and it does not learn. It is a note it reads before it starts.

The two halves

What it wrote by itself is the top. That is Codex describing what it worked out about your folder, and it is usually close enough to leave alone.

Underneath is the part that is yours. You tell it who you are and what you are building. You tell it how you want things done, and what it must never touch. Everything you are tired of repeating goes in there once, and it reads it every time.

The honest part

Written down does not mean always obeyed. The file shifts the odds heavily in your favour and it does not guarantee anything. It drifts, and you check.

The same caution applies to CLAUDE.md, which is worth saying because people assume a file they wrote has the force of a setting. It has the force of an instruction to someone capable who is reading quickly.

Check yourself

What is the file called, and why that name?

AGENTS.md. Codex looks for that specific name when it opens in a folder.

What does Claude Code call its version?

CLAUDE.md. Codex will offer to convert between them.

Which half of the file is yours to write?

The bottom. The top is what Codex worked out about the folder on its own.

You wrote never touch the pricing file and it touched the pricing file. What now?

That is drift, and it is expected. The file makes it far less likely, not impossible. You check.

When it goes wrong

type AGENTS.md says no such file. You are in a different folder than the one /init wrote into. Type cd on its own to check where you are standing.

Nothing you wrote is being followed. Confirm the file is in the folder you are opening Codex in. These files are per folder.

You have both files and they disagree. Pick one as the real one and keep the other short, or let Codex convert so they match.

Words used here

System prompt • Context window • Codex and Claude Code compared

Go deeper

agents.md is the open format these files follow, which is why more than one tool reads them.

What she says in the film

Codex forgets everything about your project the moment you close the window.

Unless you write it down in one file, and the file has a name it looks for.

Open Codex in your folder and type /init.

Codex describes it plainly. Create an AGENTS.md file with instructions for Codex.

It reads the folder, then writes that one file.

Read it back with type, space, AGENTS dot M D.

What it wrote is what it worked out on its own. Underneath is the part that is yours.

You tell it who you are and what you are building.

You tell it how you want things done, and what it must never touch.

Everything you are tired of repeating goes in there once, and it reads it every time.

One note, because people do ask. Claude Code calls its version CLAUDE.md.

Codex will even offer to convert one into the other. Same idea, different name.

And the honest part. Written down does not mean always obeyed. It drifts, and you check.

That is your Codex tip for today.

No permission required.

Reference card: what goes in an AGENTS.md file for Codex. It shows slash init creating the file, the four steps from opening Codex to adding your own rules, and what a good AGENTS.md contains in practice.
The whole lesson on one card.
Next walkthroughCodex makes a set of pictures, from the terminal
On your machineWant this set up on your own computer, with your own files?

Book a session and we do it together on a call.

Book an hour

Ask what did not make sense

Comments go through our own form and are read before they appear. Links are not allowed; describe it in words.

Comments are read before they appear.

The newsletter

Get the next walkthrough.

One email when something goes up. The argument, the film and the term, nothing else. One click to leave.

Have a question now? Ask Mstimaj, she knows the archive.