All AI guides
Comparison16 min read

Codex vs Claude Code in 2026: Which Coding Agent Should You Run?

Codex is OpenAI's coding agent, included in ChatGPT plans from Free to Enterprise, and Claude Code is Anthropic's, included in paid Claude plans from Pro at $20 a month. On 5 November 2026, Artificial Analysis rated Claude Code 62 and Codex 55, at $11.42 and $7.04 a task.

The short version

Claude Code scores higher on Artificial Analysis's coding index (62 against 55), while Codex finishes tasks in under half the time at lower cost per task. Pick Codex for a $20 budget and high task volume. Pick Claude Code when a wrong answer costs more than the run.

Want this decided for your own case? Find your tools with Smart Match, starting from this guide's question.

On 5 November 2026, Claude Code running Opus 5.5 scores 62 on Artificial Analysis's Coding Agent Index, while Codex running GPT-6 Astra scores 55, yet the Codex run costs $7.04 a task against $11.42.

Chart comparing Claude Code and Codex on score and cost per task from Artificial Analysis, read 5 November 2026 Hokai chart of Coding Agent Index score and average cost per task, from Artificial Analysis as read on 5 Nov 2026.

That pairing is the whole argument in one line: the agent that scores higher is the one that spends more. If you pay a flat monthly fee, the extra spend shows up as how fast you hit a usage limit. If you pay per token, it shows up on an invoice. Which of those hurts depends on who you are, so the questions that settle this are where you work, what you pay, which models you want, and how much you trust each one with your code.

Both agents have changed shape in 2026. OpenAI Codex now runs on the GPT-6 family and sits inside the ChatGPT apps. Claude Code runs on Anthropic's 5.5 generation and shares its limits with the Claude chat product. If you would rather have a shortlist matched to your own stack than read a comparison, Smart Match takes a few questions to do it.

What an independent test says about score, cost and speed

Artificial Analysis publishes a head-to-head of the two agents. It runs each agent on the same tasks and reports three benchmarks plus cost, time and tokens per task. The numbers below are from its Claude Code vs. Codex page, read on 5 November 2026, using the best-scoring model for each agent at maximum reasoning effort.

MetricClaude Code (Opus 5.5)Codex (GPT-6 Astra)Better
Coding Agent Index v2.06255Claude Code
Terminal-Bench 4.063%56%Claude Code
FrontierCode v1.156%49%Claude Code
Cost per task$11.42$7.04Codex
Time per task1.0 hour24.8 minutesCodex
Tokens per task14.5M3.23MCodex
Coding Agent Index, read 5 November 2026
  • Claude Code, Opus 5.562 Leader
  • Claude Code, Sonnet 5.559
  • Claude Code, Fable 5.158
  • Codex, GPT-6 Astra55
  • Codex, GPT-6.1 Sol54
  • Codex, GPT-6.1 Terra48

Artificial Analysis, maximum reasoning effort or highest tested.

Claude Code leads on all three benchmarks, and it holds three of the top three places: Opus 5.5 at 62, Sonnet 5.5 at 59 and Fable 5.1 at 58. Codex finishes the same set of tasks in under half the time and uses about a fifth of the tokens, because it took 39.4 turns per task against 146.4. That gap is the cost story, and it is also the speed story.

Is the cheaper run good enough?

The most useful row is the cheapest strong one. Codex with GPT-6.1 Sol scored 54 at $1.50 a task in 23.7 minutes. Claude Code with Opus 5.5 scored 62 at $11.42 in an hour. For eight index points you pay roughly 7.6 times as much. Whether those eight points are worth it is the real decision, and nothing on the page can make it for you.

One caveat from the same page: Artificial Analysis says its index should be read next to the per-benchmark scores, because two agents with similar totals can differ on repository work against terminal work. We did not run our own three-task test for this guide, so the scores here are Artificial Analysis's, not ours.

Scale the per-task numbers to a month to see what they mean. These are pay-per-token figures from the test, not what a subscription bills you, but they show the shape of the gap.

RunCost per taskCost for 100 tasks
Codex, GPT-6.1 Sol$1.50$150
Codex, GPT-6 Astra$7.04$704
Claude Code, Opus 5.5$11.42$1,142

A subscription flattens that bill and moves the pain to the usage limit. A team on API billing feels the difference on every invoice, so the right question is how many of your tasks are hard enough to need the top score.

Where each agent runs: terminal, IDE, desktop and cloud

The two products cover almost the same surfaces, with different emphasis. Codex leans on the ChatGPT apps. Claude Code leans on one engine shared by every surface, so a repository's CLAUDE.md files, settings and MCP servers work the same everywhere, according to Claude Code's overview docs.

