Claude Code vs Codex: Which AI Coding Agent to Pick in 2026

Claude Code vs Codex is a closer fight than the Twitter takes suggest. Both are agents that read your repo, edit files, run commands and open pull requests. Both have a CLI, an IDE extension and a cloud mode. Both start at $20 a month. The real differences are in the details: how permissions work, how deep the customization goes, what the free tier looks like and how each one handles background work.

I should say upfront where I stand. I use Claude Code every day, on client work and on my own products. I have not used Codex as a daily driver, so I will not tell you which one writes better code. I have no benchmark of my own to show you, and I am not going to invent one. What I can do is compare the two on facts, using each vendor's own docs and pricing pages, which I checked on October 23, 2026. Where I give an opinion, it is about Claude Code, and I will label it.

If you are also weighing Cursor and Copilot, the Claude Code vs Cursor vs GitHub Copilot comparison covers all four tools. This post goes deeper on just these two.


Claude Code vs Codex: The Short Verdict

Claude Code is the better pick if you want deep customization (skills, hooks, subagents, plugins) and a terminal-first workflow, and I can vouch for it from daily use. Codex is the better pick if you already pay for ChatGPT, want a free or $8 entry tier, or want a cloud-first queue of tasks. Both start at $20 a month, so model preference and ecosystem decide it.

That is the whole answer in one paragraph. The rest of this post is the evidence, a feature table and a pick-by-situation list.


Claude Code vs Codex: Side-by-Side Table

Prices and plan names change often. I pulled everything below from Claude's pricing page, the Claude Code docs, the ChatGPT and Codex pricing page and the Codex docs, all on October 23, 2026. Check the pages before you pay.

Claude CodeOpenAI Codex
Made byAnthropicOpenAI
ModelsOpus 5.5 is the default on Pro, Max, Team and Enterprise. Sonnet 5.5, Haiku 5.5 and Fable 5.1 are one /model switch awayGPT-6.1 Sol and GPT-6 Luna on Plus and up. GPT-6 Sol and GPT-6 Astra are also in the usage table
Entry pricePro, $20/month ($17/month billed annually). Not on the free planIncluded in Free, Go ($8/month), Plus ($20/month) and up, with the free tiers limited
Heavy useMax from $100/monthPro at $100, $200 or $500/month
Team plansTeam standard seats $20/seat/month annual, $25 monthlyBusiness $20/user/month annual, $25 monthly
CLIclaude, installed with a native installer, Homebrew, WinGet or Linux package managerscodex, installed with a script, npm or Homebrew
Scriptingclaude -p for pipes and CIcodex exec for scripting and CI
Cloud and backgroundWeb sessions at claude.ai/code, claude --cloud, background agents, cloud scheduled tasksCodex Cloud tasks from web, mobile or desktop, codex cloud from the terminal
IDEVS Code and Cursor extension, JetBrains plugin (needs the CLI), desktop appVS Code, Cursor, Windsurf and VS Code Insiders extension, plus Xcode and JetBrains integrations
MCPYes, shared across all surfacesYes, STDIO and streamable HTTP, shared across app, CLI and IDE
PermissionsModes: default (Manual), acceptEdits, plan, auto, dontAsk, bypassPermissions, plus allow, ask and deny rulesSandbox modes plus approval policies, with an Auto preset
SandboxOptional Bash sandbox, off by defaultSandbox on, network off by default
Config fileCLAUDE.md (can read AGENTS.md)AGENTS.md
ExtensibilitySkills, hooks, plugins, subagentsSkills, plugins, subagents, rules

The Codex model list is a snapshot: the pricing page notes GPT-5.5 left Codex with ChatGPT sign-in on October 14, 2026.


Models: Opus 5.5 vs GPT-6.1 Sol

Claude Code uses Anthropic models. On Pro, Max, Team and Enterprise plans the default is Opus 5.5. You can switch to Sonnet 5.5, Haiku 5.5 or Fable 5.1 with /model, and the opusplan alias runs Opus in plan mode and Sonnet for execution. Fable is never the default, you pick it on purpose for the hardest, longest tasks. Several current models have a native 1M token context window.

