learn-codex-with-phoebe / Session 2 of 6
Learn Codex with Phoebe · Session 2 of 6

First build: from plan to homepage

Today SITE_PLAN.md stops being a plan and becomes a working homepage in your browser. Along the way you learn the loop you'll run for the rest of this course - plan, build, run, review - until it's muscle memory.

🟢 Easy Builders 45 min live + self-study
0-3 · Welcome 3-16 · Concepts 16-40 · Build & iterate 40-45 · Q&A
Part 0

From plan to pixels

Last session you and Codex wrote SITE_PLAN.md together. Today that file earns its keep: by the end of this session there is a real index.html open in your browser, styled the way you described, and you'll have iterated on it three times based on what you SAW, not what you guessed. The build loop you run today is the same loop you'll run in every session after - and eventually on every project you touch.

Live - presented in session Self-study - read after class ★ Build-along demo The project: YOUR website
★ What you walk out with today A working homepage built from your own plan, an AGENTS.md v1 that teaches Codex your project's rules, a permissions setup you actually understand, and the plan → build → run → review loop starting to feel automatic.
Part 1 · covers "codex 101" + the working-method docs

The build loop 5 min live

Working with Codex isn't one big prompt and a prayer. It's a small loop, run many times: plan the next slice, let Codex build it, run the result yourself, review what you see, feed that back in. Small laps, compounding fast.

1 · Plan pick ONE small slice to build next 2 · Build GCOB prompt → Codex writes code 3 · Run open it in a real browser, look 4 · Review name what's off, feed it back repeat until proud Each lap is minutes, not hours. Ten small laps beat one giant prompt every single time.
🔍 Click to zoom - the build loop: small laps, run many times
LiveReview is where YOU add the value3 min

Codex handles plan and build well on its own. The run and review steps are yours, and they're the difference between people who ship with agents and people who churn with them:

  • Always run it yourself. Codex can verify code executes; only you can verify it looks and feels right. Open the page. Resize the window. Click the links.
  • Ask before you approve. When Codex proposes a change you don't follow, ask "explain what this change does and why" BEFORE saying yes. You're not slowing it down - you're training yourself.
  • Review the diff, not the vibes. After each change, Codex shows what it touched. Skim it. Even a beginner's skim catches "wait, why did it edit that file?"
Real world

The two-browser habit: experienced Codex users keep the terminal and the browser side by side and hit refresh after every lap. The feedback loop drops from minutes to seconds - and the shorter the loop, the braver your experiments get.

LiveIterating like a pro: name the fix, don't re-roll3 min

When the first result isn't right (it often isn't - that's the loop working, not failing), you have two moves. One of them wastes your credits and your evening:

When the first result misses: name the fix, don't re-roll ✗ THE RE-ROLL: VAGUE Hmm, not really what I wanted. Try again, make it better. Throws away everything that worked ✓ THE NAMED FIX: SPECIFIC 1) Headline: cap 32px on mobile 2) More space, intro to sections 3) Accent color to deep teal A named fix keeps the 90% that already worked; a re-roll throws all of it away.
🔍 Click to zoom - name the fix, don't re-roll
The re-roll - vague, starts overHmm, not really what I wanted. Try again, make it better.
★ The named fix - specific, builds forwardClose. Three changes: 1) the headline is too big on mobile - cap it around 32px on small screens. 2) more space between the intro and the section list, it feels cramped. 3) change the accent color to a deep teal instead of blue. Keep everything else exactly as is.

The fluent move is naming the fix, not re-rolling. "Try again" throws away everything that was already right; a named fix keeps the 90% that worked and repairs the 10% that didn't. Point at what you see: colors, spacing, sizes, words.

Can't name what's wrong? Say that: "something feels off about the header - give me three different treatments and I'll pick." Codex generating options is cheaper than you pretending to know.
Self-studyHow big should one lap be?2 min read
  • One lap = one thing you can check. "Homepage skeleton" is a lap. "The whole site with all three sections, polished" is five laps pretending to be one.
  • If the review step takes longer than the build step, your lap was too big - you can't hold that much change in your head at once.
  • Commit the wins. Once a lap looks good, ask Codex to note what state you're in ("summarize what we built and what's next in a NOTES.md"). Session 5 upgrades this habit to real git commits.
Part 2 · covers the personalization docs, basics

