Comparisons

Codex vs Claude Code: Same 8 Tasks, and How Much of Your Plan Each Burns

Codex vs Claude Code on the same 8 coding tasks: every run passed, Claude Code was faster, and Codex cost a fifth as much per task at API prices.

MesmerTools•October 19, 2026•6 min

I gave Codex and Claude Code the same eight coding tasks on a repo neither had seen, at the settings they ship with, and graded every run with tests the agents never saw. Every run that finished passed. On ordinary tickets both are good enough, so the choice comes down to what each one charges you for the work, in money, in time and in plan.

A Claude Code task cost 37 cents at API prices and a Codex task 7.5 cents, a fifth as much. Claude Code was faster, about a minute per task against nearly two, and wrote a lot more code to reach the same passing result. Against subscription limits the gap is wider still: as of October 2026, a week of ChatGPT Plus held at least seven times as many of these tasks per dollar of plan as a week of Claude Max 20x.

Two identical terminal windows with checkmarks, each above a cost meter; the left meter holds a thin sliver and the right about half

Eight tickets, graded by tests the agents never saw

I wrote a small invoicing API for this, about 1,500 lines of TypeScript, so neither model could have seen it in training. The tasks are the kind of ticket you hand an agent most days: a rounding bug, a pagination bug described only as a customer complaint, a CSV export, partial payments, a cleanup of copy-pasted money formatting, tests for an untested module, a move from a JSON file to SQLite, and a month-end billing date bug.

Each prompt reads like a ticket. When the agent said it was done, I copied in acceptance tests it had never seen, and a run passed only if those and the repo's own suite both passed. For the test-writing task, the agent's tests also had to catch at least 11 of 13 bugs I'd planted in the module.

Both ran headless with full permissions in a throwaway copy of the repo, without my settings, plugins or MCP servers: Codex on GPT-6.1 Sol at low reasoning effort, Claude Code on Opus 5.5 at medium effort, which is what each ships with. Codex got 64 runs and Claude Code 22, because I kept Codex going until its plan meter moved. Three runs ended by a rate limit (two Claude Code) or a capacity error (one Codex) are left out, not counted as failures.

One thing wasn't equal. The mode that kept my settings out of Claude Code also hid the repo's AGENTS.md, a short file of conventions. Codex read it on startup; Claude Code only saw it if it opened the file itself, which it did in 19 of 22 runs. That could nudge cost and time a little. It can't change whether the work passed, since every run did.

Median time and cost per task, default settings

TimeCost at API prices
■ Codex■ Claude Code■ Codex■ Claude Code
Rounding bug1m 15s52s$0.04$0.17
Pagination bug from a vague report1m 43s1m 04s$0.07$0.28
CSV export1m 38s1m 04s$0.08$0.40
Partial payments across 7-8 files2m 06s1m 42s$0.10$0.59
Money formatting cleanup1m 42s1m 01s$0.07$0.35
Tests for a retry module2m 10s2m 15s$0.07$0.52
JSON file to SQLite2m 07s1m 32s$0.10$0.39
Month-end billing dates1m 11s57s$0.06$0.25
Cost is each run's own tokens at October 2026 list prices. Claude Code's medians come from two or three runs each, so read the pattern, not any single row.

Codex was cheaper on every task, by four to seven times, and Claude Code was faster on seven of the eight (the test-writing task was a tie). Every run read the relevant code, ran the suite and added tests of its own. The tasks still weren't hard enough to split two frontier agents, and I think that matches most day-to-day agent work: on tickets like these, the model is rarely what fails. If your work is mostly long, vague jobs that run for hours, this test doesn't speak to it.

Why a Claude Code task costs five times as much

The gap comes from three things. Opus 5.5 lists at twice GPT-6.1 Sol's price per token: $4 per million input tokens and $20 per million output, against $2 and $10 (our token price calculator has both). Claude Code also wrote about 2.7 times as many output tokens per task: more code, more tests, more thinking and longer wrap-up messages. And it pays to fill its cache.

That last one is easy to miss. Both tools resend the whole conversation on every step and lean on prompt caching, so re-reading old context is cheap on both, a twentieth of the input price. The difference is the first time new context goes in. Codex's runs logged no cache writes, so there was no write fee to pay (OpenAI's API bills one by default, as the OpenAI pricing post explains). Anthropic bills a cache write, and Claude Code asks for the one-hour cache, which costs twice the normal input price. Cache writes were half of Claude Code's bill in these runs, and output most of the rest. Codex's bill was mostly fresh input and output.

Codex vs Claude Code on plan limits: what one task uses

ChatGPT Plus shows one weekly meter in whole percents, and nothing else used the account during the tests. It took about 60 runs, $4.56 of API-priced work, before the meter ticked from 0% to 1%. That's what we saw in October; for how that rate has moved over the year, see our Codex usage limits post. Since the meter shows whole percents, 1% is at least $4.56 of work, so a Codex task here used at most about 0.016% of a Plus week.

Claude's meter is shared by everything else on the account, so I couldn't read it per run, and its 5-hour limit cut off two Claude Code runs mid-test. The Claude Code numbers here are calculated, not read off a meter: each run's own tokens priced at API rates, then converted at the rates from our Claude Code pricing measurements on the same Max 20x account, about $3 of Opus 5.5 work per 1% of a 5-hour window and about ten windows to a week. That puts a Claude Code task at about 0.12% of a window and 0.012% of the week.

CodexClaude Code

Cost per finished task at API prices

Codex
$0.075
Claude Code
$0.373

