DEV Community

Joan Comadran
Joan Comadran

Posted on Originally published at joancomadran.dev

Claude Code vs Codex: pick by task, then set up both

On October 19, Theo Browne posted that over the previous two weeks, more than 60% of T3 Code users who used Codex also used Claude Code. By October 23 the post had 2,511 likes and about 118,000 views. T3 Code is his open-source control surface for coding agents (MIT, roughly 29,600 GitHub stars as of today). You bring your own Claude Code, Codex, Cursor, Grok Build, OpenCode or Antigravity login and drive them from one desktop, web or mobile app.

One caveat before anyone puts that number in a slide. People who install a tool built for switching agents are, unsurprisingly, people who switch agents. The 60% says very little about developers in general.

What it does show is that "Claude Code vs Codex" is turning into the wrong question for a lot of people. The better question is which jobs go to which agent, what that costs, and how to stop maintaining two sets of instructions. That's what this post covers.

What actually differs

Both are coding agents. You describe a task, and the agent reads the repo, edits files, runs commands and shows you the diff. Both have a CLI, an IDE extension, a desktop app and MCP support. Each vendor keeps shipping the other's features, so any feature table goes stale fast.

The difference that lasts is the default working style:

  • Claude Code is built around steering. It works in your terminal and your repo, shows its plan, asks before risky actions, and expects you to interrupt. You shape it with CLAUDE.md, skills, subagents and hooks. A PreToolUse hook is the way to block something, because Anthropic's own memory docs say CLAUDE.md is context, not enforced configuration.
  • Codex is built around delegation. It runs locally too, but its strength is handing off a task: cloud tasks in a sandbox, @codex on a GitHub issue or PR, codex exec in scripts, and several tasks at once. You shape it with AGENTS.md and its sandbox and approval settings.

Roughly, Claude Code feels like pairing and Codex feels like assigning a ticket. Both can do either; that's just what each one is designed for.

The benchmark numbers

Artificial Analysis runs both harnesses on the same three benchmarks. Their figures, checked October 23, 2026:

Claude Code (Opus 5.5, max) Codex (GPT-6 Astra, max) Codex (GPT-6.1 Sol, max)
Coding Agent Index 62 55 54
API cost per task $11.42 $7.04 $1.50
Time per task 1.0 h 24.8 min 23.7 min
Tokens per task 14.5M 3.2M 3.9M

Two things stand out. Claude Code scores higher and spends a lot more to get there: more turns, more tokens, more wall time. And Codex on GPT-6.1 Sol gets within a point of Astra at about a fifth of the cost, which says more about model choice than about harnesses.

Note what "cost per task" means here: pay-per-token API cost, not what you pay on a subscription. On a flat plan, those tokens turn into how fast you hit your limit.

What they cost (October 23, 2026)

Neither one is sold on its own. You get it through a plan.

Claude Code (pricing):

  • Pro: $20/month, or $17/month billed annually
  • Max: from $100/month, at 5x or 20x Pro's usage per five-hour session
  • Team and Enterprise seats, plus pay-per-token through a Console account

Limits reset on a rolling five-hour window, paid plans add weekly limits on top, and Claude Code shares one pool with your Claude chats. One gotcha from Anthropic's help center: if ANTHROPIC_API_KEY is set in your shell, Claude Code bills that key instead of your subscription. That's one more reason to keep keys out of global env, which I covered in securing your API keys.

Codex (pricing):

  • Free and Go ($8): GPT-6 Luna in the desktop app, subject to rollout
  • Plus: $20/month
  • Pro: $100, $200 or $500/month. Only Pro 500 gets Ultrafast mode
  • Business: $20/user/month billed annually, $25 monthly
  • API key: pay per token, but no cloud features (no GitHub reviews, no Slack)

On Plus, OpenAI estimates 15–160 local messages per five hours on GPT-6.1 Sol and 5–45 on GPT-6 Astra. Fast mode burns that allowance 2.5x faster. Pro plans currently have no five-hour limit, though weekly limits apply. Type /status in the CLI to see what's left.

Something to know this week if you're on Pro 200: according to OpenAI's Pro tiers article, subscribers who were on Pro 200 between September 22 and 29 keep the old, larger allowance only through October 29, 2026. After that they move to the new, smaller one, still at $200. If Codex has been your workhorse at that tier, expect to hit limits sooner from next Friday.

For budgeting either one at team scale, the logic in Claude Code cost per month applies to Codex too: measure cost per finished task, not cost per seat.

Which job goes to which

Choose by how well you can define the task and how closely you need to watch it.

Claude Code for:

  • Exploring a codebase you didn't write, when you don't know yet what the change should be.
  • Multi-file refactors and migrations that need decisions along the way.
  • Anything where you want to stop the agent the moment it goes the wrong way.