Codex uses OpenAI models. On Plus and above, the pricing page lists GPT-6.1 Sol and GPT-6 Luna. Luna is the cheap, high-volume model: the usage table shows 350 to 3,000 local messages per five-hour period on Plus, against 15 to 160 for GPT-6.1 Sol. On the Free and Go plans, the pricing page says GPT-6 Luna at standard speed in the desktop app, subject to rollout. You pick the model and the reasoning effort in the CLI.

If model quality is your tiebreaker, run the same three real tasks through both tools on the cheap plans and compare the diffs. Every "Claude beats GPT" post is a snapshot of one person's tasks and goes stale in weeks. Codex also lists Fast (2.5x included usage, 2x credits) and Ultrafast (8x, 6x, on the $500 Pro tier) speed modes, a latency knob Claude Code does not advertise the same way.


Pricing and Plans

Here is where the two diverge the most.

Claude Code is on paid plans only. The Claude pricing page says it is included in all paid plans, and the Free plan does not have it. Pro is $20 a month ($17 on annual billing). Max starts at $100 a month with 5x or 20x Pro's usage. Team standard seats are $20 a seat annual or $25 monthly, and premium seats are $100 annual or $125 monthly. You can also skip the subscription and pay API rates through an Anthropic Console account. Usage limits run on a rolling five-hour window with weekly limits on top, and that is the thing heavy users run into.

Codex is included in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise. The pricing page breaks it down like this:

  • Free ($0): quick coding tasks.
  • Go ($8/month): lightweight coding.
  • Plus ($20/month): Codex on web, CLI, IDE and iOS, plus cloud features like automatic code review and Slack. You can add ChatGPT credits.
  • Pro (from $100/month): tiers at $100, $200 and $500. The page says Pro currently has no five-hour limit.
  • API key: pay API prices. CLI, SDK and IDE only, no cloud features.

Plus usage is metered in local messages per five-hour window, and the page calls those numbers estimates. Past the included amount, Codex bills credits per million tokens, and rates differ a lot by model.

In practice: only Codex lets you try an agent without a card. At $20 either vendor gives you an agent, and at the heavy end both have a $100 tier, so usage limits decide: test on the cheap plan first. If you already pay for ChatGPT or Claude, the matching tool is effectively a free add-on.


CLI and IDE: Where Each One Runs

Both tools are CLI-first and both run in more places than the terminal.

Claude Code runs in the terminal, in VS Code (the extension also installs into Cursor), in JetBrains IDEs, in a desktop app and on the web. All of these connect to the same engine, so CLAUDE.md files, settings and MCP servers work across them. The JetBrains plugin needs the CLI installed separately. The CLI is composable: tail -200 app.log | claude -p "..." works, and so does running it in CI or GitHub Actions. If you are new to it, how to use Claude Code walks through the first week.

Codex has a CLI for macOS, Linux and Windows (installed with a script, npm or Homebrew), an IDE extension, a ChatGPT desktop app and a cloud mode on the web. The CLI covers interactive sessions, codex exec for scripting and CI, codex resume for saved chats, codex --search for live web search and codex cloud to send work to the cloud. It can also review uncommitted changes, a commit or a base branch without touching your working tree. The IDE extension supports VS Code, Cursor, Windsurf and VS Code Insiders, and the docs say Xcode and JetBrains have their own integrations. The Xcode support is a real edge if you build for Apple platforms, since Claude Code has no Xcode integration listed.

My honest take: on paper the two are very close, and the feature lists are converging.


Cloud and Background Tasks

This is where the two have different personalities.

Codex Cloud is built around delegation. You pick an environment (the repos, tools and access a project needs), describe a task and send it. Each task gets its own workspace, several can run in parallel from one environment, and tasks keep running while your computer sleeps. You review the changed files and test results, ask for follow-ups in the same task, then commit or open a pull request. You can start, review and continue tasks from web, mobile or desktop, and you can start one from the terminal with codex cloud. The docs say you control which services an environment can reach, and network secrets supply credentials for approved HTTPS services.

