Strategy & GuidesFIELD NOTE · 19 MIN

Codex vs Claude Code, We Run Both Daily

Codex vs Claude Code in October 2026: GPT-6.1 Sol vs Opus 5.5, real prices, limits, hooks, safety and the routing table we hard-coded to send each task to the right agent.

AITerm 19 min read

Codex vs Claude Code, in October 2026: Codex (OpenAI, GPT-6.1 Sol) is the cheaper, steadier agent for work you can describe in a paragraph. Claude Code (Anthropic, Opus 5.5 by default) is better when a change spreads across many files. Both now ship hooks and subagents. We run both, and route between them by rule.

Updated October 19, 2026 · first published August 5, 2026 · by the AITerm team

$8 vs $20

cheapest paid way in: ChatGPT Go for Codex, Claude Pro (monthly) for Claude Code, October 2026 price pages

66%

of developers using coding agents use Claude Code, the top agent in the Stack Overflow 2026 survey (Copilot 59%)

12

hook events now documented for Codex. The "only Claude Code has hooks" argument is dead

Key takeaways

  • Route by one question: can you describe the finished state in a paragraph? Yes goes to Codex, no goes to Claude Code.
  • The feature gap closed in 2026. Codex has hooks, TOML subagents and memories. Pick on models, price and safety instead.
  • Public leaderboards lag a model generation: no Opus 5.5 or GPT-6.1 Sol entry on Terminal-Bench 2.1 as of October 17.
  • AGENTS.md and CLAUDE.md are two files. Keep one canonical, point the other at it.
  • Running both costs a second worktree and a second quota clock. Never point them at the same tree.
Codex CLI Claude Code
MakerOpenAIAnthropic
Built inRust, single binaryNative installer or npm
Model for hard workGPT-6.1 Sol (recommended)Opus 5.5 (default on paid plans)
Project memoryAGENTS.md, memories off by defaultCLAUDE.md
ExtensibilitySkills, subagents, hooks, MCP, pluginsSkills, subagents, hooks, MCP, plugins
Entry priceFree tier, then Go at $8/moClaude Pro, $20/mo ($17 annual)
What stops you5-hour window on Plus, none on Pro for now5-hour session window plus weekly cap

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 agent, written in Rust and shipped as a single fast binary. It reads AGENTS.md for project conventions and applies edits through an apply_patch primitive rather than free-form file writes. Claude Code is Anthropic's, and it grew the wider extension surface first: skills that load on demand, subagents with their own context windows, hooks, plugins.

The short version of the verdict fits in two lines. 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.

# 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

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, and it is near the end.

One correction since we first published this in August. We used to call Gemini CLI the third agent worth installing. Google stopped serving it to personal Pro, Ultra and free accounts on June 18, 2026 and pointed people at the Antigravity CLI instead, which we cover in Claude Code vs Gemini CLI and Antigravity vs Claude Code. For most individual developers, this is now a two-horse race.

Codex vs Claude Code, six things that changed since August

Most pages ranking for this comparison were written against models that no longer run by default. Here is what moved between our first version and this one, all checked against the vendors' own docs in October 2026.

01

New default models

Claude Code runs Opus 5.5 by default on paid plans. OpenAI recommends GPT-6.1 Sol for complex Codex work, and retired GPT-5.5 from ChatGPT sign-in on October 14.

02

Codex got hooks

Twelve events, from SessionStart to PreToolUse, configured in hooks.json or config.toml. A PreToolUse hook can deny a call.

03

Codex got subagents

Custom agents are TOML files in .codex/agents/, each with its own model if you want. Built in: default, worker, explorer.

04

Approval policies moved

untrusted is gone. Codex now offers on-request, never and granular, plus an optional reviewer agent for escalations.

05

Pro lost its 5-hour cap

OpenAI's pricing page says Pro plans currently have no five-hour limit, and Pro now comes at $100, $200 or $500.

06

Gemini CLI left the race

Personal Google accounts lost it on June 18. Enterprise licences and paid API keys kept working.

Look, the honest reading of that list is convergence. Every structural feature we used to cite as a reason to pick Claude Code now has a Codex equivalent with a different file format. What still separates them is which model is behind the prompt, how each one bills you, and how each one stops a bad command.

The benchmark numbers are a generation behind

