No-fluff comparisons of AI tools. Benchmarked. Honest. Data-driven.

claude code vs codex

Claude Code vs Codex: Which to Pay For in 2026

Claude Code vs OpenAI Codex from daily use: 2026 plan prices and limits, default permissions, and how each one reads AGENTS.md when both work on one repo.

Marcus Webb·2026-10-10
Sponsored

The exact content system behind aitoolsdigest.com — Python scripts that publish 1,000 articles for $0 API cost. SEO Content OS, one-time $34.

See how it works →

Both agents read the same file. They do not read it the same way.

The repo this site is built from keeps its rules in one AGENTS.md at the root: 8,424 bytes covering title budgets, how the IndexNow key is checked, and a flat instruction never to push with --no-verify. Codex picks that file up on every run without being asked. Claude Code reads it only when nothing named CLAUDE.md is in the way. And each tool has its own personal override file that can make it quietly stop reading the shared one. I found that out the slow way, by watching two agents on the same branch follow two different sets of rules.

The Claude Code vs Codex comparisons ranking for this keyword run from about 1,100 to 4,200 words. All of them cover what each tool is, the plan prices, which one feels faster, and when to pick which. Two of the three lean hard on benchmark tables. None of them looks at the instruction files, which is the first thing that goes wrong when a team runs both.

If you are comparing more than two agents, our ranked list of AI coding agents covers the wider field. If Cursor is the other contender, read Claude Code vs Cursor instead.

What each one actually is

Codex is OpenAI's coding agent, and it ships inside ChatGPT. There is a CLI, an IDE extension, and a cloud mode where you hand it a task from the ChatGPT interface and it works in a container while you do something else. It runs on OpenAI's models only. On Plus, that means GPT-6.1 Sol for hard work and GPT-6 Luna for cheap, fast passes.

Claude Code is Anthropic's agent. It started in the terminal and now also runs in VS Code, JetBrains, a desktop app and the browser. It runs on Claude models only. You describe the job, it reads the codebase, edits files, runs the tests, and shows you the diff.

On paper they have converged almost completely.

In practice the defaults differ, and defaults are what you live with. Codex is built to be left alone inside a fence. Claude Code is built to check with you, unless you build the fence yourself.

The short answer

Claude CodeCodex
Comes withA Claude subscriptionA ChatGPT subscription
Cheapest way inClaude Pro: $20 a month, or $17 billed yearlyChatGPT Go: $8 a month, for lightweight tasks
Serious-use planMax at $100 or $200 a monthPro at $100, $200 or $500 a month
Team planTeam and Enterprise plansBusiness: $20 per user a month, billed yearly, 2+ users
How limits workFive-hour session limit plus a weekly cap, shared with the Claude appsFive-hour limit plus weekly limits on Plus; Pro has no five-hour limit
Out-of-the-box permissionsReads freely, asks before edits and most shell commandsEdits and runs commands inside the workspace, asks to go beyond it
Project instructionsCLAUDE.md; AGENTS.md only when no CLAUDE.md existsAGENTS.md, from the git root down, capped at 32 KiB

Prices are from claude.com and OpenAI's Codex pricing page as of October 2026.

What the plans actually buy you

Both companies sell the agent as part of a chat subscription, so the plan you pick is a usage budget more than a feature list. On the Claude side, Claude Code and the Claude chat apps draw on one quota. A long afternoon of asking Claude about a contract eats into the pool your refactor needs.

OpenAI publishes ranges rather than promises. On Plus, its estimate for a five-hour window is 15 to 160 messages with GPT-6.1 Sol and 350 to 3,000 with GPT-6 Luna, and it says weekly limits apply without giving a number. A tenfold spread on the expensive model tells you how much depends on the size of the task. Local CLI messages and cloud tasks share the same allowance, so firing off three cloud jobs before lunch is not free just because they run somewhere else.

Anthropic's structure is similar: a session limit that resets every five hours, a weekly cap on top, and extra usage at API rates if you switch it on with a monthly ceiling. Max at $100 is where Claude Code stops feeling rationed.

The difference is at the top. OpenAI says its Pro plans currently have no five-hour limit at all, and offers a $500 tier with an Ultrafast mode. If your problem is being cut off mid-task at 3 p.m., that sentence is worth more than any benchmark.

Default permissions, and who does what without asking

Codex's local default is a sandbox mode called workspace-write with an approval policy of on-request. It can read files, edit inside the working directory, and run routine commands there on its own. It asks before editing anything outside the workspace and before running commands that need the network. So npm test just happens, and npm install stops for a yes.

