Strategy & GuidesFIELD NOTE · 15 MIN

Codex vs Claude Code, We Run Both Daily

Codex CLI and Claude Code compared on benchmarks, real cost per task, context, config files and safety. The routing rules we use to send each task to the right agent.

AITerm 15 min read

Codex CLI is OpenAI's terminal coding agent, Claude Code is Anthropic's. As of August 2026, GPT-5.3-Codex leads Terminal-Bench 2.0 at 77.3% (OpenAI, February 2026) while Claude Opus 5 leads Terminal-Bench 2.1 at 89.1%. Different benchmark versions, so not a head-to-head. We run both.

Updated August 5, 2026 · by the AITerm team

77.3%

GPT-5.3-Codex on Terminal-Bench 2.0, the score OpenAI announced in February 2026

89.1%

Claude Opus 5 on Terminal-Bench 2.1. Same family of tasks, different version, not a fair duel

$13

average Claude Code spend per developer per active day across enterprise deployments (Anthropic docs, 2026)

Key takeaways

  • The benchmark numbers everyone quotes are from different benchmark versions. Stop using them to pick.
  • Codex is cheaper per task and steadier on scoped work. Claude Code is better across many files.
  • AGENTS.md and CLAUDE.md are two files. Keep one canonical, point the other at it.
  • Codex separates sandbox mode from approval policy. That is the cleanest unattended-run model today.
  • Running both costs you nothing but a second worktree. Never point them at the same one.
Codex CLI Claude Code
MakerOpenAIAnthropic
Built inRust, single binaryNode, npm or native installer
Default modelGPT-5.3-CodexSonnet 5, Opus 5 on Max
Project memoryAGENTS.mdCLAUDE.md
ExtensibilityMCP, apply_patch, profilesSkills, subagents, hooks, MCP
Entry priceChatGPT Go, $8/moClaude Pro, $20/mo
MeteringToken-based since Apr 2, 20265-hour window plus weekly cap

The short version, before the details

Codex is the cheaper, steadier agent for work you can scope in one paragraph. Claude Code is the one you want when a change touches nine files and you cannot fully describe it up front. That is the whole verdict, and everything below is the evidence.

We got here the boring way. Both agents have been installed on this machine since the spring, running against the same Swift repository, and the routing rules at the end of this article are the ones we actually type. Not a lab study, a working setup with receipts.

You're probably thinking this is a sales pitch for our terminal. Fair. Everything in the comparison sections works in any terminal, including the one you have open right now. We say where our product enters the picture, once, near the end.

What are Codex and Claude Code, exactly?

Both are terminal agents. You run a command inside a project folder, describe the task in English, and the agent reads files, runs your build, proposes a diff and waits for approval before writing. Same loop, two houses.

Codex CLI is OpenAI's first-party terminal agent, written in Rust and shipped as a fast single binary. It reads AGENTS.md for project conventions, talks to MCP servers, and applies edits through an apply_patch primitive rather than free-form file writes.

Claude Code is Anthropic's, and it grew in a different direction. Its extension surface is wider: skills that load on demand, subagents with their own context windows, and hooks that run shell commands at lifecycle events. Anthropic's skills documentation now points at agentskills.io, an open standard meant to work across tools, which tells you where that ecosystem is heading.

# both, side by side, on the same Mac
npm install -g @openai/codex        # or brew install codex
curl -fsSL https://claude.ai/install.sh | bash

cd ~/code/my-project
codex                                # OpenAI agent
claude                               # Anthropic agent

Here's the thing. The install step is the least interesting difference between them, and it is what most comparison posts spend their first 800 words on.

People searching for codex vs claude code vs gemini cli usually want the same answer, so here it is: Gemini CLI is the third terminal agent worth having installed, and it plays the same role Codex does in our routing, cheap and fast on scoped work. It is not in the comparison below because we have not run it on this repo long enough to have numbers, and we would rather say that than pad the table.

The benchmark numbers are not comparable

Every published score you will see quoted in this debate comes from a different benchmark, a different version of a benchmark, or a different model generation. OpenAI announced GPT-5.3-Codex on 5 February 2026 with 77.3% on Terminal-Bench 2.0, 64.7% on OSWorld-Verified and 56.8% on SWE-Bench Pro. Claude Opus 5 landed on 24 July 2026 and appears on the Terminal-Bench 2.1 leaderboard at 89.1%.

Those two numbers are not a duel. They are two runners timed on two different tracks, five months apart, and putting them in the same bar chart is how half the internet decided this question.

Our opinion. Benchmark scores are the worst possible input for this decision. They are measured on curated task sets by the vendor shipping the model, they move every six weeks, and none of them test the thing that actually decides your week: how the agent behaves in your repository, with your half-finished branch and your undocumented build step. Install both, run your ugliest open ticket through each, and trust that over any leaderboard.

