qvib.pro
RU

Claude Code vs Codex: tokens & tasks

Claude Code vs Codex/GPT-5.5: who burns tokens, who saves, and which tasks to route where — plus Fable/Opus/Sonnet routing inside Claude.

платно любой

Codex CLI — официальный открытый агент OpenAI (репозиторий github.com/openai/codex: лицензия Apache-2.0, ~98k звёзд, написан на Rust; ставится под ChatGPT-подписку или свой API-ключ) — проверено 2026-07-14. GPT-5.5 — дефолтная и топовая модель Codex: $5 вход / $30 выход за 1M токенов, контекст ~1M, релиз 24.04.2026 (OpenRouter/OpenAI). Claude Opus 4.8 — $5/$25, Claude Fable 5 — $10/$50 (ровно вдвое дороже Opus) по официальному прайсу Anthropic; алиас `/model opusplan` (Opus в plan mode → Sonnet на выполнении) — по докам Claude Code. Разница в расходе токенов «~3–4x» (Claude Code тратит больше) — сторонний бенчмарк Morphllm/Builder.io (Figma→код: Codex 1.5M vs Claude Code 6.2M), причём на более ранних моделях (GPT-5.3-Codex vs Opus 4.6): это ориентир, а не официальная метрика. Нюанс: GPT-5.5 недоступна по API-ключу — Codex откатывается на GPT-5.2-Codex (документация Codex). checked 2026-07-14

Updated: 14.07.2026

$ Task: <describe the task>. Pick the tool and model by this rule: - a long age…

Open source ↗

Claude Code vs Codex: tokens & tasks

Everyone argues "Claude Code or Codex" — and the honest answer is "both, on different tasks". Codex saves tokens, Claude writes more thoroughly. Here's what to send where so you don't torch your budget 🔥

Numbers from the price list (checked 2026-07-14): GPT-5.5 — the default model in Codex — costs $5 / $30 per 1M tokens (input/output), Claude Opus 4.8 — $5 / $25, Claude Fable 5 — $10 / $50. The Codex CLI is OpenAI's open agent (Rust, Apache-2.0, ~98k stars on GitHub), installed against a ChatGPT subscription or your own API key. Below: who's cheaper where, which tasks to hand to whom, and at the end — routing inside the Claude line-up itself.

Step 1 — Tokens: Codex is thriftier, Claude is more thorough

On the same task Claude Code spends roughly 3–4 times more tokens than Codex. In an open Figma→code test (Morphllm/Builder.io, April 2026) Codex ate 1.5M tokens against 6.2M for Claude Code — that same ~4x. An important caveat: that measurement still ran GPT-5.3-Codex against Opus 4.6, so the exact multiplier depends on model versions and the task — treat it as a reference point, not a law.

Why it happens: GPT-5.5 answers more tersely — it doesn't over-explain or write filler, and across a long agentic loop with dozens of tool calls that terseness adds up. Claude, by contrast, puts more in on the first pass: comments, error handling, edge cases — and by developers' accounts its code needs rework less often. The key point: 4x is about tokens spent, not about value per token.

How to tell it worked: you're comparing not "price per token" but the final bill for a specific task — because what decides it is the product of "price × how many tokens went out".

Common mistakes:

  • Taking "~4x" as a law. It's one third-party benchmark on older models — measure it on your own tasks.
  • Picking a tool by price per token rather than by the cost of a solved task.

Step 2 — Which tasks to hand to whom

Codex (GPT-5.5) — when economy and autonomy matter:

  • long agentic runs with lots of tool calls and terminal commands;
  • mass refactors, bug fixes, running tests, DevOps routine;
  • tasks where you don't want to burn a week's limit on verbosity.

GPT-5.5 is OpenAI's top model and the default in Codex; context is ~1M tokens.

Claude Code (Opus / Fable) — when thoroughness and the cost of a mistake matter:

  • code that needs edge cases and error handling right the first time, with less rework;
  • security reviews and plans for complex features — on Fable (see Step 3);
  • architectural decisions where the quality of the analysis matters more than saving tokens.