SurfaceCodexClaude Code
TerminalCLI, open sourceCLI
IDEIDE extensionVS Code, JetBrains
DesktopChatGPT desktop appDesktop app
CloudCodex CloudClaude Code on the web
Chat toolsSlackSlack, Chrome extension
CICodex Security CLI in CIGitHub Actions, GitLab CI/CD

Codex's command-line tool is published on GitHub under the Apache-2.0 licence, and installs with npm install -g @openai/codex or brew install --cask codex. That matters if you want to read, fork or audit the agent that touches your files. Claude Code's licence terms were outside what we checked, so we say nothing about them.

Both vendors run a cloud version where a task keeps going after you close the laptop. In Codex Cloud, you choose repositories, Codex prepares an environment, each task gets its own workspace, and you review changes and open a pull request. In Claude Code on the web, a cloud session keeps running after you close your laptop, can be checked from a phone, and counts toward the same plan limits as everything else.

Handoff differs in one detail that decides workflows. Anthropic's docs say you can pull a cloud session into your terminal with --teleport, but you cannot push an existing terminal session to the cloud. Start long jobs in the cloud on purpose, not after the fact.

What each costs: plans, limits and the price of overflow

Read the plans with three questions in mind:

  • Does the entry plan include the agent on the surfaces you use, or only a taste of it?
  • Is the next step up a small jump or a fivefold one?
  • What happens on the day you run out: a wait, an upgrade or a metered bill?

Start with Codex. These are the plans on OpenAI's Codex pricing page, read 5 November 2026.

PlanPriceWhat Codex gets you
Free$0Luna at standard speed in the desktop app
Go$8 a monthLuna, lightweight coding tasks
Plus$20 a monthWeb, CLI, IDE, iOS, GPT-6.1 Sol and Luna
Pro$100, $200 or $500 a monthEverything in Plus, more usage
Business$20 a user a month, billed annuallyLarger cloud machines, shared workspace

OpenAI also sells Codex through an API key. That path is pay-per-token and has no cloud features such as GitHub code review or Slack. On Plus and Pro you can buy extra credits when you hit the cap.

Claude next. These come from Claude's pricing page, read the same day. Claude Code is not on the Free plan.

PlanPriceUsage
Pro$20 monthly, $17 on annual billingMore than Free
Max$100 a month5x Pro, every 5 hours and weekly
Ultra$200 a month10x Pro weekly, no 5-hour limit
Team standard$20 a seat, annualMore than Pro
Team premium$100 a seat, annual5x standard

How the usage limits actually work

Neither vendor gives a flat message count. OpenAI does publish estimates for local messages per five-hour window on Plus: 15 to 160 on GPT-6.1 Sol, 35 to 285 on GPT-6.1 Terra, 5 to 45 on GPT-6 Astra and 350 to 3,000 on Luna. It calls these estimates, not limits, and adds that cloud tasks can use more. Anthropic gives multipliers only. Its pricing page says activity across Claude on the web, desktop, mobile and Claude Code all draws from the same pool.

Three things change what you actually pay beyond the sticker price:

  • Speed modes on Codex. Fast mode uses 2.5 times the included subscription usage of Standard for the same model, and Ultrafast on Astra or Sol uses 8 times, per OpenAI's page.
  • Overflow. When you hit a limit, Codex users on Plus and Pro can buy credits. Claude users on paid plans can turn on usage credits that bill at standard API rates.
  • The seat price. Claude Enterprise lists $20 a seat plus usage at API rates, so cost scales with the models and tasks your team runs.

Claude's Max and Ultra plans also include monthly API credit: $100 on Max and $200 on Ultra, per the same page. That is a real offset if you build on the Claude API too.

Which models run underneath, and what they cost per token

You do not choose an agent in isolation. You choose a model family, and the family sets the price once you leave the subscription. Here are the headline models on each side.

ModelAgentRole per vendor docs
GPT-6 AstraCodexMost capable, hardest end-to-end work
GPT-6.1 SolCodexNear-Astra performance at lower cost
GPT-6.1 TerraCodexFast, efficient, visual and computer use
GPT-6 LunaCodexFocused, high-volume tasks
Fable 5.1Claude CodeDemanding, long-horizon agentic work
Opus 5.5Claude CodeLong-running agentic coding
Sonnet 5.5Claude CodeSpeed and intelligence together

Anthropic prices its models in dollars per million tokens on its API pricing page.