Finished tasks a week's limit holds, per $20 a month of plan

Codex, ChatGPT Plus
6,100
Claude Code, Max 20x
800
Codex: GPT-6.1 Sol at low effort on ChatGPT Plus ($20 a month). Claude Code: Opus 5.5 at medium effort on Max 20x ($200 a month), shown per $20 of its price. Ticket-sized tasks; long sessions use far more per task.

Max 20x includes about $3,000 of API-priced work a week for $200 a month, roughly $15 a week for every monthly dollar. Plus, at the October reading, included at least $22. Stack that on the cost gap and $20 of Plus holds about seven times as many of these tasks as $20 worth of Max 20x. Either way it's more tasks than one person can review.

These tasks are small, though. On average, a step in my own Claude Code sessions carries about seven times the context a step here did, which is how real sessions run into the 5-hour wall while all 22 Claude Code runs together came to about 3% of one window. I'd trust the ratio between the two tools more than the absolute counts. And I can't measure Claude Pro, so I won't guess what it holds.

Claude Code is faster, and writes a lot more

The median task took Claude Code 64 seconds and Codex 109. Each Codex step took about 18 seconds against 10 for Claude Code, even though Codex wrote fewer tokens. Four Codex runs lost time to dropped connections on my network; without them Codex's median is 106 seconds. Codex has a Fast mode, but it draws the plan down faster.

The bigger difference is volume. Leaving out the test-writing task, Claude Code added about a third more lines than Codex on the same tasks, 165 against 125 per task, and it went much further when asked for tests. On the test-writing task, Claude Code wrote 56 to 66 tests per run and Codex 14 to 21. All eleven test files caught every one of the 13 planted bugs, so the extra forty-odd tests per run bought nothing I could measure.

The month-end billing bug shows the pattern in miniature. A schedule that starts on January 31 should bill on February 28, then March 31. Both agents fixed it correctly. Codex changed one function, and Claude Code rebuilt it around two new helpers:

Codexone function
export function nextIssueDate(startDate: string, previous: string,
    interval: RecurringInterval): string {
  const anchorDay = toUTCDate(startDate).getUTCDate();
  const next = toUTCDate(previous);
  // Advance from the first so short months cannot overflow into the next month.
  next.setUTCDate(1);
  next.setUTCMonth(next.getUTCMonth() + MONTHS[interval]);
  next.setUTCDate(Math.min(anchorDay,
    daysInMonth(next.getUTCFullYear(), next.getUTCMonth() + 1)));
  return formatUTCDate(next);
}
Claude Codetwo helpers and the function
/** Index of the month containing `date`, counted from year 0 (year * 12 + month0). */
function monthIndex(date: string): number {
  const d = toUTCDate(date);
  return d.getUTCFullYear() * 12 + d.getUTCMonth();
}

/** The date `months` months after `startDate`, keeping its day of month
 * (clamped to the month's last day). */
function addMonthsClamped(startDate: string, months: number): string {
  const day = toUTCDate(startDate).getUTCDate();
  const target = monthIndex(startDate) + months;
  const year = Math.floor(target / 12);
  const month1 = (target % 12) + 1;
  const clampedDay = Math.min(day, daysInMonth(year, month1));
  return `${String(year).padStart(4, "0")}-${String(month1).padStart(2, "0")}-${String(clampedDay).padStart(2, "0")}`;
}

/**
 * Issue date that follows `previous` for a schedule that started on `startDate`.
 * Always derived from `startDate` (never from `previous`'s day), so a short month
 * clamps that one period only: Jan 31 -> Feb 28 -> Mar 31 -> Apr 30.
 */
export function nextIssueDate(startDate: string, previous: string,
    interval: RecurringInterval): string {
  const step = MONTHS[interval];
  const elapsed = monthIndex(previous) - monthIndex(startDate);
  const periods = Math.max(0, Math.floor(elapsed / step)) + 1;
  return addMonthsClamped(startDate, periods * step);
}

Both pass the hidden tests. But every extra line is one more for me to review, and review is the part of agent work that doesn't get cheaper.

The system prompt is no longer the difference

It's often said that Claude Code sends a huge prompt before you've typed anything. Out of the box that's gone. Asked to reply "OK" in the same repo, Claude Code sent about 15,700 tokens before doing anything and Codex about 14,500.

Tokens in the first request, before any work happens

Claude Code, my config
19.7k
Claude Code, as shipped
15.7k
Codex, my config
16.0k
Codex, as shipped
14.5k
Input tokens in the first request, prompt included, for a one-line prompt in the task repo. As shipped means no personal settings, plugins or MCP servers.

What grows it is what you install. My own Claude Code config adds about 4,000 tokens of instructions and tool definitions, and my Codex config about 1,500. In my real sessions since September, with my first message included, the median first request was about 29,000 tokens in Claude Code and 18,000 in Codex. If yours is far above 16,000, that's your setup talking, and it rides along on every step.

Twenty dollars goes further on Codex

If I had $20 a month for agent work like this, I'd buy ChatGPT Plus and use Codex. It passed everything I gave it, it costs a fifth as much per task, and a week of Plus covers more of these tickets than I could review.

If you already pay for Max, Claude Code is the faster of the two, and the plan has room to spare at this task size. The five-to-one cost gap starts to matter when you run several agents at once or let one work for hours, which is how people hit the 5-hour limit on Max.

Before you switch, give both tools the same real ticket from your own backlog and read the two diffs side by side. You're the one who has to review them, and one of them will be noticeably longer.

More from the Blog