One Codex, Many Surfaces
CLI, IDE, cloud, desktop, mobile, GitHub, SDK
- Name the surfaces Codex runs on and classify each as local, cloud, or remote-control
- Explain why one ChatGPT account and one model family make Codex a single product rather than separate tools
- Describe how a task is delegated from the CLI or IDE to the cloud and how diffs are applied back locally
- Explain how mobile QR pairing remote-controls a host machine while files and credentials stay put
- Choose the right surface for a given job (quick local edit, background/parallel work, PR review, CI)
- Point at the live changelog and pricing pages for facts that change (launch dates, surface support, usage window)
OpenAI Codex is not one app — it's one agent that shows up on many surfaces: a local Rust CLI, an IDE extension, the cloud at chatgpt.com/codex, a desktop app, your phone, GitHub, and the API/SDK. This lesson tours each surface, shows how one ChatGPT account ties them together so tasks delegate from local to cloud and diffs flow back, and gives you a simple rule for picking the right surface for a given job.
- 1The mental model: one Codex, many windows into it
- 2Local surfaces: CLI, IDE extension, desktop app
- 3The cloud surface: background, parallel, and PRs
- 4Mobile and the local↔cloud handoff
- 5GitHub, the API, and the Codex SDK
- 6One account, one usage window — and how to pick a surface
The mental model: one Codex, many windows into it
The single most useful idea in this lesson: there is one Codex. It is not a CLI plus a separate web app plus a separate phone app that happen to share a brand. It is one agent, backed by one model family, tied to one ChatGPT account, that you reach through different surfaces — the terminal, your editor, the cloud, a desktop app, your phone, GitHub, and the API.
Think of it like your email. Gmail in the browser, the iPhone Mail app, and a desktop client are different windows into the same mailbox — send from one, see it in another. Codex is the same: start a task in your editor, monitor it from your phone, review the resulting pull request on GitHub. The account is the thread that ties them together.
That framing pays off immediately, because it tells you what transfers across surfaces and what doesn't:
- What transfers: your
AGENTS.mdinstructions, yourconfig.toml, your MCP server connections, and your session history. Configure a project once and every surface honors the same rules. - What differs: where the agent runs (your machine vs. an OpenAI sandbox) and what's convenient (a phone is great for monitoring, a terminal is great for tight local edits).
So this lesson is really a tour of windows into one room — and a guide to which window to stand at for which job.
Key insight
One sentence to remember
One account, one model family, one agent — many surfaces. The surface decides where the work happens and what's convenient; the account decides what rules and history follow you everywhere.
Local surfaces: CLI, IDE extension, desktop app
Local surfaces run the agent on your machine, in your working directory, with your files and your tools. There are three.
1. Codex CLI — the canonical surface. An open-source terminal agent written in Rust that runs locally on macOS (Apple Silicon + Intel), Linux (x86_64 + arm64), and Windows (native sandbox or WSL2). Run codex in a project directory and you get a full-screen TUI where the agent inspects the repo, proposes changes, and pauses for approval. It reads, edits, and runs code right on your machine.
2. IDE extension — Codex inside your editor. It supports VS Code (and Insiders), the VS Code-compatible forks Cursor and Windsurf, and JetBrains IDEs (IntelliJ, PyCharm, WebStorm, Rider). The extension id is openai.chatgpt. You get a model selector, @filename references, and open files/selection as context — and crucially, the IDE can delegate work to Codex Cloud and apply the resulting diffs back locally (more on that below).
3. Desktop app — a standalone Codex app for macOS and Windows with a project sidebar, thread management, review tools, an in-app browser, and Computer Use support. Launch it from the terminal with codex app. It shows your past projects from the CLI, IDE, and cloud — shared history in action.
| Local surface | Launch | Best for |
|---|---|---|
| CLI | codex in a project dir | Tight, hands-on local edits; scripting; the full feature set |
| IDE extension | Install openai.chatgpt | Working inside your editor; delegating to cloud without leaving it |
| Desktop app | codex app | A richer GUI, visual review, Computer Use, shared project history |
All three sign in with the same ChatGPT account (or an API key) and read the same AGENTS.md and config.toml.
Tip
Start in the terminal
The CLI is where every feature lands first and where this course's commands are written. Learn it there, and the IDE and desktop surfaces will feel like the same agent wearing a nicer coat.
Watch out
Launch dates rot — check the changelog
Exact surface ship dates (the desktop app on macOS vs. Windows, Computer Use availability) change and get backfilled. Don't memorize a date; cite the live changelog at developers.openai.com/codex/changelog.
The cloud surface: background, parallel, and PRs
Codex cloud (a.k.a. Codex Web) lives inside the ChatGPT web app at chatgpt.com/codex. Instead of running on your machine, each task runs in its own isolated OpenAI sandbox container, checked out at a branch or commit of a GitHub-connected repo. Two properties make the cloud worth reaching for:
- Background + parallel. You can fire off several tasks at once and walk away; they run in their own environments while you do other things. The cloud is the surface for "go work on these three issues while I'm in a meeting."
- It opens pull requests. When a cloud task finishes, Codex creates a PR in the connected repo. You review the diff in the cloud diff view, or
git fetch/git checkoutto test locally before merging.
A few details that matter for safety and reliability:
- Internet access is OFF by default during the agent phase. Setup scripts (which install dependencies) keep it ON, then it's locked down; you can re-enable network access for the agent by domain allowlist if you need it.
- Secrets exist only during setup and are removed before the agent phase runs — so a prompt-injected agent can't read your deploy keys.
- Environments use a base image and cache state for a limited window, auto-installing npm/pip/poetry/etc. dependencies.
You can reach the cloud from many places: the web UI, the IDE's "Run in the cloud," GitHub @codex, mobile, and the CLI's codex cloud command.
# Delegate a task to the cloud from the terminal
codex cloud exec --env ENV_ID "fix the failing CI on the billing module"
codex cloud list --env ENV_ID --limit 10 # see your cloud tasksNote
Cloud = background + GitHub
If a job is long-running, parallel, or should end in a pull request, it belongs in the cloud. If you want to watch and steer every step on local files, stay on a local surface.
Mobile and the local↔cloud handoff
Mobile is the surprising one. Codex on your phone (inside the ChatGPT iOS/Android app) is not running the agent on the phone — your phone is a remote control for a Codex environment running somewhere else: your Mac, a Windows machine, or a cloud space.
How it works, and why it's safe:
- You pair the phone to a host by scanning a QR code that Codex for Mac/Windows displays.
- A secure relay layer keeps trusted machines reachable across devices without exposing them directly to the public internet.
- Files, credentials, and permissions stay on the host machine. The phone sends instructions and shows you progress and diffs; it never holds your repo or secrets.
That remote-control idea is the same trick that powers the local↔cloud handoff — the feature that makes "one Codex" tangible:
- From the IDE or CLI, choose "Run in the cloud" /
codex cloudto delegate a task. It runs in the background in an OpenAI sandbox while you keep working. - You monitor it from anywhere — the IDE, the web, or your phone.
- When it's done, bring the diff back local with
codex apply TASK_ID(aliascodex a) and review/commit it on your machine.
Local (CLI / IDE) Cloud sandbox
───────────────── ─────────────
"Run in the cloud" ──delegate──▶ agent works in background
▲ │
│ monitor from phone / web / IDE │
│ ▼
codex apply TASK_ID ◀──diff back── proposes changes / PRBecause it's all one account, the task you started in your editor is the same task you watch from your phone and the same diff you apply at your desk.
Key insight
The phone never holds your code
Mobile remote-controls a host over a secure relay. Your repository, credentials, and permissions stay on the Mac/Windows/cloud host — the phone is a window, not a copy. That's why it's safe to drive a powerful agent from a device you might lose.
GitHub, the API, and the Codex SDK
Beyond the interactive surfaces, Codex shows up in two more places that matter for teams and automation.
GitHub. Codex does automated code review and runs cloud tasks from a repo:
- Enable Code review for a repo in Codex settings (and optionally Automatic reviews to review every new PR).
- Trigger a review manually by commenting
@codex reviewon a PR — the bot reacts with 👀, then posts a standard GitHub review flagging only serious (P0/P1) issues. You can scope it:@codex review for security regressions. - Ask for fixes:
@codex fix it(or@codex fix the P1 issue) spins up a cloud task that pushes fixes to the branch. - Review priorities follow a
## Review guidelinessection in the closestAGENTS.mdto each changed file — the same instruction file your local agent reads.
The OpenAI API + Codex SDK. The Codex models are available directly via the OpenAI Responses API (the gpt-5.x-codex line), and a Codex SDK (TypeScript @openai/codex-sdk and Python openai-codex) embeds the agent into your own automations and CI. Under the hood the SDK drives the same CLI agent, exchanging structured events — so a code-review bot you build with the SDK behaves like the agent you use interactively.
| Surface | What it's for | How you reach it |
|---|---|---|
| GitHub | PR review and @codex cloud tasks | Comment @codex review / @codex fix it on a PR |
| OpenAI API | Codex models in your own app | Responses API (gpt-5.x-codex) |
| Codex SDK | Embed the agent in automations/CI | @openai/codex-sdk (TS), openai-codex (Python) |
Note that some surfaces evolve — Codex models are also offered via Azure OpenAI / Microsoft Foundry and Amazon Bedrock, and whether Slack remains a supported surface is the kind of detail that shifts. Confirm the current surface list at the docs home rather than trusting a snapshot.
Tip
AGENTS.md is the shared brain
Your AGENTS.md — including its ## Review guidelines — drives both your local agent and the GitHub reviewer. Write it once and every surface, human-facing or automated, follows the same conventions.
One account, one usage window — and how to pick a surface
Two facts cement "one Codex" and then point you to the right surface for a job.
One account ties it together. A single ChatGPT login spans the CLI, IDE, desktop app, web, mobile, and the GitHub bot. Past projects from the app, CLI, and IDE show up across surfaces; a task delegated from local runs in the cloud and its diff comes back to your machine. Sign-in is either your ChatGPT account (bundled plan usage, simplest, full-featured) or an OpenAI API key (usage-based billing, good for headless/CI — with a few plan-only features gated).
One usage window. Because it's literally one metered product, local messages and cloud tasks share the same rolling 5-hour usage window, plus additional weekly limits. Burning through cloud tasks eats into your local budget and vice versa — they draw from the same pool. (The exact per-plan numbers and the weekly caps are volatile; check the live pricing/usage pages.)
Now the practical payoff — a rule of thumb for picking a surface:
| If you want to… | Use |
|---|---|
| Make a quick, hands-on edit and watch every step | CLI |
| Work inside your editor, with code navigation | IDE extension |
| Run long or parallel jobs in the background, ending in a PR | Cloud (chatgpt.com/codex) |
| Check on or kick off work away from your desk | Mobile (remote-controls a host) |
| Review or fix a pull request | GitHub (@codex review) |
| Embed the agent in CI or your own tool | API / Codex SDK |
The surfaces aren't competitors — they're the same agent positioned for different moments in your day.
Watch out
Volatile: usage limits and surface list
The shared 5-hour window is stable, but the per-plan message counts, weekly caps, and exact list of supported surfaces (e.g., Bedrock, Slack) change. Teach the concept — one shared pool, many windows — and cite developers.openai.com/codex/pricing and /codex/changelog for the live numbers.
Try it: Move one task across three surfaces
Goal: feel "one Codex" by carrying a single task from local to cloud and back, and picking the right surface for each step.
1) Start local (CLI). In a GitHub-connected repo of yours, run codex and give it a small scoped task — e.g. "Add input validation to the signup handler and a test for it." Watch it inspect the repo and propose changes, and confirm your AGENTS.md rules are being honored.
2) Delegate to the cloud. Now send a different, longer task to the cloud so it runs in the background. From the terminal: codex cloud exec --env <ENV_ID> "refactor the email module and update its tests" (or use "Run in the cloud" from the IDE). Note that internet is off during the agent phase and the task gets its own isolated sandbox.
3) Monitor from another window. While it runs, list your cloud tasks with codex cloud list --env <ENV_ID> --limit 5 — and if you have the ChatGPT mobile app paired to a host, open it and watch the same task there. Observe that it's the same task, not a copy.
4) Bring the diff back local. When the cloud task finishes, run codex apply <TASK_ID> (alias codex a) to pull the diff onto your machine, then review and commit it with your normal git workflow. Alternatively, let the cloud open a PR and review it on GitHub with @codex review.
5) Reflect (write 3–4 sentences): Which surface felt right for which step, and why? Where did your one ChatGPT account make the handoff seamless? Then open developers.openai.com/codex/changelog and developers.openai.com/codex/pricing and note one fact you'd not hard-code into a runbook (a launch date, a surface, or a usage limit) — and which live page you'd cite instead.
Key takeaways
- 1There is one Codex: one agent, one model family, one ChatGPT account, reached through many surfaces — the surface decides where work runs and what's convenient, not which product you're using.
- 2Local surfaces run on your machine: the Rust CLI (`codex`, canonical), the IDE extension (`openai.chatgpt`), and the desktop app (`codex app`). They share your files, `AGENTS.md`, and `config.toml`.
- 3The cloud at chatgpt.com/codex runs tasks in isolated sandboxes — background, parallel, internet off by default during the agent phase — and opens GitHub pull requests.
- 4Mobile remote-controls a host (Mac/Windows/cloud) via QR pairing over a secure relay; your files and credentials stay on the host, never on the phone.
- 5CLI/IDE delegate to the cloud ("Run in the cloud" / `codex cloud`), monitor from anywhere, then apply diffs back with `codex apply`; GitHub (`@codex review`/`fix it`) and the API + Codex SDK are additional surfaces.
- 6One account means one shared 5-hour usage window across local and cloud — pick the surface by the job (quick edit → CLI, background/PR → cloud, away from desk → mobile), and cite the live changelog/pricing for volatile dates and limits.
Quiz
Lock in what you learned
Check your understanding
0 / 4 answered
1.What is the most accurate way to describe the relationship between the Codex CLI, the cloud at chatgpt.com/codex, and Codex on your phone?
2.You want Codex to work on three GitHub issues in parallel in the background while you're in meetings, with each ending in a pull request. Which surface fits best, and why?
3.When you use Codex from the ChatGPT app on your phone, where does the agent actually run and where do your files and credentials live?
4.Your teammate says, 'I burned through my Codex cloud tasks today, but my local CLI usage should be totally fresh and separate.' What's the correct correction?
Go deeper
Hand-picked sources to keep learning
Canonical list of surfaces (CLI, IDE, cloud, desktop, mobile, GitHub) and how one account ties them together.
The local Rust terminal agent — what it is, OS support, and how to start a session.
Supported editors (VS Code, Cursor, Windsurf, JetBrains), the openai.chatgpt extension, and 'Run in the cloud' delegation.
Background/parallel tasks in isolated sandboxes, GitHub connection, PR creation, and the internet-access toggle.
@codex review / @codex fix it behavior, P0/P1 focus, and Review guidelines via AGENTS.md.
Live source for desktop/mobile/Bedrock launch dates and whether surfaces like Slack are currently supported.