Codex for:

  • Small, clear, testable tasks: a bug with a repro, a dependency bump, a missing test.
  • A queue of those, where reviewing five diffs beats typing through five sessions.
  • Work where a failing test already defines done, so you don't have to watch it.

Neither, unsupervised, for auth, payments, secrets and data migrations you can't verify yourself. That isn't a limitation of either tool, it's a limitation of reviewing code you didn't read.

If you'd rather have one vendor and one bill, that works fine. The split above is a default, not a law. For the model side of the same decision, see Claude vs GPT for AI agents.

Setting up coding agents across a team and want the instructions, limits and review rules right from the start?

One repo, two agents: the AGENTS.md setup

This is where most two-agent setups quietly break.

Codex reads AGENTS.md. It starts with a global file in ~/.codex, then walks from the repo root down to your working directory, taking at most one file per directory. In each one, AGENTS.override.md wins over AGENTS.md. It stops at 32 KiB combined by default (project_doc_max_bytes).

Claude Code reads CLAUDE.md. Since v2.1.277 it can also read AGENTS.md, but by default only when there's no CLAUDE.md in your working directory or above it. If both exist, it reads CLAUDE.md only, unless CLAUDE.md imports the other file. It never reads AGENTS.override.md.

Next.js 16.2+ already sets this up: create-next-app writes an AGENTS.md with a managed block pointing agents to the docs bundled in node_modules/next/dist/docs/, plus a CLAUDE.md containing @AGENTS.md.

Here's the trap, and this site's repo has it. Its CLAUDE.md starts with @AGENTS.md, exactly as scaffolded, followed by 173 lines of real project rules: stack, design tokens, blog frontmatter, image rules, SEO setup. Its AGENTS.md is the 5-line Next.js block. Claude Code sees everything. Codex, opening the same repo, would see five lines telling it to read the Next.js docs, and nothing about the project. My other Next.js repos follow the same pattern.

The fix is to flip which file holds the content:

<!-- AGENTS.md: the shared rules, read by both agents -->
<!-- BEGIN:nextjs-agent-rules -->
...managed by Next.js, leave it alone...
<!-- END:nextjs-agent-rules -->

## Stack
## Commands
npm run build   # also runs the TS check
## Conventions
Enter fullscreen mode Exit fullscreen mode
<!-- CLAUDE.md: import, then only Claude-specific extras -->
@AGENTS.md

## Claude Code
Use plan mode for changes under src/app/(site)/blog/.
Enter fullscreen mode Exit fullscreen mode

Then check that each agent actually loaded it. In Claude Code, /memory or /context lists the loaded files. In Codex, run codex --ask-for-approval never "Summarize the current instructions." from the repo root.

Two more habits help:

  1. Keep the shared file short. Anthropic says long instruction files get followed less and suggests under 200 lines. OpenAI lists a smaller AGENTS.md as a way to make Codex limits last longer, and truncates at 32 KiB anyway. Put procedures in skills and folder-specific rules in nested files.
  2. Put the done condition in the file. "Run npm run build before you say you're finished" works for both agents, and it matters most for the one you aren't watching.

If you also share tools between them, the same idea applies to MCP servers: one server, two clients. That's covered in MCP vs function calling. Every MCP server adds context to each message, though, so connect only the ones the task needs. And if you start running agents for hours unattended, what happens when an agent dies mid-task becomes your problem too.

FAQ

Is Claude Code better than Codex?

On Artificial Analysis's Coding Agent Index (checked October 23, 2026), Claude Code with Opus 5.5 scores 62 and Codex with GPT-6 Astra scores 55. Codex finished tasks in about 25 minutes versus an hour, with fewer tokens and lower API cost per task. So Claude Code scores higher on hard tasks and Codex is faster and cheaper. Which matters more depends on the job.

How much do Claude Code and Codex cost?

As of October 23, 2026, both start at $20 a month. Claude Code comes with Claude Pro ($20, or $17 billed annually) and Max (from $100, at 5x or 20x Pro's usage). Codex comes with ChatGPT Plus ($20) and Pro ($100, $200 or $500). Both can also run on an API key and bill per token.

Can Claude Code and Codex share the same instructions file?

Yes. Codex reads AGENTS.md. Claude Code reads AGENTS.md only when there's no CLAUDE.md, so if you have both files, put the shared rules in AGENTS.md and start CLAUDE.md with the line @AGENTS.md. Claude Code then imports it, and Codex reads the same rules.

Should I pay for both Claude Code and Codex?

Only if you keep hitting one plan's limits, or you have two kinds of work: interactive changes you want to steer, and a queue of small, testable tasks you'd rather delegate. Two $20 plans cost the same as one plan doubled, and each one has its own five-hour and weekly limits.

The agent you pick matters less than whether it knows your repo's rules and whether you check its work. If you want help building that around AI coding agents, or the software they're writing, here's how I work.


Originally published on joancomadran.dev. I'm Joan, an AI engineer in Barcelona — work with me.

Top comments (0)