Claude Code vs Codex: An Honest Comparison

Claude Code and Codex are the two terminal coding agents most developers are actually choosing between. They have converged on a strikingly similar shape, so the real differences sit in the safety model, the pricing structure and whether a free tier exists at all.

Codex

Codex vs Claude Code: What You’ll Learn

This comparison covers what Codex is today, how each tool handles permissions, project memory, models and MCP, and what each actually costs. It ends with a straight recommendation rather than a shrug.

Everything here was checked against both vendors’ current documentation (Codex and Claude Code) and against Codex CLI 0.145.0 and Claude Code 2.1.220 installed side by side, because both products moved significantly in 2026 and older comparisons describe tools that no longer exist in that form.

What Codex is now

Codex began as a model and is now a family of surfaces. There is a CLI, an IDE extension, a cloud environment and an app. The CLI is the part that competes directly with Claude Code: it lets you inspect code, make changes, run commands and automate repeatable work without leaving your terminal.

Install is a single command, with npm and Homebrew alternatives, and it runs on macOS, Linux and Windows:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

The subcommand surface tells you a lot about the design. codex starts an interactive session, codex exec runs non-interactively for automation, codex review performs a code review, codex mcp manages MCP servers, codex cloud moves work to the cloud, and codex apply applies the agent’s latest diff to your working tree as a git apply.

That last one is a genuinely different idea. Codex treats the diff as an artefact you can hold and apply deliberately, which fits its cloud story: work happens elsewhere, and you decide when it lands locally.

The safety models are not the same shape

This is the sharpest architectural difference, and it is where the two tools disagree about what a developer should be asked.

Codex splits the question in two. --ask-for-approval sets an approval policy governing when the model needs human sign-off before executing a command, with untrusted running only recognised-safe commands like ls, cat and sed without asking. Separately, --sandbox selects the execution boundary with three values: read-only, workspace-write and danger-full-access.

Claude Code collapses both into one axis of six named permission modes: manual, acceptEdits, plan, auto, dontAsk and bypassPermissions. You cycle them with Shift+Tab mid-session rather than deciding at launch.

Neither approach is obviously better, and the trade is real. Codex’s two-axis model is more precise: you can grant broad approval while keeping a tight sandbox, which is a combination Claude Code cannot express directly. Claude Code’s single axis is faster to reason about under pressure and switchable without restarting, which matters more than it sounds when you are mid-task.

Two capabilities have no clean equivalent on the other side. Claude Code’s plan mode produces a written plan you approve before any edit, and its auto mode runs a separate classifier model that reviews actions before they execute. Codex ships a real OS-level sandbox via codex sandbox, which Claude Code approximates with permission rules rather than process isolation.

Project memory: AGENTS.md against CLAUDE.md

Both tools read a markdown file from your repository to learn how the project works, and both create it with an /init command. Codex uses AGENTS.md. Claude Code uses CLAUDE.md.

The convergence here is more interesting than the difference. Two competing vendors independently landed on the same idea: a plain markdown file, committed to the repository, that any teammate can read and edit. Neither chose a proprietary format or a hidden dotfile database.

The practical consequence is that maintaining both is annoying but not hard. If your team uses both agents, you will end up with two files describing the same conventions. Keeping them in sync is a real cost, though a small one, and it is worth deciding deliberately rather than letting them drift.

Models and reasoning effort

Both expose model choice through a /model command and both let you tune how hard the model thinks before answering. Codex offers reasoning effort levels; Claude Code has an effort setting reached through /effort or /model.

The model families differ in ways that matter for cost more than capability. Codex publishes a credit rate card across its GPT-5.6 tiers, with output priced at six times input and cached input at a tenth of standard input. Claude Code bills tokens against a subscription seat allowance or per token on the API, with prompt caching applied automatically.

Both therefore reward the same habit: keep context small, clear between unrelated tasks, and let caching work. The economics are close enough that model choice is unlikely to be the thing that decides between them.

MCP is supported on both sides

Both tools speak the Model Context Protocol, which is the quiet answer to a lot of lock-in worry. Codex manages servers with codex mcp and can connect local or remote servers with authentication where needed. Claude Code manages them with claude mcp add and the same stdio and HTTP transports.

Codex goes one step further in an interesting direction: codex mcp-server starts Codex itself as an MCP server over stdio. That makes the agent something another agent can call, rather than only a consumer of tools.

