← All writing

Claude Code vs Codex: which coding agent to pick in 2026

Claude Code and OpenAI Codex compared on price, free access, usage limits, where they run and open source, with a plain way to choose between them.

By Branislav · · 6 min read

Short answer: both start at $20 a month, so price is not what decides it. Pick Claude Code if you want Claude models and an agent that works through a whole repo with you. Pick Codex if you already pay for ChatGPT, want a free or $8 way in, or want a coding agent whose command line tool is open source. If you can afford one month of each, try both on the same task. Prices and limits checked on 25 Nov 2026.

A note on bias first. I build AfterPrompt with Claude Code every day. I have tried to be fair, and I say where Codex is ahead.

What are Claude Code and Codex?

Both are coding agents. You describe a task in plain English, and the agent reads your code, edits files and runs commands until the task is done. You review the result. That is the difference from autocomplete: you hand over a task, not a line.

Claude Code is Anthropic's agent. It started in the terminal and now also runs in VS Code (which means Cursor too), JetBrains IDEs, a desktop app and the web at claude.ai/code, including the Claude phone apps. Cloud sessions need no local setup, and scheduled cloud tasks keep running with your computer off.

Codex is OpenAI's agent. It runs in the ChatGPT desktop, web and mobile apps, as the Codex CLI, as an IDE extension, in Codex Cloud and as a GitHub Action.

So both are now everywhere. The real differences are in price, limits, models and licence.

How do Claude Code and Codex compare?

Claude CodeCodex
Made byAnthropicOpenAI
Where it runsTerminal, VS Code, JetBrains, desktop app, web, phoneChatGPT desktop, web and mobile, CLI, IDE extension, cloud, GitHub Action
ModelsClaude (default Opus 5.5; also Sonnet 5.5, Haiku 5.5)OpenAI GPT-6 family (Astra, Sol, Luna, Terra)
Free way inNoYes, a limited model in the desktop app, subject to rollout
Entry planClaude Pro, $20 a monthChatGPT Plus, $20 a month
Cheaper optionNoneChatGPT Go, $8 a month (same limited access as Free)
Open sourceNoThe CLI is, under Apache 2.0
Published limitsMultiples of Pro (5x, 10x)Message ranges per model per 5 hours

How much do Claude Code and Codex cost?

Here are the plans that include each agent, from the official pricing pages on 25 Nov 2026.

Claude Code is included in Claude Pro, Max, Ultra, Team and Enterprise. It is not in the free Claude plan.

  • Pro: $20 a month, or $17 a month billed yearly.
  • Max: $100 a month for 5 times Pro usage.
  • Ultra: $200 a month for 10 times Pro usage per week, with no 5 hour limit for verified accounts.
  • Team: $25 per standard seat, $125 per premium seat (less if billed yearly).

You can also pay per use with an Anthropic API key instead of a plan.

Codex is included in every ChatGPT plan, with very different access.

  • Free and Go ($8): only the GPT-6 Luna model in the desktop app, and OpenAI says it is subject to rollout.
  • Plus: $20 a month for the full set (web, CLI, IDE extension, iOS).
  • Pro: tiers at $100, $200 and $500 a month.
  • Business: $25 per user a month, or $20 billed yearly.

An OpenAI API key also works with the CLI and IDE extension, but not with the cloud features.

Which has better usage limits?

This is the question people ask most, and the honest answer is that you cannot compare them on paper.

OpenAI publishes ranges. On Plus, for example, it estimates 17 to 180 local messages per 5 hours with GPT-6.2 Sol and 350 to 3,000 with the lighter GPT-6 Luna. Pro plans have no 5 hour limit at the moment, and weekly limits may apply.

Anthropic publishes multiples, not numbers. Max is 5 times Pro and Ultra is 10 times Pro. How fast you hit a limit depends on the model, how long the session is and how big your files are.

What I see in practice: long sessions on the strongest Claude model use up Pro quickly. If you plan to run Claude Code for hours every day, budget for Max. Blog roundups of Reddit threads say Codex limits feel roomier at the same $20. Treat that as opinion, not a measurement.

Which writes better code?

There is no fair public answer. Benchmark numbers change with every model release, and vendors pick the ones that flatter them. I would not choose on a benchmark.

What matters more is how the agent works with you:

  • Claude Code asks before it edits files or runs commands, unless you allow more. It is good at planning a change first, and plan mode makes that explicit. It reads a CLAUDE.md file in your repo for your rules, or AGENTS.md if that is what you have.
  • Codex works in a sandbox with approval modes you choose, and its cloud tasks run separately from your machine. The CLI is open source, so you can read its code.

The best test is your own repo. Give both the same real task, such as "add a password reset page", and compare the diffs. Keep the prompt identical. Write down what worked and what didn't. That note is worth more than any review, including this one.

When is Claude Code the better pick?

  • You want Claude models. Claude Code runs Claude models only, with Opus 5.5 as the default.
  • You already pay for Claude Pro, so trying it costs nothing extra.
  • You like a terminal first agent that plans, asks and then works through many files.
  • You want to extend it with Claude skills, hooks and MCP servers.

When is Codex the better pick?

  • You already pay for ChatGPT Plus.
  • Your budget is zero or $8. Claude Code has no free way in.
  • You want the CLI to be open source.
  • You want published per model estimates, not just multiples.

Can you use both?

Yes, and plenty of builders do. A common setup is one agent for the main work and the other for a second opinion on a tricky change. Both read plain files in your repo, so a shared AGENTS.md keeps your rules in one place.

If you are also choosing an editor, our Cursor vs Claude Code vs Windsurf guide covers the editor side, and Cursor alternatives lists the other options with prices. If you are new to building with agents, start with the vibe coding first app guide and read the common vibe coding mistakes before your first big task.

AfterPrompt has pages for Claude Code and Codex where builders share what they made with each, with the prompt and what didn't work. It is small for now, but every post shows the real setup.

Frequently asked questions

Is Claude Code free?

No. Claude Code needs a paid Claude plan (Pro at $20 a month or higher) or an Anthropic API account. The free Claude plan does not include it.

Is Codex free?

Partly. ChatGPT Free and Go include Codex in the desktop app with the GPT-6 Luna model only, subject to rollout. The full Codex (CLI, IDE extension, cloud) starts with ChatGPT Plus at $20 a month.

Is Claude Code open source?

No. There is a public GitHub repo, but the tool is not open source, and use is under Anthropic's commercial terms. The Codex CLI is open source under the Apache 2.0 licence.

Which is cheaper, Claude Code or Codex?

At the entry level they cost the same, $20 a month. Codex is cheaper if you only need the limited free or $8 access. For heavy daily use, compare Claude Max at $100 with ChatGPT Pro from $100.

Keep reading

Join the conversation.

For anyone who wants to understand AI.
See what people make with it. Ask them. Meet them.
Free to join. Browse today.

Create your profile