Codex vs Claude Code: Which Coding Agent for Which Job
Codex and Claude Code are both coding agents that read your repo, edit files and run commands. Claude Code with Opus 5.5 leads the independent Terminal-Bench 4.0 leaderboard. Codex with GPT-6.1 Sol scores lower but costs far less per run and publishes clearer usage estimates. Choose Claude Code for the hardest, longest tasks; choose Codex for volume and budget; use one shared AGENTS.md if you run both.
How we compared: public information only, checked November 5, 2026. Sources are OpenAI's Codex docs and pricing, Anthropic's Claude Code docs and pricing, and the independent Terminal-Bench 4.0 leaderboard. We didn't run our own tests, so treat benchmark gaps as a guide, not a verdict on your codebase.
Codex vs Claude Code at a glance
| OpenAI Codex | Claude Code | |
|---|---|---|
| Where it runs | ChatGPT desktop app (macOS, Windows, Linux), web, CLI, IDE extension, cloud tasks | Terminal CLI, VS Code, JetBrains, desktop app, web and mobile |
| Main models | GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna | Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 |
| Terminal-Bench 4.0 (best listed run) | 58.2% (GPT-6 Astra and GPT-6.1 Sol, max) | 64.8% (Opus 5.5, max) |
| Entry price with the agent | Free ($0) and Go ($8) for light tasks; Plus $20/month | Pro $20/month ($17 billed annually) |
| API price, main model | GPT-6.1 Sol $2 in / $10 out per 1M tokens | Opus 5.5 $4 in / $20 out per 1M tokens |
| Instruction file | AGENTS.md | CLAUDE.md (reads AGENTS.md if no CLAUDE.md) |
| Open source | CLI under Apache-2.0 | Distributed by Anthropic |
Sources: OpenAI quickstart, OpenAI models, OpenAI API pricing, Claude Code overview, Anthropic models, Terminal-Bench 4.0.
What each tool is
Codex
Codex is OpenAI's coding agent. It now lives inside the ChatGPT desktop app: you pick Codex from the ChatGPT dropdown for "software development with codebase context and developer tools," while ChatGPT Work handles documents, decks and spreadsheets (OpenAI). Developers can also run it as the Codex CLI or an IDE extension, and set up reusable cloud environments for remote tasks. The CLI is open source, with more than 133,000 GitHub stars at the time of writing (GitHub).
OpenAI's own model guide frames the lineup simply: Astra "suits the most demanding workflows," GPT-6.1 Sol "offers near-Astra performance at a lower cost," Terra is fast and efficient, and Luna "suits focused, repeatable tasks" (OpenAI).
Claude Code
Claude Code is Anthropic's coding agent. Anthropic describes it as an assistant that "understands your entire codebase and can work across multiple files and tools" (Anthropic). It started in the terminal and now runs in VS Code, JetBrains, a desktop app and the browser at claude.ai/code. It works directly with git: staging changes, writing commit messages and opening pull requests.
On the model side, Anthropic suggests starting with Claude Opus 5.5 for most work and moving to Claude Fable 5.1 "for demanding reasoning and long-horizon agentic work." All current models list a 1M-token context window (Anthropic).
Benchmarks: what the public numbers say
The most useful public comparison is Terminal-Bench 4.0, because it runs each model inside its own vendor's agent. That means it compares Codex the tool against Claude Code the tool, not just the models. The leaderboard reports the share of 66 tasks each configuration resolves (Snorkel AI / Terminal-Bench).
| Rank | Model and effort | Agent | Resolution rate | Total run cost |
|---|---|---|---|---|
| 1 | Opus 5.5, max | Claude Code | 64.8% ±3.1 | $4.7k |
| 2 | Sonnet 5.5, max | Claude Code | 61.8% ±2.9 | $7.3k |
| 3 | GPT-6 Astra, max | Codex | 58.2% ±2.8 | $3.3k |
| 4 | GPT-6.1 Sol, max | Codex | 58.2% ±3.1 | $0.6k |
| 5 | Fable 5.1, max | Claude Code | 57.9% ±3.8 | $6.2k |
Three things stand out:
- Claude Code leads on raw success. Opus 5.5 is about 6.6 points ahead of the best Codex runs, well outside the stated margins.
- Codex is far cheaper per run. GPT-6.1 Sol matched GPT-6 Astra's score at roughly a fifth of the cost, and its run cost about an eighth of the Opus 5.5 run.
- Max effort isn't the default. Every row above is at max effort. Your everyday sessions likely run at a lower setting, where scores and costs both drop.
Benchmarks are a starting point. A 66-task terminal benchmark won't tell you how either agent handles your monorepo, your test suite or your team's conventions. If the choice matters, give both the same five real tickets.
Pricing and usage limits
Both tools come bundled with their maker's subscription. Prices below are from each vendor's pricing page on November 5, 2026.
| Tier | Codex (ChatGPT plans) | Claude Code (Claude plans) |
|---|---|---|
| Free | $0, quick coding tasks | Not included |
| Low | Go $8/month, lightweight tasks | — |
| Standard | Plus $20/month | Pro $20/month, or $17/month billed annually |
| Heavy | Pro $100, $200 or $500/month | Max $100/month (5x Pro usage); Ultra $200/month (10x Pro weekly usage) |
| Team | Business $20/user/month annual, $25 monthly | Team standard seat $20 annual, $25 monthly; premium seat $100/$125 |
The bigger difference is how limits are explained. OpenAI publishes ranges per model: on Plus, it estimates 15 to 160 local GPT-6.1 Sol messages per five hours, with weekly limits possible on top (OpenAI). Anthropic describes limits as multiples of Pro ("5x Pro usage") and notes that "how fast you reach a limit depends on the model you use, how long your chats are, and how large your files are" (Anthropic). Neither is a guarantee. If you're budgeting for a team, run a week of real work and read each usage dashboard.
On the API, GPT-6.1 Sol lists at $2 per million input tokens and $10 per million output tokens (OpenAI). Claude Opus 5.5 lists at $4 and $20, and Sonnet 5.5 at $2 and $10 (Anthropic).
Instructions: AGENTS.md vs CLAUDE.md
Both agents read a markdown file of standing instructions at the start of a session, which is where most of the day-to-day quality comes from.
- Codex reads
AGENTS.md"before doing any work," layering a global file from your Codex home folder with project files from the repo root down to your working directory. It stops adding files at 32 KiB combined by default (OpenAI). - Claude Code reads
CLAUDE.mdfiles at project, user or organization level, and keeps its own auto memory of your corrections. It can also read a repo'sAGENTS.md: by default only when no CLAUDE.md exists in the working directory or above it (Anthropic).
Anthropic adds a caveat worth copying into any team guide: Claude "treats them as context, not enforced configuration." To block an action no matter what, use a hook instead (Anthropic). The same logic applies to Codex, where the sandbox and approval policy, not the instruction file, decide what the agent is allowed to do.
If you keep re-typing the same corrections into either tool, that's Prompt Debt. Writing it down once is the idea behind the Brief-Once Workflow.
Permissions and safety
The two tools take different routes to the same goal.
- Codex uses an OS-enforced sandbox plus an approval policy. By default the agent runs with network access off, writes are limited to the active workspace, and it asks before editing outside the workspace or reaching the network. Read-only mode is one
/permissionscommand away (OpenAI). - Claude Code uses per-tool permissions. File reads in the working directory don't need approval; shell commands, file edits and web fetches do, apart from built-in safe sets. An auto mode lets a classifier review actions instead of you (Anthropic).
In practice: Codex's default is "contained, then ask," Claude Code's is "ask per action, then remember." Teams with strict security reviews often find Codex's sandbox easier to explain, while individual developers often prefer Claude Code's granular "don't ask again" rules.
Subagents, hooks, skills and MCP
Feature lists have converged. Both tools support MCP connections to outside systems and reusable skills. Differences show up in the details:
- Subagents. Claude Code subagents run "in its own context window with a custom system prompt, specific tool access, and independent permissions" (Anthropic). Codex supports subagents too, and its Ultra mode uses them to split larger tasks (OpenAI).
- Hooks. Claude Code hooks are shell commands, HTTP endpoints, MCP tool calls, prompts or subagents that fire at set points in a session, everywhere Claude Code runs (Anthropic). They're the main way to enforce rules rather than suggest them.
- Cloud work. Claude Code on the web runs long tasks on repos you don't have locally (Anthropic); Codex cloud environments do the same from the web, mobile or the desktop app (OpenAI).
For a primer on how skills differ from connectors and projects, see Claude Projects vs Skills vs Connectors and What Are Agent Skills?
Which coding agent for which job
| Job | Lean toward | Why |
|---|---|---|
| Hard, multi-step refactors and debugging | Claude Code (Opus 5.5) | Highest public Terminal-Bench 4.0 score |
| High-volume routine fixes, reviews, tests | Codex (GPT-6.1 Sol) | Similar to Astra's score at a fraction of the cost |
| Teams that need a clear usage budget | Codex | Per-model message estimates are published |
| Enforcing rules automatically | Claude Code | Hooks fire on every surface |
| Security-sensitive local work | Codex | OS sandbox, network off by default |
| Already paying for ChatGPT, not Claude (or the reverse) | The one you have | Both start around $20 and the gap narrows at normal effort |
If you're not a developer and mainly want an agent for files and documents, this isn't the right comparison. Our Cowork vs Codex guide covers that choice.
Running both without double work
Plenty of teams end up with both tools. The cost of that is usually not the subscriptions. It's maintaining two sets of instructions that drift apart. Three habits keep it manageable:
- One instruction file. Keep the rules in
AGENTS.md. Either let Claude Code read it directly (no CLAUDE.md) or add a short CLAUDE.md that imports it and holds only Claude-specific notes. - Same tickets, both agents, once. Before standardizing, run a week of real tasks through each and compare review time, not just pass rates.
- Put judgment where both can reach it. Rules files cover conventions. The harder part, like what a senior reviewer would reject, belongs in something both agents can call over MCP. That's the role of a Callstand, and the idea behind the Judgment Layer.
Frequently asked questions
Is Codex or Claude Code better?
Neither wins everywhere. On the Terminal-Bench 4.0 leaderboard, Claude Code with Opus 5.5 at max effort resolves 64.8% of tasks against 58.2% for Codex with GPT-6.1 Sol, but the Codex run cost about $0.6k in total against $4.7k (Terminal-Bench 4.0). Pick Claude Code when the hardest tasks matter most, and Codex when cost per task and published usage limits matter more.
Is Codex free?
Codex has a Free plan at $0 and a Go plan at $8 a month, which OpenAI describes as being for quick or lightweight coding tasks (OpenAI). Claude Code isn't on Anthropic's Free plan; it starts with Pro (Anthropic).
How much do Codex and Claude Code cost?
Both start at about $20 a month. ChatGPT Plus is $20 and Claude Pro is $20 monthly or $17 a month billed annually. Heavier tiers are Pro from $100 on the OpenAI side ($100, $200 or $500), and Max at $100 and Ultra at $200 on the Anthropic side (OpenAI, Anthropic).
Can Claude Code read AGENTS.md?
Yes, with a condition. Anthropic's docs say Claude reads AGENTS.md by default only when there's no CLAUDE.md in your working directory or above it, and you can change that setting or import AGENTS.md from a CLAUDE.md (Claude Code memory docs). That makes one shared instruction file workable for teams using both tools.
Which one is open source?
The Codex CLI is open source under the Apache-2.0 license on GitHub (openai/codex). Claude Code is distributed by Anthropic through its own installers and package managers; check its repository license before assuming you can fork it.
Can I use both?
Yes, and many teams do. A common split is Codex for cheaper, high-volume work like reviews and routine fixes, and Claude Code for the hardest refactors. Keep your rules in a shared AGENTS.md so both follow the same standards.
Did you test these tools yourselves?
No. This comparison uses public information only: each vendor's documentation and pricing pages, plus the independent Terminal-Bench 4.0 leaderboard. Benchmarks measure specific task sets, so run both on a slice of your own work before you commit a team.