Claude modelInput per 1M tokensOutput per 1M tokens
Fable 5.1$10$50
Opus 5.5$4$20
Sonnet 5.5$2$10

OpenAI quotes Codex in credits, not dollars, on its pricing page.

Codex modelInput credits per 1MOutput credits per 1M
GPT-6 Astra2501,250
GPT-6.1 Sol50250
GPT-6.1 Terra25125
GPT-6 Luna2.512.5

Sol costs one fifth of Astra on both counts. That matches OpenAI's own line that Sol offers near-Astra performance at a lower cost, and the independent run agrees: one index point lost for a large price cut.

Credits and dollars are different units, and OpenAI's page says API token prices are separate from subscription usage, so do not convert one into the other. The comparison to carry away is relative. Inside Codex, dropping from Astra to Sol cuts the per-token price by 80%, and in the independent run it cost one index point. Inside Claude Code, the drop from Opus 5.5 to Sonnet 5.5 costs three points and halves the price per token, but the Sonnet run cost more per task ($13.30) because it used more tokens.

GPT-6.1 Sol has a default context window of 500,000 tokens in Codex, per OpenAI's models page. Anthropic's pricing page says its context window goes up to 1M, varying by model.

Where Codex is the better pick

Codex wins when throughput and price matter more than the last few points of quality. Three reasons, all from the data above.

  1. Cost per finished task. $7.04 at the top, and $1.50 on Sol, against $11.42 on Claude Code's best run.
  2. Wall-clock time. 24.8 minutes on Astra and 23.7 on Sol, against an hour. If you run many tasks in a day, time compounds.
  3. A cheap tier that still works. Terra at extra-high reasoning scored 48 for $0.69 a task, under a dollar for a mid-table score.

Speed is easy to undervalue until you watch it add up. An agent that takes an hour per task occupies a developer's attention for the whole hour, or forces context switches between check-ins. One that takes twenty-odd minutes fits into a coffee break, so you can run more experiments in a day and throw away more bad attempts without feeling the cost.

It also fits teams already inside ChatGPT. Business at $20 a user (billed annually) puts Codex beside the rest of ChatGPT, and OpenAI says it does not train on business data by default. The ChatGPT subscription you may already hold is the same login Codex uses.

Where Claude Code is the better pick

Claude Code wins when the cost of a wrong answer is higher than the cost of the run. It scored higher on all three benchmarks, and even its mid-priced model, Sonnet 5.5, scored 59, above both Codex GPT-6 Astra (55) and GPT-6.1 Sol (54).

The second reason is workflow reach. Anthropic's docs list Remote Control to continue a local session from a phone, Channels to push events from Telegram, Discord or webhooks into a session, scheduled cloud tasks, GitHub Actions and Slack. If your team lives in Anthropic's stack already, with Claude in chat and the API behind your product, one vendor and one bill is worth something.

A higher score is not a guarantee on any single task. It means that across many tasks the agent needs less rework, fewer wrong turns and fewer reviews that end in a rewrite. On a payments service, an auth layer or a data migration, one avoided mistake is worth more than the whole difference in running costs.

The third is pooled limits. Your terminal work and your chats share one allowance, which is convenient on Max or Ultra and a trap on Pro if you also chat heavily.

How the security tools compare

Both vendors sell a security scanner beside the coding agent, and both are separate products from the agent itself.

FeatureCodex sideClaude Code side
Whole-repo scanCodex Security Cloud, research previewClaude Security plugin
Local scanCodex Security plugin/security-review, single pass
While writing codeNot statedsecurity-guidance plugin
Pull requestsSecurity Review on GitHub PRsCode Review, Team and Enterprise
CI and SDKCLI and SDK packagesGitHub Actions

Codex Security scans application code and reports evidence you can use to investigate. Its cloud version needs workspace access, a GitHub connection and a compatible Codex cloud environment. Anthropic's Claude Security plugin runs a multi-agent scan where agents map the architecture, build a threat model, hunt for vulnerabilities and independently review every finding before the report, according to the plugin docs. Each scan counts toward your Claude usage. A managed Claude Security service that monitors repositories is available on the Enterprise plan.

We have not run either scanner against a shared codebase, and neither vendor publishes a head-to-head. Treat both as a first pass that finds candidates for a human, not a clean bill of health. A scanner that reports nothing has told you it found nothing, which is a weaker statement than the code being safe. Keep a person in the loop for anything that touches money, identity or customer data, and keep the scan results in your ticket system so they can be audited later.

What happens to your code and data