Claude Code's default mode reads freely and asks before it edits a file or runs most shell commands. That is a lot of prompts on a long task. You can switch to accept-edits mode, or turn on its sandbox, which lets Bash commands run without asking while the operating system limits writes to the working directory and a temp folder. The first time a command reaches for a new network domain, it prompts you.

Neither default is wrong. Codex's suits handing over a task and walking off. Claude Code's suits a repo where you want to see every command before it runs, which on a production codebase is most of the time.

Anthropic's docs say it plainly: CLAUDE.md is context, and a sentence in it enforces nothing. Claude Code has PreToolUse hooks for that. Codex has the sandbox and the approval policy. Use them for anything that truly must not happen.

One AGENTS.md, two readers

This is the part the other comparisons skip.

Codex builds its instructions when a run starts. It reads a global AGENTS.md from ~/.codex, then walks from the git root down to your current directory, taking at most one file per directory and joining them in order, so a file nearer your working directory wins any conflict. In each directory it looks for AGENTS.override.md first and AGENTS.md second.

That one-file-per-directory rule is the trap. If a teammate drops an AGENTS.override.md at the repo root to try something out, Codex reads that file in place of the shared one. The team's rules are gone for anyone with the override, and nothing tells you. It is the mirror image of what a CLAUDE.local.md does to Claude Code, which by default reads AGENTS.md only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in your working directory or above it.

Then there is the size cap. Codex stops adding instruction files once the combined text reaches 32 KiB by default. Our root file uses about a quarter of that, so it is safe. A monorepo with a long global file, a long root file and a nested one per package can hit the limit, and the files that get dropped are the deepest ones, which are the most specific to the code you are touching. You can raise it with project_doc_max_bytes in ~/.codex/config.toml.

What I now set up on every repo that both agents touch:

  1. Keep the real rules in AGENTS.md at the root. Codex reads it natively.
  2. Make CLAUDE.md a single line, @AGENTS.md, so Claude Code imports the shared file even when someone has a CLAUDE.local.md.
  3. Add AGENTS.override.md and CLAUDE.local.md to .gitignore, and treat either one appearing in a review as a question to ask.
  4. After changing instructions, ask each agent to summarize the rules it loaded. OpenAI's docs suggest exactly that check for Codex: codex --ask-for-approval never "Summarize the current instructions."

Step 4 takes thirty seconds. It is how I caught the override.

Which one to pay for

Pay for Codex if you already pay for ChatGPT, if you like handing off a well-scoped issue and coming back to a finished branch, or if hitting a usage wall mid-afternoon is your real complaint. Plus is enough to learn whether it fits. Pro is the only plan from either company with no five-hour limit right now.

Pay for Claude Code if you want to approve each step on a codebase you care about, if hooks matter to you, or if your team already lives in Claude. Start on Pro and expect to move to Max at $100 once you give it real refactors.

Pay for both only after you fix the instruction files. My split: Codex for the tickets I could describe in two sentences, Claude Code for anything where I would want to read the plan first. Whichever writes the code, a second reviewer helps, and our AI code review comparison covers the tools that do that.

Frequently Asked Questions

Is Codex or Claude Code better for coding?

Codex is better if you want to hand off a task and let it work inside a sandbox without approving each command, and it comes with a ChatGPT plan you may already pay for. Claude Code is better if you want to approve edits and commands as they happen, or need hooks that block specific actions. Both run in the terminal, in IDEs and in the cloud.

How much do Codex and Claude Code cost in 2026?

Codex is included in ChatGPT plans: Go at $8 a month, Plus at $20, Pro at $100, $200 or $500, and Business at $20 per user a month billed yearly. Claude Code is included in Claude Pro at $20 a month, or $17 billed yearly, and in Max at $100 or $200 a month.

Does Codex read CLAUDE.md?

Not by default. Codex reads AGENTS.override.md or AGENTS.md in each directory from the git root down to your working directory. You can add other filenames with project_doc_fallback_filenames in ~/.codex/config.toml, but those are used only in directories that have no AGENTS.md.

Can Claude Code and Codex share one AGENTS.md?

Yes. Keep the shared rules in AGENTS.md, which Codex reads natively, and make CLAUDE.md a one-line file containing @AGENTS.md so Claude Code imports it. Keep AGENTS.override.md and CLAUDE.local.md out of the repo, because either one can stop its tool from reading the shared file.

Get free AI tool updates

Weekly roundup of the best AI tools, no spam.

BUILD WITH AI

OpenClaw Starter Kit

Ready-to-use Next.js templates with AI features baked in. Ship your AI app in days, not months.

Get Started — $6.99One-time payment

This site runs on SEO Content OS.

Python scripts that publish 1,000 articles for $0 API cost. The exact system behind aitoolsdigest.com. One-time $34.

See how it works — $34 →
Featured tool
SEO Content OS
See how it works →