Complete Guide to OpenAI Codex (2026)

Published Updated

Codex is OpenAI's AI coding agent. It can inspect a repository, edit files, run checks, and return a diff for review through desktop, terminal, editor, web, and cloud workflows.

That sounds simple until several tasks finish at once and the bottleneck moves from writing code to judging it. I use Codex beside Claude Code as a second agent and independent reviewer. Its value in that role depends on a clear task and enough attention to check the result.

Our best AI coding tools guide places Codex alongside Cursor, Claude Code, and the other tools we cover.

What Is OpenAI Codex?

Codex is OpenAI's coding agent across several surfaces: the ChatGPT desktop app, CLI, web, IDE access, cloud tasks, code review, and mobile access. On July 9, 2026, OpenAI folded the standalone Codex desktop app into ChatGPT desktop.

That does not turn Codex into ordinary chat. It keeps a dedicated coding experience beside Chat and Work, while the terminal and cloud options remain available for the jobs that suit them.

That distinction matters when you decide which tasks to hand off. Codex is useful when a task can be stated with enough context to run independently, then returned as output you inspect. It is less useful when the job is still a conversation with yourself.

Start with a focused task, name the relevant files and expected behaviour, and review the changes and tests before you merge.

Where Codex Fits

Codex fits work you can describe, check, and review: a known bug, a test gap, a bounded refactor, or a second opinion on a diff. Keep unsettled product decisions in an interactive conversation until the requirements are clear.

It works well beside Cursor in my workflow. Use the surface that makes the next decision easiest to inspect, and keep enough time to review every delegated task.

Choosing a Current Codex Model

Start with GPT-6.1 Sol for complex coding when your account offers it, Luna for focused repeatable tasks, or Astra for the most demanding work. OpenAI's model guide describes these choices; the model picker shows what your plan and workspace permit.

ModelUseful Starting PointAccess Check
GPT-6.1 SolComplex codingEligible paid plans and clients
GPT-6 LunaFocused repeatable tasksFree/Go desktop and paid plans
GPT-6 AstraMost demanding tasksPlan and workspace eligibility

GPT-6.1 Sol's launch includes Plus, Pro, Business, Enterprise, and Edu, with administrator enablement required for Enterprise and Edu. Earlier models may remain available. A stronger model does not change the task's permissions or remove the need to review its output.

Where You Use Codex

Use ChatGPT desktop when you want the dedicated coding workspace alongside your Chat and Work context. Use the CLI when you are already in the repository and want an interactive terminal session.

Use cloud tasks when a bounded job can run away from your machine, and use the mobile surface to steer or check an active task when you are away from the desk. The Codex desktop guide covers the app workflow; the Codex mobile guide covers what a phone can responsibly do.

Keep the work surface matched to the task. A quick codebase question may belong in the CLI, a long-running refactor may suit a cloud task, and a full review still deserves a real screen. Productivity comes from handing off work you can specify, then spending your attention on the result.

Writing Tasks Codex Can Finish

The task description does most of the steering. "Fix the login bug" leaves Codex to guess which screen is broken, what the right behaviour is, and how you will test the result.

A better handoff names the symptom, the likely files, the boundary, and the proof: show an error when the email field is empty, keep validation in the existing helper, and run the login-form test. Codex can still inspect the repository, but it starts with a finish line.

That format works for bug fixes, test gaps, repeated edits, dependency-free refactors, and research inside a codebase. It works less well for a feature whose product rules are still unsettled.

If you cannot tell a teammate what "done" means, the agent will fill the gap with assumptions. Write the decision first, or keep the session interactive until the open questions are settled.

State the forbidden moves as plainly as the desired result. Tell Codex not to add a package, edit generated files, touch a migration, or expand the task beyond the named route.

Name the command that proves the work and any check it cannot run in its sandbox. These limits make review faster because an unexpected file or skipped command is visible at once.

Cloud tasks are most useful when the work can run without your machine. Give each task its own narrow outcome and let Codex return a diff while you do something else. Running three agents does not make one vague request better; it gives you three vague results to review.

Parallel work pays off when the jobs are separate, such as one test repair, one small refactor, and one codebase question that produces a written answer.

For a first task, pick work you understand well and could finish yourself in an hour. Compare the returned diff with the route you expected, note where Codex needed more context, and use that finding in the next handoff.

This is a safer way to learn the agent than starting with auth, a database migration, or a release job where a plausible mistake carries a real cost.

Terminal, PR Review, and CI

Codex CLI brings the agent to your terminal, where it can work with the project you have open and ask for approvals according to the mode you choose. That is the right surface for a live investigation, a narrow fix, or a local review before you push.

The repository's test suite, branch protections, and human release judgment remain the shipping gates.

For pull requests, Codex can review GitHub changes and return comments for you to assess. Give it project instructions that name real risks, then treat the review as another input rather than a merge approval.

OpenAI also documents Codex workflows with GitHub Actions, which makes CI-style automation possible for bounded jobs. Keep credentials, network access, and write permissions as narrow as the job allows.