For individual plans, Claude's pricing page lists model training as opt-out on Free, Pro, Max and Ultra. Its Team table says no model training on your content by default. OpenAI states that Business workspaces get no training on business data by default, and that Enterprise adds data retention and residency controls.

Anthropic carries one limit worth knowing before a security review. Its docs say organisations with Zero Data Retention enabled, or the HIPAA configuration applied, cannot use cloud sessions, and organisations with customer-managed encryption keys cannot start them either. A regulated team that wants a cloud agent should confirm this with Anthropic first. We did not find a matching list for Codex Cloud, so we cannot say whether it has an equivalent restriction.

The best argument against our reading

The strongest objection to picking Claude Code is that its lead is bought with compute. It used 14.5 million tokens a task to Codex's 3.23 million, and a flat plan converts that gap into limit hits. A Pro subscriber who runs Opus 5.5 hard could finish fewer tasks a week than a Plus subscriber on Sol.

That is a fair objection, and the data supports its first half.

Our answer is that it cuts differently for different people. For a team paying by API, extra tokens are an invoice line, and a higher first-pass success rate can pay for itself in review time. For a solo developer on $20, the objection mostly holds: Codex gives you more finished tasks per week, and we expect to be wrong about that only if Anthropic raises Pro limits. Nobody has published weekly task counts for either plan, so this is our reading of the token data, not a measured result.

Who should pick which

At a glance
Pick Codex
solo developers on $20, ChatGPT-first teams, high task volume
Pick Claude Code
high-stakes repos, API-built teams, Anthropic-first stacks
Either works
terminal-first developers who switch models per task
Pass on both
regulated teams that cannot use cloud agents until legal signs off
Your situationPickWhy
Solo developer, $20 budgetCodex PlusMore tasks per limit, Sol at $1.50 a task
Team already on ChatGPT BusinessCodexSame login, no new vendor
Team building on the Claude APIClaude CodeOne vendor, Max includes $100 API credit
Hardest repo, review time costs moreClaude CodeHigher scores on all three benchmarks
Security team with a PR workflowTest bothNo head-to-head exists yet

Billing changes the answer more than team size does. A group of five developers on shared subscriptions behaves like five solo users, so what matters is whether each seat clears its own limits, not the cost of one task. A group running agents in CI, with no human watching, behaves like an API customer: there, tokens per task is the number to watch, and Codex's 3.23 million against 14.5 million is hard to argue with.

If neither fits, there are other agents. Cursor puts the agent inside an editor, and our Cursor Composer 2 vs Claude Code guide covers that pair. The best AI coding assistants roundup lists the wider field, and Claude vs Gemini compares the model families if the question is really about which lab to trust.

Less-covered agents worth a look include Muse Code from Meta, Cosine for ticket-to-pull-request work and Capy for running several agents at once. For wider browsing, the AI coding assistants directory shows every listed option, and the model leaderboard shows how the underlying models stack up on price and benchmarks.

What it costs to switch

Switching is cheap for your repository and expensive for your habits. Nothing about your files is locked in. Both CLIs install in one line.

npm install -g @openai/codex
curl -fsSL https://claude.ai/install.sh | bash

The first line installs Codex. The second installs Claude Code on macOS, Linux and WSL, and Anthropic documents a PowerShell and a WinGet route for Windows.

Your repository does not change. What you lose is the setup around the agent: Claude Code's CLAUDE.md files, settings and MCP servers, and whatever configuration you built for Codex. We did not verify whether either tool reads the other's instruction file, so keep project rules in a plain README that both can read. Trial each on one real repository for a week and compare the usage dashboards, not the marketing. A fair trial is small enough to finish and specific enough to repeat:

  1. Pick three tasks you already know the answer to: one bug fix, one refactor across several files, one batch of missing tests.
  2. Run each task on both agents from a clean branch, with the same written instructions and the same time limit.
  3. Record the minutes it took, the share of your weekly allowance it used, and how many of the changes you kept after review.
  4. Repeat the hardest task once more, because a single run says little about variance.

The agent that wins on your own three tasks, on your own code, with your own review standards, beats any chart in this guide, including ours. If the result is close, take the cheaper plan and revisit in a quarter, because both vendors have reshuffled their models and limits every few months this year.

What would flip the call

Four developments would move us off the picks above.

  • A new Artificial Analysis run where Codex's best model scores within a point or two of Claude Code's. The gap today is seven points between the best of each.
  • Anthropic publishing weekly task or message estimates for Pro, which would let us test the limits argument properly.
  • The end of OpenAI's promotion on GPT-5.6 Sol, which its pricing page says runs at least through 21 November 2026.
  • A shared security benchmark for Codex Security and Anthropic's scanner.

