We are still in the throwaway project. In this guide you make Codex open your site in a real Chrome window and click through it on its own, then you generate an AGENTS.md file and trim it down to the rules that matter.
workshop folder. This is still practice on the throwaway site, so you can experiment freely.At the end of guide 5 you left npm run dev running in Codex's bottom panel. That command starts the Vite development server, the small program that serves your React site to the browser and reloads it whenever a file changes. Codex can only “navigate the site” if that server is still up, so check it first.
In the Codex app, look at the top-right corner for the toggle bottom panel icon (a rectangle with a bar along its bottom edge). Click it. A terminal panel appears at the bottom of the window. If you can still see the Vite output from guide 5 (the line with Local: http://localhost:5173/), you are set and can skip to Step 2. If the panel is empty, or shows a plain prompt, start the server again:
cd ~/codex-course/auctionhouse-throwaway npm run dev
Line by line:
cd ~/codex-course/auctionhouse-throwaway moves the terminal into the throwaway project folder. Codex's bottom panel usually opens there already, but running cd again costs nothing and avoids the “no such file” errors you get when you are in the wrong folder.npm run dev asks npm to run the script named dev from the project's package.json. In a Vite project that script starts the development server. It keeps running until you stop it with Ctrl+C, so leave this terminal alone.localhost is a name that always means “this computer”. When you open http://localhost:5173, the browser does not go to the internet; it talks to a program running on your own Mac. The number after the colon is the port. One computer can run many servers at once, so each listens on its own numbered door: Vite uses 5173 by default, our backend API later uses 3000, PostgreSQL uses 5432. If a port is already taken, Vite simply picks the next one (5174), so always read the port from the terminal output instead of assuming.
➜ Local: http://localhost:5173/ in the bottom panel, with a blinking cursor below it and no red error text. Open that URL in Chrome once to confirm the auction site loads.
If you see vite: command not found, the packages were never installed. Run npm install once in the same panel, wait for it to finish, then run npm run dev again.
Here is the idea I want you to take away from this step: instead of you opening the site and clicking around to check Codex's work, you ask Codex itself to open the site and show you around. The agent becomes the demo-giver, and you become the reviewer who points out what is wrong. That is a much better use of your time than clicking every link yourself.
Codex has a built-in browser and “computer use” feature that can do this directly, but that feature only works when you are signed in with a ChatGPT plan. We are signed in with an API key, so we take a different route: we ask Codex to drive Chrome through Playwright. The result on screen is the same, a Chrome window opening and moving through the pages by itself.
Playwright is a library that lets a program control a real browser: open a URL, click a button, type into a form, read the page, take a screenshot. Testers use it to write end-to-end tests that behave like a human user. A browser run by Playwright can be headless, meaning it runs invisibly in the background (fast, good for automated test runs), or headed, meaning a real window opens on your screen so you can watch what happens. For a demo we want headed, which is why the prompt says so explicitly. We will meet Playwright again in guides 11 and 12, when we use it to make four users bid on the same auction at once.
Paste this into the same chat. The first sentence is the actual request. The second sentence tells Codex how to do it on our setup, so it does not waste a turn trying its built-in browser and failing.
open this in edge or chrome and navigate the site for me. The built-in browser isn't available to me, so use Playwright with a visible (headed, not headless) Google Chrome window, and leave the window open when you're done
Notice the phrase “leave the window open when you're done”. Without it, Playwright closes the browser the moment the script ends, and you would see a window flash for a second and vanish. Small, precise instructions like this are what make agent prompts work.
Codex first checks whether Playwright is installed in the project. It may run npm install playwright or npx playwright install chromium; approve those if it asks. After a minute or so a Chrome window opens on localhost:5173, usually with a yellow bar saying “Chrome is being controlled by automated test software”, and moves through the pages on its own. Codex then reports something like “Worked for 50s” and a summary similar to:
Your auction names and themes will be different, because your Step 3 build in guide 5 was different. What matters is that Codex visited the home page, switched themes and opened at least one auction detail page.
If Codex asks to install Playwright or download a browser, approve it. This is a throwaway project, so there is nothing to protect. If it still cannot open a window after two tries, do not fight it: open http://localhost:5173 in Chrome yourself and click through the three themes. The point of this step is the idea: let the agent demo the feature so you can spot what is wrong. In my own work I sometimes go one step further and ask it to record the walkthrough as a short screen recording that I can send to a client.
Browser runs cost more tokens than normal prompts, because Codex takes screenshots and performs many small steps. Use them for demos and final checks, not after every tiny change. Keep an eye on platform.openai.com → Usage while you learn.
Now we create the single most useful file in any Codex project. Before you send the prompt, understand what you are asking for.
AGENTS.md is a plain Markdown text file in the root of your project. Codex reads it automatically and sends its contents along with every prompt you type in that project. Think of it as a standing note pinned above the message box: “always use these commands, never add a new framework, run the build after every change”. You write it once and it shapes every future answer. Because an AI model gives slightly different answers each time (it is non-deterministic), AGENTS.md is one of the main ways to make Codex behave predictably. Every part of our auction app will have one.
We let Codex write the first draft. It has just built the whole site, so it knows the stack, the commands and the folder layout better than anyone. Paste this into the same chat:
generate me an AGENTS.md
Why such a short prompt? Codex already has the full context of this chat and can read every file in the project. Telling it in detail what to include would only narrow the result. We let it write too much on purpose, then cut it down by hand in Step 5. Cutting is faster than dictating.
After about 25 seconds, a message like “Created AGENTS.md with project structure, commands, route and theme conventions, UI standards, change guardrails, and a verification checklist” (your wording will differ), plus a card that reads Edited 1 file +117 -0. The +117 means 117 lines were added and -0 means nothing was removed; your line count will be different. Click Review on the card to read the file inside Codex.
Codex also has a built-in /init command (type / in the message box and pick “Init: Create an AGENTS.md file with instructions for Codex”). It does the same job with a slightly more structured template. A plain prompt is fine; I use whichever I remember first.
You could edit AGENTS.md inside Codex, but a proper editor is better for cutting whole sections. Open the Terminal app (not Codex's bottom panel this time, because that one is busy running Vite) and run:
code ~/codex-course/auctionhouse-throwaway
code is the VS Code command-line launcher you installed in guide 1. Giving it a folder path opens that whole folder as a project, with the file tree (the Explorer) on the left.
In the Explorer, click AGENTS.md. It opens as raw Markdown, with # for headings and - for bullets. To read it comfortably, press Cmd+K, release both keys, then press V. VS Code opens a formatted preview in a second column to the right, so you see the raw text on the left and the rendered version on the right. Edits on the left update the right side immediately.
The Explorer shows dist (the built, production-ready copy of the site), node_modules (all the installed packages, never edit this), src (the React source code), AGENTS.md, index.html, package-lock.json and package.json. Your AGENTS.md has sections similar to: Project overview, Technology, Common commands, Project structure, Routes, Auction data, Theme system, UI and accessibility conventions, External assets, Change discipline, Verification checklist.
Read the whole file once before touching it. Ask yourself for each section: is this a rule Codex must follow, or a description of how the app happens to look right now? That question drives the next step.
A generated AGENTS.md is always too long, and the extra length is not harmless. Every line is sent with every prompt, so a bloated file wastes tokens and buries the rules that matter. Worse, the descriptive parts (“there are six auctions”, “breakpoints are 900px and 580px”) go stale the moment the app changes, and then Codex is working from wrong information. Codex can look up the current state of the code any time it wants; it cannot look up your rules.
My rule of thumb: keep rules and constraints, delete descriptions of what the app is today. Edit AGENTS.md in VS Code with that rule in mind.
Delete:
src/data.js” line under Technology. Also a description, and the data source will change.Keep: the product-feel guidance in Project overview, the rest of Technology (especially a line like “Do not introduce a new framework…”, which is a real constraint), Common commands including “Run npm run build after material code changes”, UI and accessibility conventions, External assets, and the Verification checklist. A checklist is gold: it tells Codex how to prove its own work before it reports back to you.
Press Cmd+S to save. Codex reads the file fresh on your next prompt, so there is nothing to reload.
A file roughly half as long as before, ending with a verification checklist similar to this one:
npm run build./ and confirm all six auctions render./auction/:id route and confirm the selected theme persists.In the Codex app, nothing visible changes, but from now on every prompt in this project carries these rules.
Your file will not match mine heading for heading, and that is fine. Apply the rule, not the exact list. If you delete too much, click Undo on Codex's “Edited 1 file” card to restore the generated version, or simply send generate me an AGENTS.md again and start the trim over.
Skip this step if you only use Codex. If you also use Claude Code (Anthropic's coding agent), you will want both tools to follow the same project rules. Claude Code reads a file called CLAUDE.md, not AGENTS.md. Instead of maintaining two copies that drift apart, create a CLAUDE.md whose only line is @AGENTS.md. The @ tells Claude Code to import that file, so the rules live in exactly one place. Run this in the Terminal app:
cd ~/codex-course/auctionhouse-throwaway printf '@AGENTS.md\n' > CLAUDE.md cat CLAUDE.md
Line by line:
cd ~/codex-course/auctionhouse-throwaway moves into the project folder, so the new file lands next to AGENTS.md.printf '@AGENTS.md\n' > CLAUDE.md prints the text @AGENTS.md followed by a newline (\n), and the > redirects that output into a file called CLAUDE.md instead of the screen. If the file exists it is overwritten; if not, it is created.cat CLAUDE.md prints the file back, so you can confirm it contains exactly one line.@AGENTS.md printed in the Terminal, and CLAUDE.md appearing next to AGENTS.md in VS Code's Explorer.
When you are done, close the Playwright Chrome window from Step 2. Leave the rest of the project exactly as it is. In guide 7 we delete this throwaway project and start the real work in your workshop folder.
This is still the throwaway project, so there is nothing to catch up from the reference copy. If the Chrome automation did not work, open http://localhost:5173 yourself, click through the themes, and move on; nothing later depends on it. If your AGENTS.md got mangled while trimming, press Undo on Codex's “Edited 1 file” card to get the generated version back, or regenerate it in the same chat and trim again:
generate me an AGENTS.md
If Codex's bottom panel seems stuck and will not accept commands, the Vite server is probably still running in it. That is expected; open the Terminal app for anything else you need to run.
@AGENTS.md lets both tools share one source of rules.