An honest nuance on price: a GPT-5.5 output token ($30 per 1M) is actually more expensive than Opus's ($25). Codex wins not on price per token but by spending fewer tokens. That's why the final bill per task often comes out cheaper — but not because it's "cheaper per token".

How to tell it worked: you run routine work and long loops through Codex, and high-stakes code and reviews through Claude; the choice follows the task, not your habit of using one tool.

Common mistakes:

  • Dragging high-stakes code into Codex to save money — you'll save tokens and get more rework.
  • Keeping everything on Claude "out of habit" and then being surprised by token spend on routine work.

Step 3 — Inside Claude: Opus by default, Fable selectively, opusplan for coding

Once you've decided the task is a "Claude one", pick the model within the line-up:

  • Opus 4.8 — the default, the workhorse. Code generation, refactoring, bug fixes — same result as Fable, at half the price. /model opus.
  • Fable 5 — selectively, exactly twice the price of Opus ($10/$50 against $5/$25). By Artemy Miller's analysis it pays for itself on three tasks: (1) security review of your own code, (2) an implementation plan several steps ahead, (3) walking through the user journey. Switch it on for the task — and back to Opus. /model fable.
  • opusplan — for coding with planning: Opus thinks in plan mode, and Claude Code switches the implementation over to Sonnet (faster and cheaper). /model opusplan.

Fable's gotchas (honestly):

  • Frame a security review as defending your own repository ("find vulnerabilities in my code"), not as an attack ("write an exploit") — Fable has strict cyber classifiers: in Claude Code an "attacking" request quietly falls back to a weaker model, and on the API it comes back as stop_reason: refusal. And officially Fable's gains in bug finding do NOT extend to security analysis — that's the author's heuristic, not a guarantee.
  • Fable requires 30-day data retention: under strict zero-data-retention it's hidden in /model, and on the API such a request returns a 400.

🆘 Rescue prompt

Paste this for yourself (or straight to the agent) as a rule for picking the tool and model per task:

Task: <describe the task>.
Pick the tool and model by this rule:
- a long agentic run, terminal/DevOps, a mass refactor or bug fixes,
  where saving tokens matters → Codex (GPT-5.5), it's terser;
- code with a high cost of error, where edge cases have to be right the first time,
  architecture → Claude Code on Opus 4.8;
- security review of my own code / a plan for a complex feature / the user journey
  → Claude Code on Fable 5 (expensive, but it pays off);
- coding with a separate planning phase → the opusplan mode (Opus plans, Sonnet writes).
Answer in one line: tool + model — and why.

💎 Depth and value

  • Token efficiency ≠ quality. Codex saves tokens through terseness; Claude spends more because it does more work per pass (error handling, edge cases, less rework). Count the cost of the TASK: price per token × number of tokens. The "~4x" figure is a third-party benchmark (Morphllm/Builder.io, Figma→code: Codex 1.5M vs Claude Code 6.2M), and on earlier models at that (GPT-5.3-Codex vs Opus 4.6), not a universal law. Verify it on your own work.
  • The prices, honestly (2026-07-14): GPT-5.5 — $5/$30, Opus 4.8 — $5/$25, Fable 5 — $10/$50 per 1M tokens (input/output). A GPT-5.5 output token costs more than an Opus one — Codex's savings live purely in token volume, not in the per-unit price.
  • A Codex gotcha: GPT-5.5 is the Codex default only when you sign in with a ChatGPT account; with your own API key (BYOK) it isn't available yet, and Codex falls back to GPT-5.2-Codex. If you're budgeting on your own key, that changes the price picture.
  • Inside Claude the rule stands: Opus by default, Fable only for security review / planning / the user journey, opusplan for coding. For API access and Anthropic's current prices, see the "Anthropic API" card in the qvib base.

Читать по-русски →