Every score you will see quoted in this debate was measured on a model the agents no longer run by default. Our August version cited GPT-5.3-Codex at 77.3% on Terminal-Bench 2.0 against Claude Opus 5 at 89.1% on Terminal-Bench 2.1. Two versions of the benchmark, two model generations ago.

The October picture is not cleaner. On the Terminal-Bench 2.1 board mirrored by BenchLM on October 17, 2026, OpenAI's best entry is GPT-5.6 Sol at 91.9%, Anthropic's best Opus is Opus 4.8 at 74.6%, and there is no entry at all for Opus 5.5 or GPT-6.1 Sol. Comparing those two numbers tells you about older models, not about the agent you would install today.

Our opinion. Benchmark scores are the worst possible input for this decision. They are measured on curated task sets, they move every six weeks, and none of them test what 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 measurement worth taking seriously is cost per unit of work, because you can reproduce it. On one matched task reported by Firecrawl in June 2026 and relayed by Tech Insider, Claude Code used about 192,000 tokens and $2.50, against 136,000 tokens and $2.04 for Codex. A 1.4x token gap and a 23% cost gap, on the previous model generation.

TOKENS ON ONE MATCHED TASK Codex CLI 136k tokens · $2.04 Claude Code 192k tokens · $2.50 Source: Firecrawl (June 2026) via Tech Insider. One task, previous model generation. Your gap will differ.
One task, not a suite. Rerun it on your own repo before you budget on it.

That gap has a cause, and model quality is the smaller part of it. 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, from a free tier on a lighter model up to a $500 Pro tier. Claude Code sells through Claude subscriptions, from Pro at $20 a month, and the free Claude plan does not include it.

Tier Codex, via ChatGPT Claude Code, via Claude
FreeYes, lighter modelNot included
Cheapest paidGo, $8/moPro, $20/mo ($17 annual)
Daily driverPlus, $20/moMax, from $100/mo
Heavy usePro, $100, $200 or $500/moMax 20x
Team seatBusiness, $20 annual or $25 monthlyTeam Standard $20/$25, Premium $100/$125
What stops youPlus: 15 to 160 GPT-6.1 Sol messages per 5 hours, weekly limits may apply5-hour session window, then weekly cap

Prices from OpenAI's Codex pricing page and claude.com/pricing, checked October 19, 2026. The per-model message ranges are where Codex gets interesting, and we broke them down in Codex usage limits explained and Codex pricing.

The number that reframed this for us is in Anthropic's cost documentation: across enterprise deployments Claude Code averages about $13 per developer per active day, or $150 to $250 a month, with 90% of users 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 what actually ends a session. Anthropic's model configuration docs say Opus 5.5 and Sonnet 5.5 run with a 1 million token window by default, no [1m] suffix needed, and auto-compact at about 967,000 tokens. OpenAI's models page does not publish a window size for GPT-6.1 Sol, so we stopped quoting one.

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.

Subagents are the other half of this, and both tools now have them. Claude Code documents them as separate context windows that do the noisy work, a codebase search or a log trawl, and hand back a summary. Codex's built-in explorer plays the same role, and a custom TOML agent can pin a cheaper model so the search does not burn your main window.

# Claude Code, before a long task
/context          # what is filling 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

# .codex/agents/searcher.toml, a cheap read-only scout
name = "searcher"
description = "Finds where things live. Never edits."
developer_instructions = "Search the repo and report file paths with one line each."
model = "gpt-6-luna"

So, the honest framing: Claude Code has more rope by default. Codex makes you think about it sooner. 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. 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 never fails loudly. It just makes the agent quietly 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.

Codex memories add a wrinkle. They are off by default and live in ~/.codex/memories/ as generated state, which OpenAI says not to edit by hand. We leave them off on shared repos: a rule that matters belongs in the file your teammates can read in review.

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, by a narrower margin than in the spring. It asks you to pick two independent things: a sandbox mode (read-only, workspace-write or danger-full-access) and an approval policy (on-request, never or granular). Filesystem reach and interruption frequency stop being the same dial, and workspace-write keeps the network off unless you turn it on.

In a version-controlled folder Codex starts on its Auto preset, which is exactly that pair: workspace-write plus on-request. You can also route escalations to a reviewer agent with approvals_reviewer = "auto_review", at the price of extra model calls on your plan.

Claude Code gets to a similar place through permission modes, settings and hooks. Codex now has hooks as well, and its docs say something we wish more people repeated: treat tool hooks as a useful guardrail, not a complete enforcement boundary. A PostToolUse hook cannot undo a command that already ran, on either side.

