| Duration | ~40 min in the lesson + ~20 min homework |
| Prerequisites | Lesson 0.2 without the Claude Code install and sign-in (terminal, Git, Node.js, code editor and the four accounts are still needed); lesson 0.4 — the project folder is a Git repository on GitHub; a ChatGPT plan that includes the Codex CLI, or an OpenAI API key with billing. |
| Checkpoint | none (the lesson ends with a commit and push, no tag) |
What you will have
Codex is installed and signed in, runs in the course project in a mode where it asks before every edit, and reads the project rules through a short AGENTS.md that points to CLAUDE.md. The student has made one change with Codex, reviewed it and committed it.
Video
The video for this lesson is not recorded yet.
Do along
Do these steps on your own project, pausing the video where a step says so.
- Pause after Part 2. Install Codex with the command for your system, open a new terminal, and run
codex --version. - Make sure your ChatGPT plan includes the Codex CLI, or prepare an OpenAI API key with billing.
cdinto your project folder, runcodexand sign in.- Pause after Part 3. Accept the trust question. Type
/permissionsand choose Read Only. Check with/status. - Pause after Part 4. In your editor, create
AGENTS.mdat the top level with the five lines from Part 4. - If you have no
CLAUDE.mdyet, create the starter from Part 4. Adapt: your own project name in the heading. - Type
/exit, startcodexagain, set Read Only, and send the rules question from Part 4. - Pause after Part 5. Send the first prompt from Part 5. Adapt: your own opening hours, or another one-line change to your page. Read the approval prompt, then approve once.
- Review with
/diff, and withgit statusandgit diffin a plain terminal. Reload the page in the browser. - Send the commit prompt from Part 5. Read the command before approving.
Check your work
- Run
codex --version. Expected:codex-cliand a number. - Run
codex login status. Expected: it reports that you are signed in. - Start a new session and ask the rules question. Expected: Codex names
CLAUDE.mdand quotes a rule from it, without you naming the file. - Run
git log --oneline -1. Expected: the commit "Bonus 9.1: Codex set up, opening hours added". - Open the repository on GitHub. Expected:
AGENTS.md,CLAUDE.mdand that commit.
Common problems
codexis not found after installing. → The terminal was open during the install. → Open a new window. If it is still missing, install with npm, which you have from lesson 0.2:npm install -g @openai/codex.- You sign in but Codex will not work. → The plan does not include the Codex CLI. → Check the pricing page; change plan or sign in with an API key.
- Codex edited a file without asking. → The session is in Auto. → Type
/permissions, choose Read Only, and review the change withgit diff. - Codex does not know the rules. →
AGENTS.mdis misnamed, not in the top folder, or was created after the session started. → Fix the name and place, then start a new session. - Codex knows
AGENTS.mdbut does not openCLAUDE.md. → It did not follow the pointer. → Start the session with "Read CLAUDE.md first." Alternative while the project has noAGENTS.md: put the lineproject_doc_fallback_filenames = ["CLAUDE.md"]at the very top of~/.codex/config.toml; Codex then loadsCLAUDE.mditself. The setting is ignored in a folder that contains anAGENTS.md. - The commit fails with
index.lock: Operation not permitted. → The command ran inside Codex's sandbox, which cannot write to the Git folder. → Approve when Codex asks to run it with permission, or commit yourself.
Homework
About 20 minutes, after the lesson, on your own. Nothing later in the course depends on it.
- A second change, briefed by you. Pick one more one-line change to your page that is true for your business (a phone number, the area you serve). Write the request yourself in the shape of the Part 5 prompt: what you want, where, what done means, and "do not commit". Approve the edit, review it, then ask Codex to commit and push, without a tag. Deliverable: a second commit made through Codex. Done when: the line shows on the page and
git statusreports nothing to commit. - One rule of your own, proven. By hand, add one rule to
CLAUDE.mdthat holds for every page of your business, for example the exact spelling of its name. Start a new Codex session and ask the rules question from Part 4. Commit and push, without a tag. Deliverable: the new rule inCLAUDE.md. Done when: Codex quotes your rule without you naming the file. - Your start-of-session card. On paper or in a note outside the project, write the three or four things you will check each time you start Codex: the folder, Read Only in
/status, a cleangit status, anything else you want. Then open a new session and use it once. Deliverable: the card. Done when: you have run every line of it in a real session.