The one measurement worth taking seriously is cost per unit of work, because it is the one you can reproduce yourself. In a controlled head-to-head published in 2026, the same task cost roughly 192,000 tokens and about $2.50 through Claude Code, against 136,000 tokens and about $2.04 through Codex. A 1.4x token gap, a 23% cost gap.

TOKENS ON THE SAME CONTROLLED TASK Codex CLI 136k tokens · $2.04 Claude Code 192k tokens · $2.50 Source: controlled head-to-head, 2026. Single task, tool-heavy. Your gap will differ.
One task, not a suite. The gap nearly closes on a self-contained refactor with no tool calls.

That gap has a cause, and it is not model quality. Claude Code's default loop checks its tools, plans, then writes. Codex scopes tighter and goes straight at the file.

On tool-heavy work with several MCP servers connected, the first loop costs real money. On a contained refactor, the difference nearly vanishes.

How much does each one actually cost?

Codex is cheaper to start and Claude Code is cheaper to predict. Codex rides inside ChatGPT plans, starting at Go for $8 a month, and since 2 April 2026 it meters token usage instead of counting messages. Claude Code sells through Claude subscriptions with rolling windows instead.

Tier Codex, via ChatGPT Claude Code, via Claude
Cheapest paidGo, $8/moPro, $20/mo ($17 annual)
Daily driverPlus, $20/moMax 5x, $100/mo
Heavy usePro, $100 to $200/moMax 20x, $200/mo
Team seatBusiness, $25/userTeam, from ~$20 to $25
What stops youToken budget on the plan5-hour window, then weekly cap

The number that reframed this for us is in Anthropic's own cost documentation: across enterprise deployments the average is about $13 per developer per active day, or $150 to $250 a month, with 90% of users staying under $30 per active day. Read that next to a $200 subscription and the pricing debate stops being about the sticker.

Honestly, we spent a month optimising the wrong variable here. We chased the cheaper tier while the actual cost was a senior engineer reviewing agent output at 6pm. Turns out the plan is the small line in that budget.

Where each agent runs out of context

Context is the resource that ends your session, not tokens. GPT-5.3-Codex ships a 200,000 token window, and Codex CLI kicks off automatic compaction roughly 13,000 tokens before the ceiling. Anthropic's model configuration docs state Sonnet 5 has a native 1 million token window, with an opus[1m] alias for the long-session case.

Bigger is not automatically better. A compacted session is a summarised session, and summaries lose the detail that made the agent right about your codebase forty turns ago. In practice we clear far more often than either tool forces us to.

Claude Code has one structural advantage here and it is underrated: subagents. Anthropic documents them as separate context windows that do the noisy work, a codebase search or a log trawl, and hand back only the summary. The built-in Explore and Plan agents even skip loading your CLAUDE.md so research stays cheap.

# Claude Code, before a long task
/context          # how full is the window right now
/clear            # cheaper and more accurate than compacting
/model opusplan   # Opus to plan, Sonnet to execute

# Codex CLI, same reflex
/compact          # explicit, before it happens to you
/new              # fresh session, AGENTS.md reloaded

So, the honest framing: Codex hits its ceiling sooner and tells you clearly. Claude Code has more rope, and gives you the tools to avoid needing it. Both punish the same mistake, which is running a fourth unrelated task in a session opened three hours ago.

AGENTS.md and CLAUDE.md are not the same file

Each agent reads its own project memory file at session start, and neither reads the other's. Codex loads AGENTS.md, Claude Code loads CLAUDE.md from the repo root or .claude/. The content overlaps by maybe 80%, which is exactly what makes this trap work.

Our first attempt was two full files, maintained in parallel, both authoritative. Within three weeks they had drifted: AGENTS.md still described a build script we had renamed, and Codex kept calling it. Nobody noticed because a stale memory file does not fail loudly, it just quietly makes the agent wrong.

The fix took four lines. One canonical file, one pointer.

# AGENTS.md (repo root)

The project rules live in CLAUDE.md at the repo root.
Read that file first and follow it exactly.

Codex-specific notes:
- Sandbox: workspace-write is enough, this repo never needs network
- Run ./build.sh before proposing a diff, it is fast

The rules themselves are short and every line changes behaviour. On the AITerm repo that means the build command, one hard prohibition (never push without an explicit ask), and the localisation rule that every visible string goes through L("key") in all seven languages. Both agents break that last one on their first day if you leave it out, and both respect it once it is written down.

Tip. If a rule does not change what the agent does, delete it from both files. Directory listings and dependency inventories are the usual dead weight, because either agent can read those from the repo faster than you can keep them true in prose.

Which one is safer to leave unattended?