For anyone choosing between the two, this is the most reassuring finding in the comparison. The integrations you build are portable. An MCP server written for one works with the other, so the tool choice does not strand your tooling investment.

Local work and cloud work

Both products now run in two places, and both let you move between them. Codex has codex cloud for moving work off your machine and browsing cloud chats, with results applied back locally through codex apply. Claude Code has a web surface and, in the other direction, Remote Control for driving a session on your own machine from a browser or phone.

The emphasis differs. Codex leans toward the cloud as the place work happens, with the local CLI as one client onto it. Claude Code leans toward the local session as the source of truth, with the cloud as an extension. Neither is a hard rule, but it shows in which flows feel native.

If your work involves repositories you cannot push to a vendor’s cloud, that emphasis is worth weighing early rather than discovering later.

What each one costs

Here the two diverge in a way that genuinely decides the question for some people.

Codex has a free tier. It is included in ChatGPT Free at zero cost, then Go at eight dollars a month, Plus at twenty, and Pro from one hundred with five or twenty times the Plus rate limits. Business is twenty dollars per user per month billed annually, or twenty five monthly.

Claude Code has no free tier. Access requires a paid Claude subscription, a Claude Console account billed per token, or a cloud provider account. There is no zero-cost path.

Both meter in a rolling five-hour window, which is a striking convergence. Codex publishes indicative message counts per window per tier, and both vendors publish a per-developer monthly figure: OpenAI cites roughly one hundred to two hundred dollars, Anthropic roughly one hundred fifty to two hundred fifty with ninety percent of users under thirty dollars per active day.

Treat every figure here as a snapshot. Codex moved from per-message to token-aligned pricing in April 2026, and both vendors keep current numbers on their own pricing pages. Check those before making a budget decision on the strength of any article, including this one.

How much the two have converged

It is worth pausing on how similar these products have become, because the similarities are what make the choice low-risk rather than high-stakes.

Both are terminal-first agents that read your repository, propose edits, run commands and iterate against test output. Both read a committed markdown file to learn project conventions. Both offer a non-interactive mode for automation, a resume flow for returning to earlier sessions, and a review capability. Both meter usage in a rolling five-hour window rather than a monthly bucket, so a heavy afternoon affects the rest of your afternoon rather than the rest of your month.

Both also solved the same context problem the same way. Long sessions accumulate history, history costs tokens on every subsequent request, and both vendors’ guidance says to clear between unrelated tasks rather than letting one session run all day. Prompt caching softens the cost on both sides, and on both sides the first request after a long break misses that cache and pays full price.

This convergence is not coincidence. These teams are solving an identical problem with access to similar research, and the shape that works is being discovered rather than invented. For a developer choosing today, it means the skills transfer. Learning to write a good project memory file, keep context small, and review diffs carefully makes you better at both.

What switching actually costs

Because the choice is reversible, it is worth knowing what a switch would really involve rather than treating the decision as permanent.

The portable parts are the largest. Any integration built against the Model Context Protocol moves with you untouched. Your git history, your tests, your review habits and your understanding of how to brief an agent all move too. None of that is vendor-specific.

The parts that need rewriting are smaller than they look. The project memory file has to be duplicated under the other name, though the content largely survives a copy and a light edit. Any automation calling one CLI non-interactively needs its invocation changed, since the flags differ. Shell aliases and editor integrations need repointing.

The genuinely awkward part is the safety configuration, because the two express it differently enough that there is no mechanical translation. A carefully tuned set of permission rules on one side does not map cleanly onto an approval policy plus a sandbox mode on the other. You have to re-express the intent rather than convert the config.

None of this is a week of work. For most teams a switch is an afternoon of setup and a few days of adjusting habits, which is a useful thing to know when the decision starts feeling weightier than it deserves.

Who should pick which

A comparison that refuses to recommend anything is not much use, so here is the honest split.

Choose the OpenAI option if you want to trial an agent at zero cost, if you need real process-level isolation rather than rule-based permissions, if your workflow already centres on the cloud and pull requests, or if your team is already standardised on ChatGPT seats and adding another vendor is friction you do not need.

Choose Claude Code if you regularly work in unfamiliar code where catching a wrong approach early matters more than constraining commands, if you want to change how much autonomy the agent has without restarting your session, or if you want a classifier reviewing actions rather than a static rule set deciding them.

If neither description fits your situation more than the other, the free tier makes the tiebreak obvious: start where trialling costs nothing, and switch later if the workflow disagrees with you.