AGENTS.md, first version 5 min live

Anything you find yourself repeating to Codex belongs in a file it reads automatically at the start of every conversation. That file is AGENTS.md, and /init writes the first draft for you.

Live/init and what belongs in v13 min · then Demo 1

Run /init in your project folder and Codex inspects what's there, then generates an AGENTS.md describing the project - purpose, structure, conventions it can detect. That draft is a starting point; the value comes from what YOU add. For the site project, v1 needs exactly four things:

  • Project purpose: what this site is and who it's for - so every suggestion fits the mission.
  • The plain-code boundary: no frameworks, no build step - stated once here instead of in every prompt.
  • Design taste: the adjectives from your SITE_PLAN.md, so "make it look good" means YOUR good.
  • File layout rules: which files exist and where new things go - stops the folder sprawling.
★ Example AGENTS.md for my-site (v1)# My personal site ## What this is A personal website with three sections: about, product showcase, and ideas. Built to be read, maintained, and understood by me. ## Hard rules - Plain HTML, CSS, and JavaScript only. No frameworks, no build step. - Keep code readable for a beginner - clear names, brief comments where something is non-obvious. ## Design taste - Editorial, minimal: generous whitespace, one accent color, strong typography. Never template-y. ## Files - index.html (homepage), style.css (all styles), script.js (all behavior). New pages go in the project root. ## Working style - After any change, show me a short summary of the diff: what changed, in which files, and why.
LiveAGENTS.md rule or one-off prompt? The sorting test2 min
It's an AGENTS.md rule if...It's a one-off prompt if...
It's true every session ("no frameworks")It's about today's task ("build the homepage")
You've now typed it twiceYou'll probably never say it again
It describes taste or standardsIt describes a specific change
Forgetting it causes reworkForgetting it costs nothing
The twice rule The second time you type the same instruction to Codex, stop - move it into AGENTS.md instead. Your future sessions inherit it for free.
Self-studyThere's a hierarchy (preview of Session 3)2 min read

The AGENTS.md you made today lives at your repo root and governs this project. Two more levels exist:

  • Global: ~/.codex/AGENTS.md - preferences that follow you across EVERY project (your name, your universal habits).
  • Repo root: what you built today - this project's rules.
  • Subdirectory: an AGENTS.md inside a subfolder applies only there - useful when one part of a project plays by different rules.

More specific wins where they overlap. Session 3 goes to full depth, including what belongs at each level and how skills fit next to it.

Part 3 · covers the permissions docs, full depth

Permissions, full depth 4 min live

Session 1 introduced the safety dial. Now that Codex is about to write real files for you, let's understand every notch on it - and when to turn it.

LiveThe three levels and the sandbox4 min
Which permission level for which job Just exploring, not editing? Edits skip per-change asks? READ-ONLY nothing gets touched AUTO-EDIT IN FOLDER auto-edits, cmds still ask APPROVAL LEVELS starts strict, eases up yes no yes no Promote as trust builds: start cautious, then raise the level so the loop runs faster.
🔍 Click to zoom - promote permissions as trust builds, don't demand it up front
LevelWhat Codex may doRight for
Read-onlyLook at files, explain, plan - touch nothingExploring an unfamiliar project, pure Q&A
Auto-edit in folderCreate and edit files inside the project folder without asking each time; commands still need approvalActive building - today's default for my-site
Command approval levelsRun commands, from ask-every-time up to broader trust for commands you've whitelistedOnce you recognize the commands it keeps asking about
  • The sandbox boundary is the real safety net: whatever the level, Codex works inside your project folder. Anything beyond it - other folders, the network, system changes - triggers an explicit ask. Your my-site folder is a walled garden.
  • Promote as trust builds: start a project cautious, notice which approvals you always grant, then raise the level so the loop runs faster. /permissions changes it any time, per project.
  • Check where you stand with /status - it shows the current model, permission level, and folder in one glance.
Real world

The pattern nearly everyone follows: week one, they read every diff and approve every command. Week three, file edits are auto-approved and they only gate commands. The dial exists precisely so trust can be earned in stages instead of demanded up front.

Demo 1 of 3

/init your project ★ 5 min · everyone runs it

