Black Friday: 30% off Pro for life · until Tue 1 DecBlack Friday 30% off Pro · until 1 Dec
For creatorsMake videos about AI coding? Earn 50% for life.Earn 50% for life.Become a Morphy creatorJoin →
morphy

Codex vs Claude Code: which is better in 2026?

Codex vs Claude Code in 2026: which is better, what each costs, usage limits, benchmark results, sandboxing, privacy, and how to use the two together.

I build Morphy, an app that runs both of these side by side, so I don't need you to pick one. That makes this easier to write honestly: both are excellent, they're better at different things, and in 2026 the two companies made it officially easy to use them together. Every fact below was checked against OpenAI's and Anthropic's own pages and the public leaderboards on November 9, 2026.

Which is better, Codex or Claude Code?

Claude Code is better at long, hard agent work. Codex is the better value. On Terminal-Bench 4.0, the main independent test of AI agents doing real work in a terminal, Claude Code with Opus 5.5 scores 64.85 against 58.18 for Codex. But Codex is on ChatGPT's free plan, costs about an eighth as much per task with GPT-6.1 Sol, is sandboxed by default, and reviews your pull requests on the $20 plan. If you code with AI every day, the best answer is often both.

What are they?

Codex is OpenAI's coding agent. It runs in your terminal (the Codex CLI, which is open source), in VS Code and its forks, JetBrains IDEs and Xcode, inside the ChatGPT desktop app since July 2026, and in the cloud, where tasks keep running without your computer. It uses OpenAI's GPT-6 models.

Claude Code is Anthropic's coding agent. It runs in your terminal, in VS Code, Cursor and JetBrains IDEs, in the Code tab of the Claude desktop app, on the web and from your phone. It uses Anthropic's Claude models.

Both read your project, run commands, edit files, use MCP servers and skills, and can split work across subagents. The differences are in the details.

How do they compare?

CodexClaude Code
Made byOpenAIAnthropic
ModelsGPT-6 Astra (most capable), GPT-6.1 Sol (close to Astra, cheaper), GPT-6.1 Terra (fast), GPT-6 Luna (fastest and cheapest)Opus 5.5 (default), Sonnet 5.5, Haiku 5.5, Fable 5.2
Cheapest plan that includes itChatGPT Free, in the desktop app (with GPT-6 Luna, as it rolls out)Claude Pro, $17 a month billed yearly or $20 monthly
Main paid plansPlus $20; Pro $100, $200 or $500 a monthPro $17–20; Max $100; Ultra $200 a month
Usage limitsPlus: 5-hour windows plus weekly limits; Pro: no 5-hour limitPro and Max: 5-hour windows plus weekly limits, shared with Claude chat; Ultra: no 5-hour limit
Runs onTerminal, IDEs, ChatGPT desktop app (Windows, Mac, Linux preview), cloud, phoneTerminal, IDEs, Claude desktop app (Windows, Mac, Linux beta), web, phone
Safety by defaultA sandbox: no network, writes only in your project; native on WindowsAuto mode: a classifier reviews each action; the command sandbox is opt-in
Project instructionsAGENTS.mdCLAUDE.md, and AGENTS.md when there's no CLAUDE.md
Pull request reviewsManaged GitHub reviews from Plus, nothing to set upA GitHub Action review workflow on Pro and up; managed reviews on Team and Enterprise (preview); /code-review locally
Open sourceThe CLI, Apache-2.0No (its sandbox runtime is Apache-2.0; the GitHub Action and Agent SDK for Python are MIT)
Trains on your work (personal plans)Yes, unless you turn it offOnly if you allow it in Claude's privacy settings

Where is Codex better?

  • It's cheaper to start. ChatGPT's free and Go ($8) plans include Codex in the desktop app, with the smaller GPT-6 Luna model as it rolls out. Claude's free plan doesn't include Claude Code at all.
  • Sandboxed by default. Out of the box, Codex can't reach the network and can only write inside your project, and it asks before stepping outside. That sandbox works natively on Windows. Claude Code's own command sandbox is off by default, and on native Windows its commands run unsandboxed.
  • Pull request reviews with nothing to set up. From ChatGPT Plus, mention @codex review on GitHub or turn on automatic reviews. Claude Pro can do automatic reviews too, through the Claude Code GitHub Action, but that's a workflow you add to your repository and it runs on your GitHub Actions minutes; Anthropic's managed review is for Team and Enterprise.
  • More room at the top. ChatGPT Pro has no 5-hour limit (weekly limits may still apply), and its $500 tier adds an Ultrafast mode for GPT-6 Astra and GPT-6.1 Sol. Ultrafast uses eight times the usage, Fast two and a half.
  • Cheaper and faster to run. On Terminal-Bench 4.0, Vals.ai measured GPT-6.1 Sol at $1.72 a task against $12.04 for Opus 5.5, though it scored about ten points lower (55.05 against 65.15). GPT-6 Astra was the quickest of the top models there, at about 36 minutes a task against 64 for Opus 5.5. Per token, GPT-6.1 Sol costs the same as Claude Sonnet 5.5 ($2 per million input tokens, $10 output), and GPT-6 Astra costs more than Opus ($10 and $50 against $4 and $20).
  • Open source. You can read, fork and build the Codex CLI yourself.