A Worked Example: the same task in both agents

Take a task with real risk: adding retry logic to a service, in a repository you do not know well. Run it through both and the design philosophies show up immediately.

In Claude Code you would cycle to plan mode with Shift+Tab before saying anything substantive. Claude reads the service and its tests and returns a written plan. You read a paragraph, correct the approach if the blast radius looks wrong, then approve into manual edit review so each change appears one at a time.

In Codex you would set the boundary at launch instead, because that is where Codex wants the decision:

codex --sandbox workspace-write --ask-for-approval untrusted

That combination lets Codex read freely and write inside the workspace, while anything outside the trusted command set still needs your sign-off. You are not reviewing a plan; you are constraining an environment and letting the agent work inside it.

The difference in feel is real. Claude Code asks you to think first and then trusts you to release it. Codex asks you to draw a fence and then works inside it. On unfamiliar code the plan is more useful, because the failure you are guarding against is a wrong approach rather than a dangerous command. On a task you understand well but do not want interrupted, the fence is better.

Afterwards both give you a review path. Codex has codex review as a first-class non-interactive subcommand. Claude Code has a code review flow and the diff in your working tree. Either way the last step is the same: read the change yourself.

Codex vs Claude Code: Common Mistakes to Avoid

Most bad choices between these two come from comparing the wrong things.

  • Comparing model benchmarks instead of workflow. Both run capable frontier models. The daily experience is decided by the permission model, the memory file and how each handles long sessions, not by a leaderboard.
  • Assuming MCP work is wasted if you switch. Both speak MCP over the same transports. Servers you build are portable, and that is the strongest argument against agonising over the decision.
  • Reading a 2025 comparison. Codex moved to token-aligned pricing in April 2026 and Claude Code’s permission modes were renamed and extended through the 2.1.x line. Anything older is describing different products.
  • Ignoring the free tier when evaluating for a team. Codex on ChatGPT Free costs nothing to trial. Claude Code has no equivalent, so a pilot has a real budget line from day one.
Codex key concepts

Codex vs Claude Code: Best Practices

  • Trial both against the same real task. Not a toy repository. The differences only surface on code with existing conventions and tests.
  • Match the safety model to your risk. If you need process-level isolation, Codex’s sandbox is the more honest answer. If you need to catch wrong approaches early, plan mode is.
  • Keep both memory files if you run both. AGENTS.md and CLAUDE.md serve the same purpose, and letting one drift produces an agent that follows conventions the other ignores.
  • Decide the cloud question first. If your repositories cannot leave your infrastructure, that constrains the choice more than any feature comparison.
  • Budget from the published per-developer figures, not the plan price. Both vendors publish monthly ranges well above their entry subscription cost.

Codex vs Claude Code: Frequently Asked Questions

Is Codex better than Claude Code?

Neither is better across the board, and anyone claiming otherwise is selling something. Codex has a free tier, an OS-level sandbox and a cloud-first flow. Claude Code has plan mode, a classifier-backed auto mode and mid-session permission switching. Pick on which of those you actually need.

Is Codex free?

Yes, at a basic level. Codex is included in ChatGPT Free at no cost, with paid tiers from eight dollars a month for higher limits. Claude Code has no free tier, so this is the clearest practical difference between them.

Can Codex and Claude Code use the same MCP servers?

Yes. Both implement the Model Context Protocol over stdio and HTTP transports, so a server built for one works with the other. Codex can additionally run as an MCP server itself with codex mcp-server.

Do they use the same project memory file?

No. Codex reads AGENTS.md and Claude Code reads CLAUDE.md, both created with an /init command. If you use both agents you will maintain both files.

Which one is cheaper?

Codex is cheaper to start with because of the free tier and an eight dollar entry plan. At professional usage the two converge: OpenAI cites roughly one hundred to two hundred dollars per developer per month and Anthropic one hundred fifty to two hundred fifty. Check both pricing pages before deciding, since these figures move.

Codex and Claude Code have converged on the same shape and disagree on the interesting part: whether safety comes from a fence you draw or a plan you approve. Codex wins on free access and process isolation. Claude Code wins on planning and mid-session control. Because both speak MCP, choosing wrong is cheap to undo.

Continue Learning

If this comparison helped you pick Claude Code, the next step is Getting Started with Claude Code: install it, connect your project, and run your first real session before going deeper.