Yar Malik

Module 1 · Foundations

1.2 Installing & Your First Session

Installation is genuinely boring, so let's get it out of the way in one paragraph: npm install -g @openai/codex, or grab it via Homebrew or the direct download if you'd rather skip Node entirely, then run codex login. Sign in with your ChatGPT account (recommended — it picks up whatever plan you're already paying for) or an API key if you're wiring Codex into something headless like CI.

The part worth actually slowing down for is what people do in their first fifteen minutes, because almost everyone makes the same mistake: they open Codex in an empty or unfamiliar folder and type something vague like "help me build a login page." No context, no constraints, so you get a generic login page — technically correct, completely disconnected from how your actual app is structured. Then they conclude the tool is "not that smart" and go back to copy-pasting from a chat window.

Do this instead, in order: cd into a project you actually work in. Ask Codex to generate an AGENTS.md for the repo — this is Codex reading your whole project structure and writing a starter file, which we're spending the entire next lesson on because it's the single highest-leverage thing you'll set up. Then ask for something concrete and checkable, not vague: "run the test suite and tell me what's failing" beats "help me improve this code" every time, because you can immediately verify whether the answer was right.

While you're in that first session, build a few muscle-memory habits. Esc interrupts whatever Codex is doing mid-stream — useful the second you see it heading the wrong direction, don't wait politely for it to finish a bad plan. /status shows your session config and token usage at a glance. /compact summarizes a long session once context starts getting cluttered, so you're not carrying dead weight for the rest of the conversation. /diff opens a clean view of everything currently uncommitted, which you'll use constantly starting in Module 2. None of this is trivia — a technically great Codex user manages context and reviews changes the way a decent driver checks mirrors, constantly and without consciously thinking about it, while a casual user only notices either when something's already gone wrong.

Do this before moving on

ask Codex to generate an AGENTS.md in a real project and actually read every line it wrote — don't skim it. You're editing it by hand in the next lesson, and you can't fix what you haven't read.