Where is Claude Code better?

  • Stronger on the benchmark that matters most right now. On Terminal-Bench 4.0's official leaderboard, which measures agents doing real work in a terminal, Claude Code with Opus 5.5 scores 64.85, against 58.18 for Codex with GPT-6 Astra or GPT-6.1 Sol, all at maximum effort. Even with the cheaper Sonnet 5.5, Claude Code scores 61.82. Vals.ai, running every model in the same harness, puts Opus 5.5 at 65.15 and GPT-6 Astra at 59.60. That lead costs more, though: see the price per task above.
  • Deeper customization. Claude Code has more than twice as many hook events as Codex (33 against 14), experimental agent teams and dynamic workflows that run dozens of subagents from one script, on top of the subagents, skills, plugins, MCP and scheduled cloud tasks that both have (Claude's routines are still a research preview).
  • Fewer prompts out of the box. In the terminal and VS Code, auto mode is now the default: a classifier approves routine actions, so long tasks run without approving every step. (Codex gets close with its sandbox plus Approve for me, and Anthropic itself recommends adding a sandbox for truly hands-off work.)
  • It's in the Claude app you may already use, next to your chats, with Projects (a beta on Pro and Max, still rolling out). Pick Opus for hard work, Sonnet for most of it and Haiku for quick jobs; Fable 5.2, the most capable, costs usage credits on Pro and is capped at half the weekly limit on Max and Ultra.

Codex vs Claude Code pricing

Both come with a chat subscription, and both count usage in windows rather than per message.

ChatGPT (for Codex)Claude (for Claude Code)
FreeCodex in the desktop app, with GPT-6 Luna (as it rolls out)No Claude Code
$8 a monthGo: the same as FreeNo plan at this price
$17–20 a monthPlus, $20: all three models, the CLI and IDE extension, cloud tasks and GitHub reviewsPro, $20 (or $17 a month, billed yearly): Claude Code in the terminal, IDEs, desktop app and web
$100–500 a monthPro, $100, $200 or $500: no 5-hour limit; Ultrafast on the $500 tierMax, $100: five times Pro's usage. Ultra, $200 (called Max 20x until late October): ten times Pro's weekly usage and no 5-hour limit. Both add monthly API credits (for the API, not for Claude Code)
TeamsBusiness: $20 a user a month billed yearly, or $25 monthlyTeam: $20 a seat a month billed yearly, or $25 monthly; premium seats with five times the usage, $100 or $125

Usage limits

  • Codex on Plus counts local messages per 5-hour window, and how many you get depends on the model: about 15 to 160 with GPT-6.1 Sol, 5 to 45 with GPT-6 Astra and 350 to 3,000 with GPT-6 Luna, with weekly limits on top. You can buy credits for more. Pro removes the 5-hour limit, though weekly limits may still apply.
  • Claude Code uses Claude's 5-hour session limits and weekly limits, shared with Claude chat. Max gives five times Pro's allowance; Ultra gives ten times Pro's weekly allowance and drops the 5-hour limit for verified accounts. See Claude Max vs Ultra.

Running several agents at once uses either plan up several times as fast. That's where having both helps: when one plan runs out, the next agent can run on the other. For more, see Codex usage limits and how to stop hitting Claude Code's usage limits.

With an API key

Both also run on a pay-as-you-go API key instead of a plan, at the per-token prices above. Codex with an API key works in the CLI and the IDE extension but loses the cloud features, like GitHub reviews. Claude Code takes an API key in the terminal and in its IDE extensions; the Claude desktop app doesn't. Both can also run on free or local models through Ollama, LM Studio or OpenRouter: here's how to set that up.

Performance: what do the benchmarks say?

Benchmarks change monthly and measure a model inside one particular agent, not your codebase. These are the independent results that include today's models:

BenchmarkClaudeOpenAI
Terminal-Bench 4.0, official leaderboard (each company's own agent, maximum effort)Claude Code with Opus 5.5: 64.85; with Sonnet 5.5: 61.82Codex with GPT-6 Astra: 58.18; with GPT-6.1 Sol: 58.18
Terminal-Bench 4.0, Vals.ai (the same agent, Mini-SWE-agent, for every model)Opus 5.5: 65.15, at $12.04 and 64 minutes a task; Sonnet 5.5: 64.14, at $10.75 and 82 minutesGPT-6 Astra: 59.60, at $9.58 and 36 minutes; GPT-6.1 Sol: 55.05, at $1.72 and 45 minutes
SWE-Bench Pro (Scale AI)Not tested yet: its newest Claude entry is Opus 4.6Not tested yet: its newest OpenAI entry is GPT-5.4

So on quality, Claude leads by about six points; on cost and speed, OpenAI's models win. If you came here looking for SWE-Bench Pro: its public leaderboard hasn't added GPT-6 or Claude 5.5 yet, so Terminal-Bench 4.0 is the best independent comparison right now. Try both on your own work before you commit to a $100 plan.

What about privacy?

On personal plans, OpenAI may train on your Codex work unless you switch it off; Anthropic only does if you allow it:

  • OpenAI: turn off Improve the model for everyone in ChatGPT's data controls, and check Include environments in Codex's own settings, which is separate. Business, Enterprise, Edu and API use isn't used for training by default.
  • Anthropic: it's your choice under Help improve our AI models in Claude's privacy settings, and it covers Claude Code too. With it on, data is kept for five years; with it off, 30 days. Team and Enterprise aren't used for training.

Can you use Codex and Claude Code together?

Yes, and it's now officially supported in both directions:

  • One instruction file. Keep your project's instructions in AGENTS.md: Codex reads it, and Claude Code reads it too when there's no CLAUDE.md (a setting makes it read both).
  • Import each other's setup. See switching below.
  • One builds, the other reviews. OpenAI's own Codex plugin for Claude Code adds /codex:review and /codex:adversarial-review inside Claude Code, so Codex checks what Claude did, and /codex:rescue, which hands a task to Codex.

Or run them side by side. In Morphy, a Claude chat and a Codex chat can work on the same project next to each other on one canvas: pick the AI from each chat's title bar and compare what they come back with. Switching a chat from one to the other takes the conversation along, so Codex can pick up where Claude stopped. When one plan hits its limit, Continue with hands the conversation to the other AI in a new chat, and Settings → Plan usage shows how much of each plan is left. Morphy's free plan runs three agents at a time; see Connect your AI to sign in to both.

Switching from Codex to Claude Code, or back

  • From Codex to Claude Code: run /import codex in Claude Code, or claude import codex in your terminal. It brings over Codex's instruction files, MCP servers, commands, subagents and skills, and --dry-run previews it first. It imports from Gemini CLI and Cursor the same way.
  • From Claude Code to Codex: run /import in Codex. It brings over your Claude Code instructions, settings, skills, hooks, subagents and MCP servers, and can bring your recent chats too.
  • Either way, keep one AGENTS.md so both read the same instructions.

Step by step, with everything that comes along (chats included): how to switch from Claude Code to Codex.

What about Gemini CLI, Antigravity and Cursor?

  • Gemini CLI isn't for consumer accounts anymore: since June 18, 2026, Google's free, AI Pro and AI Ultra users get the Antigravity CLI instead (Gemini CLI still works with paid Gemini API keys and Code Assist Standard or Enterprise). Gemini 4 Argon is in the Antigravity CLI and app on Google AI Pro and Ultra, and scores 57.58 on Vals.ai's Terminal-Bench 4.0. Google's newer Gemini 4 Carbon (October 28) scores 63.13 there, ahead of GPT-6 Astra, but so far only a small group of cyber defenders can use it.
  • Open models are close behind. Moonshot's Kimi K3.1 Pro scores 63.64 on Vals.ai's Terminal-Bench 4.0, at $4.57 a task: third, after Opus and Sonnet 5.5.
  • Every other alternative, free and open-source ones included, is in the best Claude Code alternatives. The open-source favourite, for any model: OpenCode vs Claude Code.
  • Cursor runs its own agent inside its editor. Since October 12, 2026, it's sold in the X Subscription with Grok: Plus ($8) runs Grok models only, and from Premium ($30), models from OpenAI, Anthropic and Google cost extra at API prices. See the best Cursor alternatives.
  • To run several of these at once, see the best tools to run Claude Code and Codex in parallel.

Which should you pick?

  • No budget yet: Codex, on ChatGPT's free plan.
  • On Windows, without WSL: Codex, for its native sandbox.
  • You want pull request reviews on a $20 plan with nothing to set up: Codex, on ChatGPT Plus.
  • You want the best results on long agent tasks today: Claude Code with Opus 5.5.
  • You want to shape the agent with hooks, subagents and routines: Claude Code.
  • You already pay for one of them: start there; the other is one import away.
  • You keep hitting limits: both, with one AGENTS.md, and run them side by side.

For every other tool that runs agents like these in parallel, see the full roundup. To run both side by side in one window, see Codex app vs Morphy and Claude Code desktop vs Morphy.

Questions

Is Codex made by Anthropic? No. Codex is OpenAI's coding agent, and Claude Code is Anthropic's. (OpenAI also used the name Codex for an earlier code model, in 2021.)

Which is cheaper, Codex or Claude Code? Codex. It's on ChatGPT's free plan, and in Vals.ai's test GPT-6.1 Sol did a task for $1.72 against $12.04 for Opus 5.5. Claude Code starts at Claude Pro: $20 a month, or $17 a month billed yearly.

Which has higher usage limits? They're hard to compare one to one, since both count 5-hour windows plus weekly limits. At the top end, ChatGPT Pro and Claude Ultra both drop the 5-hour limit (Ultra once your account is verified), and keep a weekly one.

Can Claude Code use OpenAI's models, or Codex use Claude? Not officially: Anthropic doesn't support pointing Claude Code at other companies' models, and Codex is built around OpenAI's. Run the two side by side instead.

References

More comparisons