Claude Code vs Codex: Which AI Coding Agent Wins in 2026
Anthropic's terminal-first coding agent meets OpenAI's ChatGPT-based Codex: how pricing, models, and platform coverage stack up in 2026.

Claude Code, Anthropic's terminal-first coding agent, and Codex, OpenAI's ChatGPT-based coding agent, now sit on opposite sides of the same question: who do you let drive inside your codebase? Claude Code leans on a CLI-and-IDE workflow built around Opus-class models and a $17-$200/month Claude subscription ladder, while Codex leans on ChatGPT's own plan structure, from a free tier up to $500/month Pro, running on OpenAI's GPT-6 model family. Both now ship cloud environments, GitHub integrations, MCP support and scheduled automation, so the real differences are in pricing shape, model lineup and how deeply each one is wired into its parent chat app.
What is Claude Code?
Claude Code is Anthropic's agentic coding tool. Per Anthropic's own product page, it "reads your codebase, edits files, runs commands, and integrates with your development tools," and it's built to be handed a bug fix, a test suite, or a multi-day migration that it plans out, questions you on, and then executes with minimal hand-holding. It was built around the idea of agentic search: rather than requiring you to manually select files for context, Claude Code maps and explains a project on its own.
Anthropic's documentation describes it as a single underlying engine that surfaces everywhere you work: a full-featured terminal CLI, a VS Code extension (which also installs into Cursor and Devin Desktop), a JetBrains plugin covering IntelliJ, PyCharm and WebStorm, a standalone desktop app for macOS, Windows and (in beta) Ubuntu/Debian, and a browser version at claude.ai/code. Because CLAUDE.md files, settings and MCP servers travel with the project rather than the surface, a session started in the terminal can be picked up on the web or in the desktop app later.
What is OpenAI Codex?
Codex is OpenAI's coding agent, built on top of ChatGPT rather than as a separate product with its own account system. OpenAI's own developer docs introduce it simply as a tool where you "start with a goal, idea, or task," and it gathers context, takes action, and produces output — in chat, in a dedicated IDE extension, or from a terminal.
The Codex CLI is the terminal half of that story. OpenAI describes it as letting you "inspect code, make changes, run commands, and automate repeatable work without leaving your terminal." It installs with a curl script on macOS and Linux (plus Windows, npm and Homebrew options), signs in with your ChatGPT account, and runs interactively by default, with a non-interactive codex exec mode for scripts and CI. The rest of the Codex surface area — ChatGPT desktop and mobile apps, a web interface, an IDE extension, and "Codex Cloud" for remote environments — all share the same underlying agent and your ChatGPT plan.
Installation and platform coverage
Both tools install the same way a developer would expect: a one-line shell command. Claude Code's native installer is curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL, with PowerShell and CMD equivalents on native Windows, plus Homebrew (brew install --cask claude-code) and WinGet packages, and apt/dnf/apk packages for Debian, Fedora, RHEL and Alpine. Codex CLI installs via curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS and Linux, with Windows, npm and Homebrew install paths documented separately.
Where they diverge is the rest of the surface map. Claude Code's desktop app is a dedicated download for macOS (Intel and Apple Silicon), Windows x64 and Windows ARM64, with a beta apt-based install for Ubuntu/Debian — it's a standalone coding app, separate from any general chat client. Codex, by contrast, rides inside the general-purpose ChatGPT apps: the ChatGPT desktop app, the ChatGPT mobile app, and chatgpt.com on the web all host Codex sessions alongside ordinary chat, with a separate IDE extension and "Codex Cloud" for remote runs. If you want Claude Code's mobile equivalent, it lives in the Claude iOS/Android apps, reached via "Remote Control" or by starting a task on the web and continuing it with claude --teleport.
How each agent works day to day
Claude Code is unapologetically CLI-native. Running claude "write tests for the auth module, run them, and fix any failures" is the canonical example in Anthropic's own docs, and the tool is built to pipe: tail -200 app.log | claude -p "Slack me if you see any anomalies" is a documented pattern. It reads a project's CLAUDE.md (or an existing AGENTS.md), builds "auto memory" as it works, and can spin up sub-agents or background agents that run several tasks in parallel under a coordinating lead agent. Auto mode — which checks for risky commands before running them — is the default behavior on Pro, Max and Team plans.
Codex CLI covers similar ground with its own vocabulary: /init generates an AGENTS.md, /model and /permissions adjust behavior mid-session, and a dedicated /review mode checks uncommitted changes, a specific commit, or a base branch without touching your working tree. codex resume picks a session back up, codex cloud submits work to a remote environment and can apply results locally, and codex mcp adds Model Context Protocol servers. OpenAI's docs explicitly recommend creating git checkpoints before and after a task so changes can be reverted — a tell that, like Claude Code, it expects to be given real latitude inside a repo.
Supported models
Model naming is where the two products look most different, and neither vendor's docs give a single definitive "Claude Code only runs model X" answer. Anthropic's product page highlights Opus 5.5 specifically in connection with a "Fast mode" for Claude Code — a quicker, higher-cost configuration priced separately from ordinary plan usage — without stating that Opus 5.5 is the only model the CLI can use.
OpenAI's Codex docs are more explicit about a model lineup, built around its GPT-6 family: GPT-6 Astra ("our most capable model for complex work across code, apps, and research"), GPT-6.1 Sol (near-Astra performance at lower cost, aimed at repeated long-running work), and GPT-6 Luna ("our most efficient model for focused, high-volume tasks," suited to summarization and extraction as well as coding). GPT-6 Sol is named as the replacement model for tiers losing older options. OpenAI's model page also confirms that GPT-5.5, the previous flagship, retires from ChatGPT, Codex and ChatGPT Work on October 14, 2026 — the API itself is unaffected — while several GPT-5.6 variants and the already-deprecated GPT-5.2, GPT-5.3-codex and GPT-5.3-Codex-Spark round out the legacy list.
| Dimension | Claude Code | Codex |
|---|---|---|
| Primary model(s) named for the agent | Opus 5.5 (named specifically for Fast mode) | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna, GPT-6 Sol |
| Model switching | Account-level model access; not itemized per CLI command on the product page | /model command in-session, reasoning effort adjustable |
| Legacy model retirement | Not specified on the product page | GPT-5.5 retires Oct 14, 2026 from ChatGPT, Work and Codex (API unaffected) |
| Fastest/cheapest tier | Fast mode (Opus 5.5), $8 / $40 per million tokens, research preview | GPT-6 Luna, lowest listed credit cost of the family |
Pricing: subscriptions, credits and API access
Claude Code rides on Anthropic's Claude consumer/business plans. Per claude.com, Pro costs $17/month billed annually ($200 up front) or $20/month billed monthly, and includes Claude Code. Max 5x is $100/month and bundles $100/month of API credit; Max 20x is $200/month with $200/month of credit. A Claude Console (API) account bills Claude Code usage at standard token rates instead. On top of any plan, Fast mode — the quicker Opus 5.5 configuration — is billed separately at $8 per million input tokens and $40 per million output tokens, available as a research preview across consumption plans and via usage credits. Anthropic notes that usage limits apply on subscription plans and that listed prices exclude tax.
Codex pricing is tiered through ChatGPT's own plan ladder, per OpenAI's developer docs. Free ($0/month) and Go ($8/month) give lightweight access to GPT-6 Luna in the desktop app only, with image generation unavailable on Free. Plus ($20/month) is the first tier with the full agent surface — Codex on the web, the CLI, the IDE extension and iOS, plus cloud integrations like automatic code review and Slack, access to GPT-6.1 Sol and GPT-6 Luna, and the option to buy extra credits. Pro runs $100, $200 or $500 per month, with Ultrafast mode (an 8x usage multiplier) unlocked only at the $500 tier. Business costs $20 per user per month billed annually for two or more seats, or $25 per user per month billed monthly, and adds a dedicated workspace, SAML SSO, MFA and admin controls, with business data excluded from training by default. Enterprise and Edu plans require contacting sales and add SCIM, EKM, RBAC, and compliance/retention controls. A separate pay-as-you-go API-key path covers CLI, SDK or IDE use such as CI pipelines at standard API rates, but explicitly excludes the cloud-only features like GitHub code review and Slack routing.
| Plan tier | Claude Code (via Claude plans) | Codex (via ChatGPT plans) |
|---|---|---|
| Free / lowest paid | No free tier listed for Claude Code; Pro starts the access | Free ($0/mo) and Go ($8/mo), desktop-only, GPT-6 Luna |
| Entry full-feature tier | Pro: $17/mo annual or $20/mo monthly | Plus: $20/mo — web, CLI, IDE, iOS, cloud integrations |
| Power-user tier | Max 5x: $100/mo ($100 API credit); Max 20x: $200/mo ($200 credit) | Pro: $100 / $200 / $500 per month (Ultrafast at $500) |
| Team | Team plan referenced for Auto mode default; pricing not itemized on product page | Business: $20/user/mo annual (2+ seats) or $25/user/mo monthly |
| Enterprise | Enterprise mentioned for desktop app access; contact Anthropic | Enterprise & Edu: contact sales |
| Pay-as-you-go | Console/API account at standard token pricing | API key access at standard API rates (excludes cloud features) |
Feature-by-feature comparison
Strip away branding and the two tools converge on a similar feature checklist, though each has areas where it clearly goes further. Claude Code's distinguishing features, per Anthropic's docs, include: CLAUDE.md and auto-generated memory for persistent project context; Skills for packaging repeatable workflows like /review-pr; Hooks that run shell commands around file edits or commits; sub-agents and background agents coordinated by a lead agent; Routines that run scheduled tasks in the cloud even when your machine is off; an Agent SDK for building fully custom agents on the same engine; and surface-hopping features like Remote Control, Dispatch, and claude --teleport for moving a session between terminal, web and mobile.
Codex's equivalent list, per OpenAI's docs, includes: AGENTS.md generation via /init; a dedicated /review mode for checking diffs without touching the working tree; Skills and Plugins for packaged workflows and third-party connections; Hooks; local, Git-worktree and cloud environments; a Codex SDK, App Server and GitHub Action for building on top of the agent; non-interactive mode for CI; and integrations with GitHub, GitLab (beta), Slack and Linear. Both products support the Model Context Protocol for connecting external tools and data sources — Claude Code via /mcp setup documented at code.claude.com, Codex via codex mcp.
One structural difference is worth calling out: Codex is explicitly part of ChatGPT, sharing a plan, a sign-in flow and features like browser use, voice, image generation and web search with the rest of the ChatGPT product. Claude Code is a dedicated coding product under the Claude umbrella — it shares a subscription tier with general Claude access, but its desktop and mobile surfaces are purpose-built for code rather than general-purpose chat.
- Already paying for Claude Pro or Max: Claude Code is bundled in, so there's no separate decision to make on cost.
- Already paying for ChatGPT Plus or Pro: Codex is bundled the same way, with the added benefit of ChatGPT's broader surface (voice, browser, image tools) in the same place.
- Want the cheapest possible entry point: Codex's Free and Go ($8/mo) tiers undercut anything Claude Code offers, though both are desktop-app-only and run the smaller Luna model.
- Running CI or scripted pipelines: both ship a non-interactive mode (
claude -p/codex exec) and pay-as-you-go API pricing outside the subscription.
Permissions, sandboxing and security
Both vendors build in guardrails before letting an agent run commands unsupervised. Claude Code's Auto mode, on by default for Pro, Max and Team plans, checks for risky commands before executing them, and Anthropic has published a self-hosted-environments beta for teams that want sessions running on their own infrastructure rather than Anthropic's. Codex's documentation describes configurable permission modes and a sandbox with inspectable "writable roots," so you can see exactly what the agent is allowed to touch before it touches it, alongside a separate security-administration track covering SCIM, EKM and audit logging at the Enterprise tier. Codex also publishes dedicated docs on sandboxing and "agent approvals" as first-class topics, reflecting OpenAI's framing of permission control as core infrastructure rather than a settings toggle.
Which should you choose?
For most developers, the deciding factor is which subscription you already carry. If your team is standardized on Claude for everyday chat and already pays for Pro or a Max tier, Claude Code arrives at no extra cost and shares context — CLAUDE.md files, settings, MCP servers — across terminal, IDE, desktop and web. If your organization runs on ChatGPT, Codex offers the same bundled-in logic, plus the option to fold coding tasks into the same app used for everything else, including a genuinely free entry tier that Claude Code doesn't match.
Teams choosing on technical grounds rather than existing spend should weigh a few specifics: Codex's published model lineup (Astra, Sol, Luna) and per-model credit pricing give more visibility into cost-per-task than Claude Code's product page offers today, where only Opus 5.5's Fast mode is named directly. Conversely, Claude Code's own comparisons against IDE-native tools — see our Claude Code vs Cursor breakdown — consistently highlight its terminal-first, editor-agnostic design as a strength for teams that don't want to standardize on one IDE. If GitHub workflow automation specifically is the deciding factor, our Claude Code vs GitHub Copilot comparison digs further into how Anthropic's agent handles PR-driven work.
What next
Both products are moving fast enough that the gap could close or widen within a quarter: Anthropic has Fast mode in research preview and self-hosted environments in public beta, while OpenAI is mid-rollout on its GPT-6 family with GPT-5.5 scheduled to retire from Codex on the same date this article publishes. Anyone evaluating either tool seriously should check the live docs — code.claude.com/docs and developers.openai.com/codex — rather than relying on cached pricing, since both companies update plan and model tables directly on those pages. If your evaluation also includes broader AI-assistant choices beyond coding specifically, our NotebookLM vs Claude Projects vs ChatGPT comparison covers adjacent territory for research and knowledge work.
Frequently asked questions
Is Claude Code or Codex cheaper?
Codex has the lower entry point, with a Free ($0/month) tier and an $8/month Go tier, both running the smaller GPT-6 Luna model in the ChatGPT desktop app only. Claude Code has no free tier; access starts with a Claude Pro subscription at $17/month billed annually or $20/month billed monthly. At the top end, Claude Max 20x ($200/month) and Codex Pro (up to $500/month) both target heavy users, so the cheaper option depends on which tier of use you need.
What models power Claude Code and Codex?
Anthropic's Claude Code product page names Opus 5.5 specifically for its optional Fast mode, without stating a single required model for the CLI. OpenAI's Codex docs name a GPT-6 family built around GPT-6 Astra (most capable), GPT-6.1 Sol (near-Astra performance at lower cost), and GPT-6 Luna (most efficient, high-volume tasks), selectable in-session with the /model command.
Can I use Claude Code or Codex without a subscription?
Yes, both support pay-as-you-go API access outside a consumer subscription. Claude Code can run on a Claude Console (API) account billed at standard token rates. Codex supports an API-key path for CLI, SDK, or IDE use such as CI pipelines, also billed at standard API rates, though this excludes cloud-only features like automatic GitHub code review and Slack routing.
Does Claude Code or Codex work in my IDE?
Claude Code ships a VS Code extension (which also installs into Cursor and Devin Desktop) and a JetBrains plugin for IntelliJ, PyCharm, WebStorm and other JetBrains IDEs. Codex ships its own IDE extension, documented separately from VS Code by name, alongside its CLI, web, and desktop/mobile ChatGPT surfaces.
What happens to GPT-5.5 in Codex?
Per OpenAI's model documentation, GPT-5.5 retires from ChatGPT, ChatGPT Work and Codex on October 14, 2026. The underlying API access to GPT-5.5 is not affected by this retirement, only its availability inside the ChatGPT and Codex product surfaces.
Do both tools support MCP and automation?
Yes. Both support the Model Context Protocol for connecting external tools and data sources, and both can run non-interactively for scripts or CI: Claude Code via claude -p, Codex via codex exec. Claude Code adds cloud-based Routines and desktop scheduled tasks; Codex adds scheduled tasks as part of its broader Workflows feature set.
Sources
- Anthropic: Claude Code product pageclaude.com
- Anthropic docs: Claude Code overviewcode.claude.com
- OpenAI developers: Codexdevelopers.openai.com
- OpenAI/ChatGPT Learn: Codex pricinglearn.chatgpt.com
- OpenAI/ChatGPT Learn: Codex CLI docslearn.chatgpt.com
- OpenAI/ChatGPT Learn: Codex modelslearn.chatgpt.com
Felix Moreau writes Pandromeda's software coverage and how-to guides. He covers Windows, macOS and Linux updates, the apps people rely on, emulators and developer tools, and turns official documentation into clear, numbered steps that work on the current version.