Codex, on the strength of its permission model alone. It asks you to pick two independent things: a sandbox mode (read-only, workspace-write or danger-full-access) and an approval policy (untrusted, on-request or never). Filesystem reach and interruption frequency stop being the same dial.

That separation matters more than it sounds. You can hand an agent full write access to the working directory while cutting its network reach entirely, which is precisely the shape of most unattended runs. Claude Code reaches similar outcomes through permission modes and settings, and its hooks are the only mechanism in either tool that the model cannot argue its way past, because a hook is a shell command, not a suggestion.

# Codex, write to the workspace but never reach the network
codex --sandbox workspace-write --ask-for-approval on-request

# Claude Code, the reflex that saves sessions
Shift+Tab         # cycle plan mode and permission modes
Esc Esc           # rewind to an earlier state in this session

The trap that cost us an afternoon. Our first side-by-side run put both agents in the same working tree. Codex rewrote a Swift file while Claude Code was mid-edit on the same lines, and the diff that came out compiled but silently dropped a localisation key. We deserved it. Two agents, two worktrees, always. There is no clever exception.

Task routing, the rules we actually type

After a few months of running both, the routing stopped being a judgement call and became a habit. The split follows one question: can we describe the finished state in a paragraph? If yes, Codex. If the task needs the agent to discover what it is really about, Claude Code.

Task We send it to Why
Add a localisation key in 7 filesCodexFully specified, repetitive, cheap per token
Shell script, CI job, build tweakCodexTerminal work is where it tops its benchmark
"Why does this pane leak memory"Claude CodeNeeds exploration before it needs edits
Refactor touching 9+ filesClaude CodeSubagents keep the search out of the main window
Write the tests for a shipped featureCodexScope is the existing diff, nothing to discover
Review a plan before we approve itBothTwo opinions on one plan is the cheapest review we run

That last row is the one nobody talks about. Handing the same plan to both agents and reading where they disagree finds more real problems than any single agent's self-review, because the disagreement is never in the boilerplate. It is always on the decision that mattered.

Can you run both at the same time?

Yes, and past two agents it becomes a monitoring problem rather than a compute problem. Codex is a Rust binary, Claude Code is a Node process, and a modern laptop will run four of them without noticing. What breaks first is your ability to know which one is waiting for an answer.

The mechanical part is git worktrees, and it is four commands.

01

One worktree per agent

Separate directories, separate branches. This is the rule that has no exception.

02

One task per session

A session that has done three things is a session with a polluted context window.

03

Watch two quota clocks

Different meters on each side. Getting cut off mid-refactor is a scheduling failure, not a budget one.

04

Review serially

Agents run in parallel, humans do not. Two diffs at once is where quality drops.

git worktree add ../proj-codex  -b feat/tests
git worktree add ../proj-claude -b feat/refactor

cd ../proj-codex  && codex     # scoped work
cd ../proj-claude && claude    # exploratory work

Our anonymous daily ping says most people settle around three concurrent agent sessions, with a long tail well above that. Three is not a technical ceiling. It is roughly how many diffs one person can hold in their head before review turns into rubber-stamping.

The setup we run on the AITerm repo

Two agents, two worktrees, one window. Claude Code sits in a pane on the feature branch, Codex in a second pane on tests or the localisation sweep, the dev server in a third, and the quota gauges for both accounts sit in the sidebar where we can see them without switching apps.

An AITerm window with six native terminal panes running Claude Code and Codex on the same project, the local servers bar on top and a sidebar with live quota gauges for both agents
Both agents, one window. The colour on each session is the point: green is done, blue is waiting for you.

This is the part where our product enters, so here are the numbers instead of adjectives. AITerm is 45 MB of Swift rendering through CoreText. With 20 panes streaming agent output on an M2 Air we measured about 140 MB of RAM total, against roughly 1.9 GB for the Electron setup we used before, and keystroke latency stayed under 8 ms while output was heavy.

The feature that changed the two-agent workflow for us is smaller than that: live status per session, plus quota windows for Claude Code and Codex side by side, with alerts at 75% and 90%. When your two agents meter usage in completely different ways, seeing both clocks in one place is what stops a refactor from dying at 70% done.

None of the routing above needs our app. Worktrees, short memory files, one task per session and clearing early work in any terminal, including yours. What the app removes is the alt-tabbing to find out who is waiting, which stops being a small thing somewhere around the third agent.

The short version: install both, keep one canonical memory file, route by whether you can describe the finished state. That's it.

Going further

GUIDE

Claude Code, properly

Install, CLAUDE.md, plan mode and the context levers.

PRODUCT

Piloting two agents

Live status and quota gauges for Claude Code and Codex.

PERFORMANCE

The latency numbers

Native rendering, 20 panes, and what it costs in RAM.

PRICING

Trial and plan