Claude Code has a few overlapping options. You can start a session on the web at claude.ai/code with no local setup, start a cloud session from the terminal with claude --cloud, and pull a web session back into your terminal with claude --teleport. Beyond that, background agents let you run several full sessions and watch them from one screen, and cloud scheduled tasks run on a schedule even when your computer is off. You can also mention @Claude in Slack with a bug report and get a pull request back.

The shape differs: Codex Cloud is one clear product (environment, queue, diff), while Claude Code covers the same ground with several features plus scheduling and Slack routing. For a deeper look at how these delegate unattended work, see the best background coding agents post.


MCP, Config Files and Extensibility

MCP. Both support the Model Context Protocol. In Claude Code, MCP servers are configured once and work across the terminal, IDE, desktop and web surfaces. In Codex, servers live in ~/.codex/config.toml (or a project .codex/config.toml in trusted projects), each in a [mcp_servers.<server-name>] table, and the app, CLI and IDE extension share that config. Codex supports STDIO servers and streamable HTTP servers, with bearer tokens or OAuth. You add one with codex mcp add. If you have built MCP servers for one tool, they should work in the other.

Instruction files. Claude Code reads CLAUDE.md, a markdown file in your project root that it loads at the start of every session. Its docs say that if your repo already has an AGENTS.md for other agents, Claude Code can read that in place of a CLAUDE.md. It also builds auto memory as it works. Codex reads AGENTS.md. It looks in ~/.codex for a global file, then walks from the project root down to the current directory, including at most one file per directory, with files closer to your working directory overriding earlier guidance. An AGENTS.override.md replaces the regular file in the same directory. Combined instructions are capped at 32 KiB by default, and Codex stops adding files once it hits the cap, so deep guidance can get cut off. Raise project_doc_max_bytes or split files across nested directories if that bites.

The practical upshot: if you run both tools on one repo, keep your shared rules in AGENTS.md and let Claude Code read it. Less drift.

Extensibility. Claude Code has skills, hooks (shell commands that run before or after actions), plugins, subagents and the Agent SDK. Codex lists skills, plugins, subagents and rules. I have not used Codex's versions, so I cannot compare depth. I did not find hooks in the Codex pages I read, so check that first if you rely on them.


Permissions and Sandboxing

This is the section where reading the docs changed my mental model, so it is worth spending time on.

Codex separates two ideas: a sandbox mode and an approval policy. Sandbox modes are read-only, workspace-write and danger-full-access. Approval policies are on-request, never and a granular table. The named preset is Auto, which is workspace-write with on-request. In a version-controlled folder, Codex launches in Auto, and in a folder without version control it starts in read-only. Network access is off by default. Web search defaults to cached results. The no-guardrails option is --dangerously-bypass-approvals-and-sandbox, alias --yolo.

Claude Code uses permission modes plus rules. The modes are default (shown as Manual, prompts on first use of each tool), acceptEdits, plan, auto (a background classifier checks actions instead of you), dontAsk and bypassPermissions. On top of that you write allow, ask and deny rules, and you can check them into version control or enforce them with managed settings. Separately, there is an optional Bash sandbox, built on Seatbelt on macOS and bubblewrap on Linux and WSL2. It is off by default, you turn it on with /sandbox, and it covers shell commands only. File tools, MCP servers and hooks run outside it. On native Windows, commands run unsandboxed unless you use WSL2.

So the defaults differ in spirit. Codex ships with an OS-level sandbox and network off, and then asks you only when it needs to step outside. Claude Code ships with prompts and leaves the sandbox as an opt-in, then gives you a finer rule system and more modes. Neither is wrong. Codex has the tighter out-of-the-box posture. Claude Code has the finer rule system and more modes.

Whichever you pick, do not jump straight to the bypass flag. The least-privilege permissions guide covers how to cut the blast radius for both.


Where Claude Code Wins