# Codex, write to the workspace, network stays off
codex --sandbox workspace-write --ask-for-approval on-request

# Codex, block a command before it runs (.codex/hooks.json, PreToolUse)
# return permissionDecision "deny", or exit 2 with the reason on stderr

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

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.

The routing table we ended up hard-coding

After a few months of running both, the routing stopped being a judgement call. The split follows one question: can we describe the finished state in a paragraph? If yes, Codex. If the agent has to discover what the task 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 tweakCodexShort, verifiable, the sandbox fits the job
"Why does this pane leak memory"Claude CodeNeeds exploration before it needs edits
Refactor touching 9+ filesClaude CodeThe 1M window and subagents keep the search out of the way
Write the tests for a shipped featureCodexScope is the existing diff, nothing to discover
Review a diff before we merge itThe other oneThe author never reviews its own work

Here's the thing. We liked that table enough to put it in code. Maestro, the multi-agent mode in AITerm, routes every block of a plan by tier, and the defaults in MaestroRouting.swift are the table above written as rules rather than habits.

01

Deep goes to Claude Code

Exploratory, multi-file blocks try Claude Code first, then Codex. Standard, well-scoped blocks try Codex first.

02

Under 10% goes last

An agent with less than 10% of its quota left drops to last resort. Assigning work to an empty window is planning a failure.

03

Data beats the table, slowly

After 3 runs on each side, an agent that passes first time 15 points more often takes the tier. Below that, the table decides.

04

Cross-review, always

The reviewer is never the author's CLI when another one is installed. A failed block escalates to a stronger model, never the same horse twice.

The 3-run, 15-point threshold exists so the routing never zigzags after one lucky run. A rule that flips every afternoon is worse than no rule at all.

The cross-review row deserves its own sentence. Handing one agent's diff to the other finds more real problems than any 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. A modern laptop runs four of these without noticing. What breaks first is your ability to know which one is waiting for an answer, and which one is about to hit its limit.

The mechanical part is git worktrees. The Codex desktop app now manages its own, in $CODEX_HOME/worktrees, keeping the 15 most recent by default. In a plain terminal, four commands cover both agents.

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

The quota side is less obvious, and building our gauges taught us why. The two agents expose usage in completely different ways. Claude Code's quota comes from Anthropic's usage endpoint, which the CLI itself calls with the same account, so a gauge that polls too eagerly can get both of them a 429. Ours polls at most every 5 minutes in the background, every 2 minutes when the quota page is open, every 15 seconds on an explicit refresh, and backs off after any 429.

Codex has no such endpoint. Its rate-limit data is written into the session logs under ~/.codex/sessions, so the number you read is only as fresh as your last Codex session. A Codex gauge can show 80% used for a window that already reset. Ours marks those windows as expired instead of pretending.

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, different freshness. 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.

AITerm is a native macOS terminal built for piloting AI coding agents. It runs Claude Code and Codex in side-by-side panes, shows each session's live status, and puts both quota windows in one sidebar with alerts at 75% and 90%. Its Maestro mode routes deep work to Claude Code, scoped work to Codex, and always has the other agent review.

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. AITerm is 12 MB of native Swift, rendering through CoreText. The feature that changed the two-agent workflow for us is the quota view: Claude Code and Codex windows side by side, with a notification the first time either one crosses 75%, then 90%. When 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, and let the other agent review. That's it.

Going further