Seven days unlocked, no account, no card.

Sources

  1. Introducing GPT-5.3-Codex, OpenAI, February 2026: 77.3% on Terminal-Bench 2.0, 64.7% on OSWorld-Verified, 56.8% on SWE-Bench Pro, 25% faster than GPT-5.2-Codex.
  2. Agent approvals and security, OpenAI Codex docs, 2026: sandbox modes (read-only, workspace-write, danger-full-access) and approval policies (untrusted, on-request, never).
  3. openai/codex, GitHub: the Rust implementation of Codex CLI, AGENTS.md handling and the apply_patch primitive.
  4. Model configuration, Anthropic Claude Code docs, 2026: model aliases, the opusplan mode, and Sonnet 5's native 1 million token window.
  5. Manage costs effectively, Anthropic Claude Code docs, 2026: about $13 per developer per active day, $150 to $250 per month, under $30 per active day for 90% of users.
  6. Create custom subagents, Anthropic Claude Code docs, 2026: separate context windows, built-in Explore and Plan agents.
  7. Extend Claude with skills, Anthropic Claude Code docs, 2026: on-demand loading, bundled skills, the Agent Skills open standard.
  8. Meet the new Claude Opus 5, MarkTechPost, 24 July 2026: release date and unchanged Opus API pricing at $5 and $25 per million tokens.
  9. Terminal-Bench 2.1 leaderboard, CodingFleet, 2026: Claude Opus 5 at 89.1%.
  10. Claude Code vs Codex, 23% higher cost per task, Tech Insider, 2026: the controlled head-to-head at 192,000 tokens and $2.50 versus 136,000 tokens and $2.04.
  11. Codex rate card, OpenAI Help Center, 2026: plan tiers and the 2 April 2026 move to token-based metering.
  12. Stack Overflow Developer Survey 2025, AI section: 84% of developers use or plan to use AI tools, 29% trust their accuracy.

Frequently asked questions

Is Codex better than Claude Code?

Neither wins outright, because they top different benchmarks. GPT-5.3-Codex leads Terminal-Bench 2.0 at 77.3% (OpenAI, February 2026), which measures terminal and system tasks. Claude Opus 5 leads Terminal-Bench 2.1 at 89.1% on a newer version of that benchmark. Codex is the cheaper daily driver on well-scoped work. Claude Code is stronger on multi-file changes in a large repository.

What is the difference between Codex CLI and Claude Code?

Codex CLI is OpenAI's terminal agent, written in Rust, shipping as a single binary, reading AGENTS.md for project memory and gating actions through a sandbox mode plus an approval policy. Claude Code is Anthropic's terminal agent, reading CLAUDE.md, with skills, subagents, hooks and a mature MCP integration. Both propose diffs and wait for approval by default.

Which is cheaper, Codex or Claude Code?

Codex, at the entry tier. Codex is bundled into ChatGPT plans starting at Go for 8 dollars a month and Plus at 20, while Claude Code needs Claude Pro at 20 dollars a month. On a controlled head-to-head task, Codex spent about 136,000 tokens against roughly 192,000 for Claude Code, a 23 percent cost gap. Anthropic's own docs put average enterprise spend at about 13 dollars per developer per active day.

Can you run Codex and Claude Code at the same time?

Yes, and it is the setup most heavy users land on. The one hard rule is that two agents must never share the same working tree, so give each one its own git worktree. After that the limit is your quota on both accounts and your ability to tell which session is waiting for you.

Does Codex use AGENTS.md or CLAUDE.md?

Codex reads AGENTS.md, Claude Code reads CLAUDE.md. They are not interchangeable files, though the content overlaps heavily: build command, test command, conventions the agent keeps breaking. Teams running both usually keep one short canonical file and have the second one point at it rather than maintaining two drifting copies.

Which agent is safer to leave running unattended?

Codex, because of how explicitly it separates the two axes. You pick a sandbox mode (read-only, workspace-write or danger-full-access) and an approval policy (untrusted, on-request or never) independently, so you can grant write access without granting network access. Claude Code has permission modes and hooks that reach the same result, with hooks being the only mechanism the model cannot talk its way around.

How big is the context window on each one?

GPT-5.3-Codex ships a 200,000 token context window, and Codex CLI triggers automatic compaction roughly 13,000 tokens before that ceiling. Claude Sonnet 5 has a native 1 million token window according to Anthropic's model configuration docs. In practice both compact long sessions, and a cleared session beats a compacted one for accuracy.

Do you need to pick one for your whole team?

No. Both read a plain git repository and leave normal commits behind, so two developers on the same codebase can use different agents without any coordination cost. What does need agreeing on is the project memory file, since one team maintaining both AGENTS.md and CLAUDE.md by hand will let one of them rot within a month.

Related articles