In your my-site folder, run codex (or codex resume to continue last session's conversation), then run /init.

Read the generated AGENTS.md top to bottom. Notice what Codex figured out on its own from SITE_PLAN.md and the folder contents.

Add two personal rules it couldn't have guessed - your design taste line and your working-style preference (like the diff summary rule from the Part 2 example). Just tell Codex: "Add these two rules to AGENTS.md: ..."

Sanity check: ask "What rules are you following from AGENTS.md right now?" - hearing it recite your rules back makes the file feel real.

Demo 2 of 3 · the main event

Build the homepage from SITE_PLAN.md ★ 12 min · everyone builds

Fire the build prompt - GCOB, with your plan as the context:

★ The homepage build promptGoal: a working homepage for my personal site that matches SITE_PLAN.md - header with my name, a short intro, and a clear entry point for each planned section. Context: SITE_PLAN.md in this folder is the source of truth. Follow the design taste in AGENTS.md. Output: index.html and style.css in this folder, plus instructions for how to view the page in my browser. Boundaries: no frameworks, keep the code readable for a beginner, nothing goes online yet.

Follow its viewing instructions - usually just opening index.html in your browser. Look at YOUR homepage. Take a breath. That was your plan an hour ago.

Iteration lap 1 - color: pick a real accent color you love and name the fix: "change the accent color to [your color], everywhere it appears."

Iteration lap 2 - spacing: find the one place that feels cramped or too airy and say exactly where: "more breathing room between the intro and the section links."

Iteration lap 3 - words: rewrite the headline in your own voice and hand it over: "replace the headline with exactly this: ..." Refresh after each lap. Three laps, three visible improvements.

★ The moment that matters It's not the first render - it's lap 2 or 3, when you realize you're steering by sight and the page is converging on YOUR taste. That's the build loop clicking into place.
Demo 3 of 3

Break it on purpose ★ 5 min · follow along

Open index.html in any text editor and delete one closing tag - a </div> or </section>. Save. Refresh the browser: layout chaos.

Don't tell Codex what you did. Just describe the symptom like a normal person would: "The page suddenly looks broken - everything below the intro is squashed together."

Watch it diagnose: it re-reads the file, finds the unclosed tag, explains what happened, and fixes it. Refresh - healed.

Debrief: you didn't need to know what a closing tag was to get it fixed. Describing SYMPTOMS honestly is a real skill - and it's enough.

Why we sabotage our own site Because next week something will break by accident, and you'll already know the move: describe what you see, let Codex hunt. Fear of breaking things is the #1 thing that slows beginners down - so we break things on day two, on purpose, and watch them get fixed.
After the session

This week ◐ 30 min total

Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · The build loop runs plan → build → run → review. Why does review get its own step?

Codex can check that code runs; it can't check that it matches your taste. Run it yourself, name what's off, feed it back - that's the loop working.

2 · "No frameworks, plain HTML/CSS/JS only" - where should that instruction live?

Standing rules go in AGENTS.md so every future conversation inherits them for free. One-off prompts are for today's task. Apply the twice rule.

3 · The homepage came back almost right but the header is too cramped. Best next prompt?

Name the fix, don't re-roll. A specific correction keeps the 90% that worked; "try again" throws it all away and gambles on a new draw.

Source material

Official sources covered

This session teaches the working content of OpenAI's official materials - docs at learn.chatgpt.com and free courses at OpenAI Academy.

Codex 101 (OpenAI Academy)the working loop, iterating, reviewing changes - Part 1 + Demos 2-3
Personalization / AGENTS.md (official docs)/init and repo-level basics here; full hierarchy and depth in Session 3
Permissions (official docs)all levels, sandbox boundary, promote-as-trust-builds - Part 3, completes Session 1's preview

Session 2 cheat sheet · pin this

The build loopPlan → build → run → review, in small laps. One lap = one thing you can check. Repeat until proud.
Iteration habitName the fix ("change X to Y, keep the rest") - never re-roll with "try again".
/initGenerates AGENTS.md from your project. Then add what it can't guess: taste, boundaries, working style.
AGENTS.md v1Purpose · plain-code boundary · design taste · file layout · "show diff summary". Twice rule: typed it twice? Move it in.
PermissionsRead-only → auto-edit in folder → command approval. Sandbox = your project folder. Promote as trust builds via /permissions.
When it breaksDescribe the symptom you see, let Codex hunt the cause. You proved this works - you broke it yourself.