The next Artificial Analysis refresh is the one to watch. Until then, run both on your own repository and let the usage dashboard settle it.

Frequently asked questions

Is Codex better than Claude Code?

On Artificial Analysis's Coding Agent Index read on 5 November 2026, Claude Code with Opus 5.5 scored 62 and Codex with GPT-6 Astra scored 55. Codex was cheaper ($7.04 against $11.42 a task) and faster (24.8 minutes against an hour). Better depends on whether you pay for quality or for throughput.

How much does Codex cost compared with Claude Code?

Both start at $20 a month for the entry paid plan. Codex also sells Go at $8 and Pro at $100, $200 or $500. Claude Code is on Pro ($20), Max ($100) and Ultra ($200), and is not on the Free plan. Codex is also available through an API key at pay-per-token rates.

Which models do Codex and Claude Code use?

Codex uses OpenAI's GPT-6 family: Astra, GPT-6.1 Sol, GPT-6.1 Terra and Luna. Claude Code uses Anthropic's 5.5 lineup: Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5. Which one a session starts on depends on your plan and settings.

Do Codex and Claude Code have cloud agents?

Yes. Codex Cloud runs tasks in per-task workspaces you review before opening a pull request. Claude Code on the web runs sessions that continue after you close your laptop. Claude's handoff is one-way: you can pull a cloud session into a terminal, not push a terminal session up.

Do they scan code for security problems?

Both vendors sell scanners separate from the agent. OpenAI has Codex Security (cloud, plugin, CLI and SDK). Anthropic has the Claude Security plugin, a single-pass /security-review and Code Review for pull requests. No independent head-to-head of the two scanners was found.

Covered in this guide

  • Codex: Clones a GitHub repo into a sandbox, writes and tests code, then opens a pull request; OpenAI reported 20 million active users in August 2026.
  • Claude Code: Anthropic's agent for the terminal, IDEs, desktop, web and mobile that edits files, runs tests and opens pull requests. There is no free plan.
  • Capy: Cloud IDE from Scrapybara that runs up to 25 parallel AI coding agents in sandboxed VMs, each opening its own PR for review.
  • ChatGPT: ChatGPT is OpenAI's AI assistant, with 1.2 billion weekly users by OpenAI's count, the GPT-6 model family and plans that run from a free tier to a premium Pro tier.
  • Claude: Claude is Anthropic's AI assistant, with a free tier, Pro, Max and Ultra personal plans, and Team and Enterprise seats. Opus access starts at Pro.
  • Fable 5.1: Anthropic's second Mythos-class model, released Sept 1, 2026, for long-horizon agentic coding and research at Fable 5's per-token rates.
  • Opus 5.5: Anthropic's September 2026 flagship LLM with a 1 million token context window, built for long-running agentic coding and computer use.
  • Sonnet 5.5: Anthropic's fastest Sonnet-class model, launched in September 2026, with a 1M context and output more than 30% faster than Sonnet 5.
  • Codex Security: OpenAI's application security agent scans connected GitHub repositories, tests likely bugs in a sandbox, and drafts fixes for review as pull requests.
  • Cosine: London AI lab founded in 2022, now UK government backed, whose coding agent resolves GitHub and Jira tickets into tested pull requests unattended.
  • Cursor: Cursor is an AI code editor built on VS Code, widely adopted across large enterprise engineering teams, with Agent Mode, Tab completion, and Cloud Agents.
  • GPT-6 Astra: OpenAI's flagship model, launched September 2026 as the first ever rated at the Preparedness Framework's Critical cybersecurity level.
  • GPT-6 Luna: GPT-6 Luna (Sept 2026) is OpenAI's lowest-cost GPT-6 model, tuned for high-volume chat, extraction and classification with six adjustable reasoning-effort levels.
  • GPT-6.1 Sol: GPT-6.1 Sol is OpenAI's September 2026 mid-tier reasoning model for coding, computer use and document work, built to sit just below GPT-6 Astra.
  • GPT-6.1 Terra: GPT-6.1 Terra is OpenAI's October 2026 model for computer use, image reading and writing, built for high-volume agent work.
  • Muse Code: Meta's terminal coding agent fans work out to parallel sub-agents in isolated git worktrees, backed by a 1M-token context window.

Sources

Still deciding?

This guide covers a handful of options. Smart Match checks every listing in the directory against how you actually work and what you can spend, then hands you the shortlist and the reason behind each pick.

Find your tools

Related guides

Find your toolsAll AI guidesBrowse the AI directory