Sources

  1. Codex models, OpenAI docs, October 2026: GPT-6.1 Sol recommended for complex coding, GPT-6 Astra and Luna, GPT-5.5 retired from ChatGPT sign-in on October 14, 2026.
  2. Codex pricing, OpenAI docs, October 2026: Free, Go $8, Plus $20, Pro $100/$200/$500, Business, 15 to 160 GPT-6.1 Sol messages per 5 hours on Plus, no five-hour limit on Pro.
  3. Agent approvals and security, OpenAI Codex docs, 2026: sandbox modes, on-request, never and granular policies, untrusted retired, Auto preset, auto-review, network off in workspace-write.
  4. Hooks, OpenAI Codex docs, 2026: twelve hook events, hooks.json and config.toml, PreToolUse deny, "a useful guardrail, not a complete enforcement boundary".
  5. Subagents, OpenAI Codex docs, 2026: TOML agents in .codex/agents, built-in default, worker and explorer agents, per-agent model.
  6. Memories and Git worktrees, OpenAI Codex docs, 2026: memories off by default, managed worktrees in $CODEX_HOME/worktrees, 15 kept by default.
  7. openai/codex, GitHub: the Rust implementation of Codex CLI, AGENTS.md handling and the apply_patch primitive.
  8. Model configuration, Anthropic Claude Code docs, October 2026: Opus 5.5 default on Pro, Max, Team and Enterprise, native 1M window, auto-compact near 967K tokens, opusplan.
  9. 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.
  10. Create custom subagents and Hooks reference, Anthropic Claude Code docs, 2026.
  11. Plans and pricing, Anthropic, October 2026: Pro $20 or $17 annual, Max from $100, Team Standard and Premium seats, Claude Code not in the free plan.
  12. Stack Overflow Developer Survey 2026, AI section: Claude Code (66%) and GitHub Copilot (59%) lead coding agents.
  13. Terminal-Bench 2.1 leaderboard, BenchLM mirror, updated October 17, 2026: GPT-5.6 Sol 91.9%, Claude Opus 4.8 74.6%, no Opus 5.5 or GPT-6.1 Sol entry.
  14. Claude Code vs Codex, Tech Insider, July 2026, citing Firecrawl (June 2026): one matched task at about 192,000 tokens and $2.50 versus 136,000 tokens and $2.04.

Frequently asked questions

Is Codex better than Claude Code?

Neither wins outright in October 2026. Codex is cheaper to start (ChatGPT Go at 8 dollars a month) and steadier on work you can specify in a paragraph. Claude Code, on Opus 5.5 by default, is stronger when a change spreads across many files and the agent has to explore first. Public benchmarks do not settle it: as of October 17, 2026 neither GPT-6.1 Sol nor Opus 5.5 appears on the Terminal-Bench 2.1 leaderboard.

What is the difference between Codex CLI and Claude Code?

Codex CLI is OpenAI's terminal agent, written in Rust, reading AGENTS.md and gating actions with a sandbox mode plus an approval policy. Claude Code is Anthropic's terminal agent, reading CLAUDE.md, with permission modes and plan mode. In 2026 both ship skills, subagents, hooks, plugins and MCP, so the real differences are the models, the pricing and the safety model.

Which is cheaper, Codex or Claude Code?

Codex, at the entry tier. Codex is included in ChatGPT plans from Go at 8 dollars a month and Plus at 20, with a free tier that runs a lighter model. Claude Code needs Claude Pro at 20 dollars a month, or 17 on annual billing, and is not included in the free plan. At the heavy end both cost 100 to 200 dollars a month, and OpenAI also sells a 500 dollar Pro tier.

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

Yes, and it is the setup most heavy users land on. Give each agent its own git worktree so they never edit the same files, then watch two quota clocks that work differently. AITerm, a native macOS terminal built for piloting AI coding agents, shows both sessions in panes with live status and quota gauges for Claude Code and Codex side by side.

Does Codex use AGENTS.md or CLAUDE.md?

Codex reads AGENTS.md, Claude Code reads CLAUDE.md, and neither reads the other's file. The content overlaps heavily: build command, test command, the conventions the agent keeps breaking. Teams running both keep one canonical file and make the second one a short pointer to it, instead of maintaining two copies that drift apart within weeks.

Which agent is safer to leave running unattended?

Codex, by a smaller margin than in early 2026. It separates the sandbox mode (read-only, workspace-write, danger-full-access) from the approval policy (on-request, never or granular), and workspace-write keeps network access off by default. Claude Code reaches similar results with permission modes and hooks. Codex now has hooks too, and its own docs call them a guardrail, not a complete enforcement boundary.

Does Codex have hooks and subagents like Claude Code?

Yes. OpenAI's Codex docs list twelve hook events, including PreToolUse, which can deny a tool call, and SessionStart. Custom subagents are TOML files in .codex/agents, next to three built-in agents: default, worker and explorer. Codex memories exist as well but are off by default. The feature gap that justified many early 2026 comparisons has mostly closed.

Which models do Codex and Claude Code use by default?

Claude Code defaults to Opus 5.5 on Pro, Max, Team and Enterprise plans, with a native 1 million token context window, per Anthropic's model configuration docs. OpenAI recommends GPT-6.1 Sol for complex coding in Codex when it is available to your account. Free and Go plans were not part of its launch rollout and use lighter models such as GPT-6 Luna.

Related articles