Here is where I would pick Claude Code, with the caveat that this is based on my daily use of it and on docs for the other side.

  • You want the deepest customization. Skills, hooks, plugins, subagents and the Agent SDK are all first-class. I lean on hooks and skills constantly.
  • You want precise permission rules. Allow, ask and deny rules with pattern matching, plus managed settings for teams, give fine-grained control.
  • You like a terminal-first loop for big tasks. In my use it handles long multi-file refactors and debugging sessions with little hand-holding. That is my experience, not a benchmark.

Where Codex Wins

Here is where the docs and pricing page point to Codex.

  • You want a free or cheap way in. Free and Go ($8/month) include Codex. Claude Code has no free plan.
  • You want a cloud-first task queue. Codex Cloud is the center of the product: environments, parallel tasks, background runs and a reviewable diff, started from web, mobile, desktop or terminal.
  • You build for Apple platforms. The Codex docs list an Xcode integration.
  • You want stricter defaults. Sandbox on, network off and a clear mode/policy split.

Claude Code vs Codex vs Cursor

Cursor is an editor (a VS Code fork) with its own CLI and cloud agents. Claude Code and Codex start in the terminal and reach into editors second. For UI work inside an editor, Cursor fits better. For large, multi-file or autonomous work, Claude Code or Codex fits better. I use Claude Code and Cursor together. The hub comparison has the full breakdown.


Which One Should You Pick? A Situation List

  • You already pay for ChatGPT Plus: use Codex first. It is included, so trying it costs nothing.
  • You already pay for Claude Pro: use Claude Code first, for the same reason.
  • You have no subscription and no budget: Codex on the Free or Go plan is the only free-ish entry.
  • You want hooks, skills and a deep plugin system: Claude Code.
  • You want to throw a backlog of well-scoped tasks into a queue and review diffs: Codex Cloud is built for exactly that. Claude Code web sessions and background agents can do it too.
  • You build iOS or macOS apps in Xcode: check Codex's Xcode integration.
  • You are not sure: pay for one $20 plan, run three real tasks, and then try the other. Model preference is personal and it changes with each release.

Frequently Asked

Is Claude Code better than Codex? I use Claude Code daily and like it for large multi-file work and customization, but I have not used Codex daily, so I will not rank them on output quality. Both are CLI-first agents with IDE and cloud modes, and both start at $20 a month. Pick on model preference and ecosystem.

Is Codex free? Partly. OpenAI's pricing page says Codex is included in ChatGPT Free, Go ($8 per month), Plus ($20 per month), Pro (from $100 per month), Business, Edu and Enterprise. Free and Go cover lighter coding, and the pricing page says the desktop app uses GPT-6 Luna there.

Is Claude Code free? No. Claude Code is not on the free Claude plan. It is included in Pro ($20 per month, or $17 per month billed annually), Max (from $100 per month), Team and Enterprise, or you can pay API rates through an Anthropic Console account.

Which is cheaper, Claude Code or Codex? At $20 per month they cost the same through Claude Pro or ChatGPT Plus. Codex also has a free tier and an $8 Go plan. At the heavy end, both have a $100 tier, and Codex adds $200 and $500 Pro tiers. Compare usage limits, not just sticker prices.

Does Codex support MCP? Yes. Codex supports STDIO and streamable HTTP MCP servers, configured in ~/.codex/config.toml or a trusted project's .codex/config.toml. You can add one with codex mcp add. Claude Code also supports MCP across all of its surfaces.

Which is safer by default, Claude Code or Codex? Codex's defaults are tighter: it launches in a workspace-write sandbox with network off in version-controlled folders, and read-only elsewhere. Claude Code prompts for permissions by default and its Bash sandbox is optional, off until you enable it. Neither is safe if you run with approvals disabled.


Sources

Checked on October 23, 2026: Claude pricing, Claude Code overview, Claude Code permissions, Claude Code sandboxing, Claude Code model config, ChatGPT and Codex pricing, Codex CLI, Codex IDE extension, Codex Cloud, Codex MCP, Codex AGENTS.md and Codex approvals and security.