Reviewing Delegated Work

When a task finishes, start with the file list before reading the summary. A request for one form should not quietly rewrite shared auth code, add a package, or rename a public API. Then read the diff, run the named checks, and inspect any test that Codex added.

Generated tests can pass while proving the wrong behaviour, especially when the agent wrote both the code and its proof from the same mistaken assumption.

The live task log can warn you before the final diff arrives. If Codex spends time in unrelated folders or retries the same failing command, the task may be drifting.

Step in when the route is plainly wrong or the work is stuck in a loop. If the agent is making steady progress inside the stated boundary, let it finish and respond to the result; constant mid-task steering can create a second set of assumptions.

Review effort does not disappear when agents run in parallel. Three completed tasks mean three diffs, three test results, and three chances for work to overlap.

Staggering the handoff can be better than launching everything at once, because the first result may alter the base or expose a rule the later tasks need. Codex saves writing time only when you keep enough attention for that queue.

Pull-request review follows the same rule as delegated coding work. Treat a Codex comment as a claim to test. Reproduce the bug, trace the code around the diff, and ignore advice that does not fit the product or repository.

Project instructions such as AGENTS.md can tell the reviewer which risks matter here, but they do not replace the person who knows why the feature exists.

A finished task can be reviewed in four passes:

  1. Compare the changed-file list with the task boundary before reading the summary.
  2. Read the diff for altered behaviour, missing error paths, and edits unrelated to the request.
  3. Run the named checks yourself and inspect whether any generated test proves the intended result.
  4. Verify the feature in the surface where a user or operator will encounter it.

Keep the agent's task log as supporting evidence. It can show which commands ran, what failed, and where the model changed direction. It cannot prove the final state of your repository after another task lands. Run checks against the exact diff you intend to merge, especially when several agents worked from nearby commits.

Where Codex Does Not Fit

Skip cloud-connected Codex when policy requires entirely offline processing, when policy rules out a cloud-connected agent, or when the work is mostly product decisions that nobody has made yet. It also loses its advantage when you cannot state what success looks like. A vague task can return a polished-looking diff that solves the wrong problem.

In my workflow, Codex runs beside Claude Code as a second agent and independent reviewer, while Cursor cloud agents help verify auto-deployed development environments. Choose the surface that exposes enough context for the next decision.

Codex Verdict

Codex is the best fit when a coding job can be bounded, delegated, checked, and returned as a diff or pull request. Its CLI supports close local work, while cloud tasks and review let separate jobs continue away from the editor. It saves you from writing every change yourself, while leaving you responsible for checking the result.

Keep the Codex session interactive when the task is still being discovered, or use the conversational tool you prefer. Choose an AI-first editor when visual file work dominates. Skip cloud-connected Codex work when policy requires the code to stay on controlled infrastructure.

FAQ

Is Codex included in ChatGPT plans?

Codex access is included in ChatGPT plans, with availability and usage limits determined by the plan. Free and Go have limited desktop access; paid plans expand access and usage. API-key access is billed separately and does not include Codex cloud. Check current pricing and workspace settings before choosing a plan.

Which models can Codex use?

Codex model options include GPT-6.1 Sol, GPT-6 Luna, and GPT-6 Astra, with earlier models available during transitions. Your model picker shows which models your plan, client, and workspace allow.

Codex vs Claude Code, when does each fit?

Choose Codex when its ChatGPT integration, delegated tasks, and review workflow fit your work; choose Claude Code when you prefer a Claude-focused investigation and editing workflow. Claude Code also offers desktop, terminal, editor, and cloud workflows. Compare permissions, account route, review handoff, and the same bounded task before treating either product description as a decision.

Does Codex still exist as a separate app?

Codex still exists as a dedicated coding experience, but the standalone Codex desktop app was folded into the ChatGPT desktop app on July 9, 2026. In that app, Codex remains its own view alongside Chat and Work. The Codex CLI, web and supported mobile surfaces remain separate ways to reach the same product.

Can Codex run in my terminal or CI?

Yes, Codex CLI runs in your terminal with configurable approvals for local coding work. OpenAI also publishes Codex workflow examples that use GitHub Actions, so teams can incorporate it into CI-style automation. Keep permissions narrow, treat generated changes as reviewable output, and make repository tests the final gate.

Compare OpenAI Codex

Use those guides to separate client setup from the review process. The same task still needs a clear boundary, approval mode, and repository check.

Sources

  1. [1]
    Codex models
    (learn.chatgpt.com)
  2. [2]
  3. [3]
    OpenAI models
    (developers.openai.com)
  4. [4]
  5. [5]
  6. [6]
  7. [7]
  8. [8]
  9. [9]
    Codex code review in GitHub
    (developers.openai.com)
  10. [10]
    Codex plans and pricing
    (learn.chatgpt.com)
  11. [11]
  12. [12]
    ChatGPT Work and Codex
    (help.openai.com)
  13. [13]
    GPT-5.6 in ChatGPT
    (help.openai.com)