AiLearn AI Coding
Learn/The Tools

OpenAI Codex Essentials

Setup, surfaces, and interview-relevant habits for OpenAI's Codex, the terminal CLI, approval modes, AGENTS.md, and Codex cloud.

10 min readUpdated 2026-08-06

Codex is OpenAI's coding agent. It comes in a few forms: a CLI that runs locally in your terminal, IDE extensions (VS Code, Cursor, Windsurf), a desktop app (codex app), and Codex cloud — the same agent running in your browser at chatgpt.com/codex.

Setup

Install the CLI on macOS or Linux:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Or via npm or Homebrew:

npm install -g @openai/codex
brew install --cask codex

Then run codex and select Sign in with ChatGPT. Codex is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans — you can also use an API key with additional setup. If you're picking a daily driver and you already pay for ChatGPT, this is the zero-cost option.

The core loop

Start codex in a project and describe a task in plain language. Codex reads the repository, proposes changes, and — subject to your approval settings — edits files and runs commands to verify.

cd your-project
codex
# > Fix the flaky auth test and run the suite

Approval modes and sandboxing

Codex lets you control how much autonomy it has — this is a genuinely useful feature for interviews, because it forces you to consciously decide what the AI may do without you.

ModeBehavior
Read-only / planThe agent investigates and proposes changes without making them.
Auto-approveIt executes every step without asking — fastest, but you review everything after.
SandboxedCommands run with restricted filesystem/network access.
Approve edits / fullYou approve file edits but let it run safe commands, or everything.

Interview transfer: in an interview you are the approval layer. If you're in the habit of letting the tool auto-approve, practice consciously deciding at each step — that's the "stay in control" skill, trained by your own tooling.

AGENTS.md

Codex reads an AGENTS.md file in the project root for persistent instructions — coding standards, commands, conventions. Many agents now share this convention (OpenCode generates one via /init, and other tools read it too), so committing a good AGENTS.md to a project is the most portable way to make any AI tool behave consistently.

Interview transfer: same as CLAUDE.md — if your open-ended practice repo ships with an AGENTS.md that lists build/test commands and conventions, the AI stays grounded in your environment.

Codex cloud

Codex cloud (chatgpt.com/codex) runs the same agent in the browser — no local setup, works on repos you don't have locally, and lets you run long tasks in parallel. For interview practice this is a decent stand-in for a structured platform: the agent has repo access but lives outside your editor.

Interview-relevant habits

Quick check · Codex CLI signs you in with your ChatGPT plan. What does that mean for cost?

Premium

Unlock the rest of this guide

Premium unlocks every pattern deep-dive, every problem breakdown and solution, the practice sandbox, and verdict feedback on your practice runs.

  • Codex CLI runs locally and signs in with your ChatGPT plan (Plus/Pro/Business/Edu/Enterprise).
  • Approval modes and sandboxing let you decide how much it can do on its own.
  • AGENTS.md is the project instruction file for Codex.
  • Codex cloud runs the same agent in the browser without local setup.
  • The full article, complete and uninterrupted
  • All pattern deep-dives and problem breakdowns
  • Practice sandbox and verdict feedback