Comparison
Codex vs Claude Code: Which Coding Agent to Use
Codex vs Claude Code: benchmark scores, cost per task, plans, sandboxes and privacy, from official sources. Or run both as one team in OpenBot.
The short answer
Pick Codex if you pay for ChatGPT and care what each task costs. Pick Claude Code if you pay for Claude and want the top benchmark score, and can wait for it. Both start at $20 a month, and both run on your computer or in the cloud.
Choose Codex if
- You already pay for ChatGPT.
- Cost per task matters: GPT-6.1 Sol scores 63 on the Artificial Analysis index for about $1 a task.
- The sandbox should be on from the first run, with no network.
- You'd like to read the source. The command line is Apache-2.0.
Choose Claude Code if
- You already pay for Claude.
- You want the best score on the index: 68, with Sonnet 5.5 at max effort.
- Your company buys Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry.
At a glance
Codex wins 2 of 9 topics, and Claude Code wins 1. The rest are a draw.
| Topic | Codex | Claude Code |
|---|---|---|
| Models | OpenAI models: GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol and GPT-6 Luna. | Claude models: Opus 5.5 is the default, with Sonnet, Haiku and Fable models. |
| Where agents work | On your computer, or in cloud tasks that run in virtual machines that OpenAI manages. | On your computer, or in cloud sessions that run in virtual machines that Anthropic manages. |
| Sandbox | Better: An operating-system sandbox is on by default: no network, and writes only in the workspace. | The operating-system sandbox is off by default. Turn it on with /sandbox. Not on native Windows. |
| Plans and price | Plus $20 a month, Pro $100, $200 or $500, and Business from $20 a user. Free and Go get GPT-6 Luna in the desktop app, as it rolls out. An API key also works, with no cloud features. | Pro $20 a month, or $17 billed yearly. Max $100 or $200, and Team seats $25, or $20 billed yearly. The free plan does not include Claude Code. An API key also works. |
| Parallel work | Subagents, Git worktrees for parallel chats, and many cloud tasks at the same time. | Subagents, background sessions, Git worktrees and many cloud sessions. Agent teams are experimental and off by default. |
| From your phone | The ChatGPT app for iPhone controls tasks on your Mac or Windows PC. | The Claude app for iPhone and Android follows cloud sessions and controls sessions on your computer. |
| Your data | On Plus and Pro, OpenAI can use your chats to improve its models unless you turn training off. Business, Enterprise and the API: no training by default. | Better: On Pro and Max, Anthropic trains on your chats only when you turn the setting on. Team, Enterprise and the API: no training by default. |
| Apps | A command line for macOS, Linux and Windows. Codex in the ChatGPT desktop app for macOS and Windows, with Linux in preview. Extensions for VS Code, Cursor and Windsurf. | A command line for macOS, Linux and Windows. A desktop app for macOS and Windows, with Linux in beta. Extensions for VS Code and JetBrains IDEs, and the web. |
| Source code | Better: The command line is open source under Apache-2.0. The IDE extension and the cloud are not. | Proprietary. The GitHub repository holds plugins, examples and issues, not the source. |
By the numbers
Claude Code with Sonnet 5.5 at max effort has the top score, 68. It's also the slowest and most expensive run here: $14.19 and 87 minutes a task. Codex with GPT-6.1 Sol at xhigh scores 63, the same as Sonnet 5.5 at xhigh, for $1.04 a task instead of $3.33, and in a bit more than half the time.
| Agent and model | Index scoreHigher is better | API cost per taskLower is better | Time per taskLower is better |
|---|---|---|---|
| Claude CodeSonnet 5.5 (max) | 68 | $14.19 | 87 min |
| Claude CodeOpus 5.5 (max) | 66 | $13.04 | 65 min |
| Claude CodeSonnet 5.5 (xhigh) | 63 | $3.33 | 27 min |
| CodexGPT-6.1 Sol (xhigh) | 63 | $1.04 | 16 min |
| CodexGPT-6 Astra (max) | 62 | $7.47 | 29 min |
| CodexGPT-6.1 Sol (medium) | 61 | $0.70 | 11 min |
Data from the Artificial Analysis Coding Agent Index, read on . Cost is what a task costs at pay-per-token API prices, not a plan price. Each row is one agent with one model, tested the way Artificial Analysis describes.
You don't have to pick one
OpenBot runs both on your computer, each signed in with your own plan: Codex with ChatGPT, Claude Code with Claude. Give each one a job. They pass work to each other in a shared channel, and you can follow along from your phone. Move an agent from one to the other and it keeps its role, workspace and conversation.
- ChatGPTYour ChatGPT plan, through Codex.
- ClaudeYour Claude plan, through Claude Code.
- GeminiYour Google AI Pro or Ultra plan.
- GrokYour Grok account or an xAI API key.
- CursorYour Cursor plan, or a Cursor API key.
- OpenCodeFree models, or an OpenCode Go key.
- Your own modelAny OpenAI-compatible server, also one on your computer.
Codex is OpenAI's coding agent. Claude Code is Anthropic's. They do the same job: read your code, edit files and run commands, on your computer or in their maker's cloud. Both read rules from your repo, use MCP servers, skills and hooks, and review pull requests on GitHub. The real difference is whose models you get, and which subscription you already have.
Models and the plans you pay for
Codex
Codex is built for OpenAI's models: GPT-6 Astra, GPT-6.1 Sol and GPT-6 Luna. OpenAI recommends GPT-6.1 Sol for hard coding work. Plus is $20 a month, Pro is $100, $200 or $500, and Business is $20 a seat billed yearly. Free and Go get GPT-6 Luna in the desktop app as it rolls out, but no cloud tasks. Limits reset every five hours, and weekly caps can apply. An API key works too, at API prices, but you lose cloud features like GitHub review.
Claude Code
Claude Code is built for Claude's models, with Opus 5.5 as the default on paid plans. Pro is $20 a month ($17 billed yearly), Max is $100 or $200, and Team seats are $25 ($20 yearly). The free Claude plan doesn't include Claude Code. Limits reset every five hours, and paid plans have a weekly cap that Claude and Claude Code share. It also works with an Anthropic API key, Amazon Bedrock, Google Cloud and Microsoft Foundry.
Where the work happens
Codex
BetterCodex sandboxes local work from the first run: Seatbelt on macOS, bubblewrap on Linux and a native sandbox on Windows. The network is off and writes stay in the workspace. Cloud tasks run in VMs that OpenAI manages, and they keep going while your laptop sleeps. Of the two, this is the safer default.
Claude Code
Claude Code runs on your computer by default. Its sandbox (Seatbelt on macOS, bubblewrap on Linux) stays off until you turn it on, and native Windows doesn't have one. Cloud sessions run in an isolated VM that Anthropic manages, or in your own environment. Your GitHub credentials never go into that VM.
Parallel work and teams
Codex
Codex runs subagents in parallel, and its Ultra reasoning mode leans on them. Git worktrees let you run several chats in one project, and each cloud task gets its own workspace. You can start work from GitHub, Slack and Linear. GitLab is in beta.
Claude Code
Claude Code has subagents with their own context, and background sessions through `claude agents`. Worktrees keep parallel work apart, and each cloud session runs on its own. Agent teams, where several sessions work together, are still experimental and off by default. You can start work from GitHub with @claude, or from Slack.
Data and privacy
Codex
On Plus and Pro, OpenAI can train on your chats unless you turn that off in ChatGPT's data controls, which cover Codex too. Business, Enterprise, Edu and the API aren't used for training by default. Enterprise and Edu also get retention and data-residency controls.
Claude Code
BetterOn Free, Pro and Max, Anthropic trains on your data only if you turn the setting on. With it on, data is kept for 5 years. With it off, 30 days. Team, Enterprise and the API aren't used for training unless you opt in, and Enterprise can get zero data retention. Opt-in beats opt-out, so Claude Code takes this one.
Questions
Which is better for coding, Codex or Claude Code?
On the Artificial Analysis Coding Agent Index, Claude Code with Sonnet 5.5 at max effort scores highest, 68. Codex with GPT-6.1 Sol at xhigh scores 63 for $1.04 a task, against $14.19 for that Claude run. Past the numbers, the plan you already pay for usually decides it.
Can I use Codex and Claude Code together?
Yes. In OpenBot, each one is an agent with its own job, signed in with your own ChatGPT or Claude plan. They hand work to each other in a shared channel on your computer, and you follow them from the OpenBot app on your phone.
How much do Codex and Claude Code cost?
Both start at $20 a month: ChatGPT Plus for Codex, Claude Pro for Claude Code. Claude Pro drops to $17 a month if you pay yearly. Higher limits cost $100 or $200 a month on both, and ChatGPT Pro also has a $500 tier. ChatGPT Free and Go get GPT-6 Luna in the desktop app as it rolls out. The free Claude plan doesn't include Claude Code.
Is Codex open source? Is Claude Code?
The Codex command line is, under Apache-2.0, at openai/codex on GitHub. The IDE extension and Codex Cloud aren't. Claude Code is proprietary. Its GitHub repo holds plugins, examples and issues, not the source.
Do Codex and Claude Code train on my code?
On personal plans, it comes down to one setting. ChatGPT Plus and Pro train on your chats unless you turn it off. Claude Pro and Max train only if you turn it on. On business plans and the API, neither trains on your data by default.
Can I use an API key instead of a plan?
Yes, with both. Codex takes an OpenAI API key in the command line, SDK and IDE extension, at API prices, but cloud tasks need a ChatGPT sign-in. Claude Code takes an Anthropic API key, and also runs through Amazon Bedrock, Google Cloud and Microsoft Foundry.
Sources
Every statement about Codex and Claude Code comes from the pages below, checked on . They can change after that date.
- Codex documentation
- Codex pricing
- Codex models
- Codex sandboxing
- Codex cloud environments
- Codex subagents
- Codex Git worktrees
- Codex remote
- Codex IDE extension
- Codex open source
- Codex authentication
- What's new in Codex
- Using Codex with your ChatGPT plan
- openai/codex on GitHub
- Claude Code overview
- Claude Code setup
- Claude Code model configuration
- Claude Code sandboxing
- Claude Code on the web
- Claude Code agent teams
- Claude Code worktrees
- Claude Code on mobile
- Claude Code desktop
- Claude Code data usage
- Claude pricing
- Use Claude Code with your Team or Enterprise plan
- Claude Code license
- Artificial Analysis Coding Agent Index
- Artificial Analysis coding agent methodology