Codex vs Claude Code: two terminal agents compared

These two really are competing for the same slot: an agent that edits your repository from a terminal. They differ less on model quality than on how much they ask you, how they contain themselves, and how they behave over a long session.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Codex defaults to containment: an operating-system sandbox with a writable workspace, network off, and the model deciding when to ask. Claude Code defaults to consent: permission modes that range from approving every action to a classifier-vetted auto mode, with plan mode as the gate for anything unfamiliar. Their heavy-use price ladders differ, so compare the plans as published rather than forcing them into matching rungs. Running both and letting one review the other is a genuinely good pattern.

What you need to know
  • Both are included with a consumer subscription: ChatGPT for Codex, Claude for Claude Code.
  • Codex contains the agent with an OS-level sandbox (Seatbelt, bubblewrap, the Windows sandbox). Claude Code gates it with permission modes and a classifier.
  • Both now have both. The difference in 2026 is the default posture, not the available machinery.
  • ChatGPT publishes Go at $8, Plus at $20, and Pro at $200 with maximum Codex tasks. Claude publishes Pro at $20, Max 5x at $100, and Max 20x at $200.
  • Codex exposes reasoning effort as a first-class dial. Claude Code exposes plan mode as a first-class gate. Those are the two levers that matter most.
  • The strongest pattern is both: one implements, the other reviews, and you get two independent quotas.

Containment, which drives everything else

Codex: contain itagentfree to act in hereboundary is enforced, not askedinterruptions: rareClaude Code: ask about itwrite file?allowrun command?allowpush branch?allowyou are the boundaryinterruptions: frequent
Two answers to the same question. A sandbox is a stronger guarantee because it does not depend on you reading the prompt. A prompt is more flexible because you can say yes to the exception.

Both put an agent in your terminal. The design disagreement is about how to stop it doing something you did not want.

CodexClaude Code
Primary mechanismOS sandbox with a writable workspace rootPermission modes plus allow, ask, and deny rules
Defaultworkspace-write sandbox, on-request approvals, network offManual mode: reads run, everything else prompts
Hands-off setting-a never inside a tight sandboxauto mode, where a classifier vets each action first
Research-only setting-s read-only--permission-mode plan
EnforcementSeatbelt on macOS, bubblewrap on Linux and WSL2, the native sandbox on WindowsIn-process policy, with a separate sandboxing feature for shell commands
Feels likeDelegating to a contractor with a locked officePairing with someone who asks before each step

The 2026 correction

The old summary of this comparison, "Codex sandboxes and Claude Code asks", is now a statement about defaults rather than capabilities. Claude Code has its own sandboxing for shell commands and an auto mode where a classifier reviews actions before they run, and Codex has an untrusted approval policy that will prompt on anything off a trusted list. Pick on default behaviour, because the default is what you will actually live with.

The models behind each one

This is where a lot of the felt difference comes from, and both lineups moved in 2026.

Model families as presented by each vendor in August 2026.

CodexClaude Code
Everyday modelGPT-5.6 TerraSonnet class
Hardest workGPT-5.6 SolOpus class
Cheap and fastGPT-5.6 LunaHaiku class
Effort controlmodel_reasoning_effort: minimal, low, medium, high, xhighModel choice plus extended thinking
Preview tiersGPT-5.3-Codex-Spark on Pro plansNewer models roll out across plans

Codex making reasoning effort an explicit setting matters more than it sounds. It means the same model is three different tools depending on one config key, and it is the largest lever you have on both quota and wall-clock time. Claude Code puts the equivalent decision in model selection and in whether you use plan mode.

Cost

List prices checked 7 August 2026 on each vendor’s pricing page.

Codex (ChatGPT)Claude Code (Claude)
FreeIncluded, small allowanceIncluded, small allowance
EntryGo $8/mo, Plus $20/moPro $20/mo (about $17 annually)
MidNo separate published rungMax 5x, $100/mo
Top individualPro, $200/moMax 20x, $200/mo
Business$20/user/mo annual, $25 monthlyTeam Standard $20/seat annual, $25 monthly
OverageCredits, priced per million tokens by modelNone on subscription; you wait for the window
API optionYes, per tokenYes, per token

The ladders match at the $20 entry tier but differ above it, which makes plan shape part of the choice. ChatGPT has an $8 Go tier with no Claude equivalent, and publishes Pro at $200. Codex also sells credits for overage, so a heavy day can continue at a price, where a Claude subscription simply stops until the window refills.

How each one meters you

  • Codex counts messages against a 5-hour window that scales with your plan. As of August 2026 OpenAI publishes an indicative range of roughly 25 to 200 local messages per window on Plus for the everyday model, and describes Pro as offering maximum Codex tasks. Cloud tasks share the same window.
  • Claude Code counts tokens weighted by model against a rolling 5-hour window plus a separate weekly cap. There is no message count, which is why the same plan feels generous on a Haiku day and tight on an Opus one.

The two-subscription argument

At $20 plus $20 you get two independent quotas and two independent opinions. When you exhaust one, you switch rather than stop. For anyone doing this full time that is a better use of $40 than a single upgrade, and it is the single most common setup among heavy users.

What people consistently report

Filtering months of comparisons down to the claims that recur across independent sources rather than appearing once:

DimensionTends to favourThe observation
Speed on simple tasksClaude CodeFaster to first useful output
Thoroughness on hard problemsCodexSlower at high effort, but more likely to actually solve it
Long multi-turn sessionsClaude CodeDegrades less over hours of work
Context efficiencyCodexGets more done per token of context
Large outputsClaude CodeHandles big refactors and long files better
Hands-off autonomyCodexInterrupts less, finishes more unattended
Interactive steeringClaude CodeEasier to redirect mid-task
Hard safety boundaryCodexOS-level containment rather than in-process policy
Working away from the deskClaude CodeDesktop, web, and mobile surfaces plus Remote Control

Running both, properly

Not "have both installed", but an actual division of labour. The patterns that hold up:

01

Implement with one, review with the other

The reviewer has no attachment to the implementation and no context about why a shortcut was taken. It catches things the author will not. Codex ships a codex review subcommand for exactly this; Claude Code does it with a read-only session or a plan-mode prompt. This is the highest-value pattern by a distance.

02

Race them on genuinely hard problems

Give the same difficult task to both in separate worktrees, then read both diffs and take the better one, or the better half of each. Twice the cost, and worth it when the failure mode is a design you live with for a year.

03

Split by task shape

Codex at high reasoning effort for the long unattended grind where you want it to just finish. Claude Code for the interactive work where you will be steering, and for anything you want to approve from a phone.

04

Fail over on limits

Hit a Claude window at 3pm and move to Codex rather than stopping. Two quotas is the practical benefit people notice first, and it is worth more than a single larger plan for most people.

Two agents, two worktrees, one repo
# Claude Code makes its own worktree
claude --worktree feature-auth

# Codex in a second worktree, with the main repo writable so git works
git worktree add ../myapp-codex -b feature-auth-codex
cd ../myapp-codex
codex --add-dir ~/code/myapp

Measuring which one is actually earning its keep

Neither vendor can tell you what the other is costing, so if you run both you have no total. Both write their history to disk in a form you can read, which is the only place a real answer exists.

CodexClaude Code
History location~/.codex/sessions/~/.claude/projects/
FormatOne rollout file per sessionOne JSONL per session, filed by encoded project path
Carries token countsYesYes
In-session check/status/status
A crude but honest first look
du -sh ~/.codex/sessions/ ~/.claude/projects/
ls -t ~/.codex/sessions/ | head -5
ls -t ~/.claude/projects/ | head -5

That tells you volume, not dollars. Pricing it properly means joining each turn’s token counts to the rate for the model that produced them at the time it ran, which is what dedicated tooling exists to do.

Picking one

IfPick
You already pay for ChatGPTCodex. It is included; start there.
You already pay for ClaudeClaude Code. Same logic.
You want maximum hands-off autonomyCodex
You want to steer mid-taskClaude Code
You need a hard OS-level safety boundaryCodex
You run very long sessions on big refactorsClaude Code
You want to approve work from a phoneClaude Code
You want the cheapest way in at allChatGPT Go at $8
You are doing this professionally, full timeBoth, at $20 + $20

If you genuinely have no prior subscription and no preference, start with whichever ecosystem you already trust with your data. That constraint is more durable than any current quality gap, because the quality gap will invert at least twice before your subscription renews.

Questions people ask

Neither dominates. Codex tends to be more thorough on hard problems at high reasoning effort and more hands-off; Claude Code tends to be faster to first output and stronger over long sessions. The gap moves with every release.

Yes, and it is a good pattern. Put each in its own git worktree so their edits cannot collide, and use one to review the other. Remember to pass --add-dir to Codex inside a worktree or its git operations will fail.

They match at the $20 entry tier, then differ: ChatGPT publishes Pro at $200, while Claude publishes Max tiers at $100 and $200. ChatGPT also has an $8 Go tier, and Codex sells credits for overage where a Claude subscription simply stops until the window refills.

How often it interrupts you, and what happens when it wants to do something outside the box. Codex is contained by the operating system and asks when it needs to leave the sandbox. Claude Code is gated by permission modes and asks according to the mode you chose.

Not by that name. Running with a read-only sandbox achieves the same thing: it can research and propose without the ability to change anything. Claude Code’s version is more formal, with a plan artefact and an approval prompt you can edit with Ctrl+G.

Codex is more context-efficient per token; Claude Code degrades less over long sessions and large outputs, and its subagents keep exploration out of the main context. For a huge refactor in one sitting, Claude Code. For a careful change in a sprawling repo, Codex.

Yes. codex exec and claude -p both run non-interactively and exit. Use an API key rather than a subscription login in a pipeline, and pin the permission or sandbox settings explicitly instead of inheriting a default that may move.

Whichever ecosystem you already trust with your source code. Both are $20 to try, both are monthly, and switching costs a month. That is a cheaper experiment than reading another comparison.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Codex pricing ChatGPT plan prices, window ranges, credit rates
  2. Codex sandboxing sandbox modes and platform enforcement
  3. Claude plans and pricing Pro, Max, and Team prices
  4. Claude Code: permission modes plan, auto, and the rest
Try it

Both agents.
One sidebar.

Continuum runs Claude Code and Codex side by side under your own subscriptions, with a quota gauge for each, worktree isolation per session, and one spend view across both.

free app · your subscriptions · local-first