Comparison
Claude Code vs Codex
Two harnesses, two subscriptions, two ideas of what a cloud run is. What engineering teams need to know before they standardise on one, and how to keep the other within reach.
Claude Code by Anthropic · Codex by OpenAI· Facts checked against the vendors’ pages on
The short answer
Claude Code and Codex do the same job: an agent that reads a repository, edits files, runs commands and hands back a change. Both run in a terminal, in an IDE, in a desktop app and in the vendor's cloud, and both read an AGENTS.md file for project instructions. The differences that matter to a team are not in the model's coding style. They are in which plan unlocks the cloud, what a cloud run draws from, and what still works when you sign in with an API key instead of a subscription.
The short version: both vendors keep their cloud runs (and their Slack and GitHub automations) behind a subscription sign-in. An API key gets you the CLI and SDK at API rates, nothing hosted. Claude Code's cloud sessions run in an isolated VM per session and share one usage pool with everything else on the account; Codex runs each cloud task in its own workspace and draws on the same ChatGPT allowance as local work. Pick on the plans your team already pays for and on where your code lives, and keep the instructions file shared so switching stays cheap.
At a glance
| Claude Code | Codex | |
|---|---|---|
| Made by | Anthropic | OpenAI |
| Where it runs | Terminal (CLI), VS Code and JetBrains extensions, desktop app, web and mobile (cloud sessions) | Codex CLI, IDE extension, ChatGPT desktop app, web and mobile (Codex Cloud) |
| Plans that include it | Claude Pro, Max, Ultra, Team and Enterprise. Not the Free plan | ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise; cloud features and integrations start at Plus |
| Listed individual prices (18 Nov 2026) | Pro $20/month billed monthly; Max $100/month; Ultra $200/month | Go $8/month; Plus $20/month; Pro $100, $200 or $500/month |
| Listed team prices (18 Nov 2026) | Team standard seat $25/month billed monthly ($20 billed annually); premium seat $125 ($100 annually). Enterprise: ask Anthropic | Business and Enterprise: see chatgpt.com/pricing or ask OpenAI |
| What a cloud run draws from | The plan's usage limits, shared with all other Claude and Claude Code use on the account; no separate charge for the cloud VM | The plan's allowance, shared by local messages and cloud chats; cloud tasks may use more; credits extend it |
| With an API key | CLI, IDE extensions and Agent SDK at API rates, also via Amazon Bedrock, Google Cloud or Microsoft Foundry. No cloud sessions, Slack or Code Review | CLI, SDK and IDE extension at API rates. No Codex Cloud, GitHub code review or Slack |
| Cloud isolation | An isolated, Anthropic-managed VM per session, or your own runners through self-hosted environments | Each cloud task in its own workspace, started from a published environment |
| Cloud network controls | None, Limited (the default environment) or Full, plus your own allowed domains | Full public internet, or package managers plus allowed domains; optional Tailscale VPN to private services |
| Secrets in the cloud | GitHub credentials and network secrets stay outside the VM; a proxy attaches them | Network secrets: programs see a placeholder and the proxy substitutes the real value for allowed domains |
| Repository hosts (cloud) | GitHub, and GitHub Enterprise Server on Team and Enterprise; other hosts only as an uploaded bundle that can't push back | GitHub and GitLab.com |
| Project instructions | CLAUDE.md, and it can read AGENTS.md instead of or alongside it | AGENTS.md |
| Pull request automation | Auto-fix answers CI failures and review comments on a PR; Code Review on Team and Enterprise; GitHub Actions and GitLab CI/CD | Code review in GitHub by commenting @codex review or turning on automatic reviews |
| Chat and issue triggers | Claude Code in Slack (Pro, Max and Ultra); Claude Tag for team channels | Slack (mention @ChatGPT); Linear (assign an issue to Codex or mention @Codex) |
| Source code | Proprietary, used under Anthropic's Commercial Terms | Codex CLI is open source (Apache 2.0); Codex Cloud and the IDE extension are not |
What you pay, and what a cloud run draws from
Neither vendor sells its cloud agent on its own. Claude Code comes with a Claude plan (Pro, Max, Ultra, Team or Enterprise; the Free plan doesn't include it), and Codex comes with a ChatGPT plan. The prices in the table are the list prices on claude.com/pricing and OpenAI's Codex pricing page on 18 November 2026; check both before you budget, because both have changed several times this year.
On Claude, a cloud session counts toward the plan's usage limits alongside every other Claude and Claude Code conversation on the account, and Anthropic makes no separate charge for the VM. Anthropic's docs say it plainly: running tasks in parallel consumes the limits proportionately. Max lists five times Pro's usage, and Ultra lists ten times Pro's with no five-hour limit.
On ChatGPT, local Codex messages and cloud chats share one allowance, and OpenAI warns that cloud tasks may use more of it than local messages. OpenAI publishes estimated message ranges per model for Plus and Business rather than fixed limits, says weekly limits may also apply, and lets Plus and Pro users buy credits to keep working once they hit the limit. Your live numbers are on the Codex usage dashboard.
For a team, the practical question is the same on both sides: how many runs fire at once at the busiest hour, and whose allowance they draw on. A shared bot account fed by Slack, Linear and GitHub triggers drains much faster than any one engineer's history suggests.
Subscription or API key: the line that decides where each can run
This is the difference that catches teams out. Both harnesses accept two kinds of sign-in, and only one of them unlocks the vendor's cloud.
Claude Code's cloud sessions, claude --cloud, teleport, Claude Code in Slack, Code Review and the desktop app all require signing in with a claude.ai subscription. With an Anthropic Console API key, or through Amazon Bedrock, Google Cloud or Microsoft Foundry, you keep the CLI, the IDE extensions, the Agent SDK, subagents, hooks, MCP and OpenTelemetry, billed at API rates (Anthropic's feature availability table).
Codex is the same shape. Codex Cloud requires signing in with ChatGPT. An OpenAI API key runs the CLI, the SDK and the IDE extension at standard API rates, with no cloud features such as GitHub code review or Slack. OpenAI recommends the API key for automation in shared environments like CI (Codex authentication).
So if your agents run somewhere other than the vendor's own cloud (your CI, your own VMs, a platform that runs agents for you), you are usually on the API-key side of that line for Codex, and you should check the terms for how your Claude plan may be used. Our pieces on using Claude Max or Codex Pro inside a cloud agent and avoiding double payment when running Codex in the cloud go through the options.
How each runs in the cloud
Claude Code runs each cloud session in an isolated VM that Anthropic manages. Organisations can route sessions to their own infrastructure instead through self-hosted environments, in which case isolation and network egress become the organisation's job. An environment sets network access to None, Limited or Full; the default environment starts at Limited, which allows package registries, GitHub and cloud SDKs. GitHub credentials stay encrypted on Anthropic's servers and reach GitHub through a proxy, so they never enter the VM, and Claude Code can still reach the Anthropic API even at None.
Codex runs each cloud task in its own workspace, started from a published environment that Codex prepares by inspecting the repository, installing dependencies and testing the workflow. An existing task keeps its own saved files, including uncommitted changes. Internet access is either full or restricted to package managers plus the domains you allow, and a Tailscale VPN can connect tasks to services on a private network. Network secrets are never handed to programs directly: they see a placeholder, and the proxy substitutes the real value for allowed destinations.
Where your code lives can settle the choice. Claude Code's Anthropic-hosted sessions clone from GitHub and open pull requests on GitHub, with GitHub Enterprise Server supported on Team and Enterprise; a GitLab or Bitbucket repository can be uploaded as a bundle, but the session can't push back to it. Codex Cloud connects to GitHub and to GitLab.com. For the trade-offs between a VM per task and shared containers, see isolated VM per task versus shared containers.
Triggers: GitHub, Slack and Linear
Both harnesses can be started from the tools a team already uses, and both keep those integrations on the subscription side. Claude Code's auto-fix subscribes to a pull request through the Claude GitHub App and answers CI failures and review comments; its Code Review product is for Team and Enterprise plans; and it runs in your own pipelines through GitHub Actions and GitLab CI/CD. Claude Code in Slack answers mentions from Pro, Max and Ultra accounts, and Claude Tag brings Claude into team channels.
Codex reviews pull requests in GitHub when someone comments @codex review or when automatic reviews are on. In Linear, assigning an issue to Codex or mentioning @Codex in a comment starts a cloud chat that replies with progress and results, and in Slack a mention of @ChatGPT starts a request. Anthropic's Claude Code docs don't list a Linear integration; teams connect Linear through an MCP server or a platform in between.
Every automated trigger is a run drawing on someone's allowance. Before wiring either harness to every pull request, read the licensing implications of triggering Claude Code or Codex from Slack versus GitHub.
Keeping the harness interchangeable
You don't have to choose once. Codex reads AGENTS.md, and Claude Code reads CLAUDE.md but can read a repository's AGENTS.md instead of or alongside it. Keep your conventions, test commands and no-go areas in one AGENTS.md and both harnesses start from the same instructions.
Keep the rest portable too: setup steps in a script either cloud environment can run, secrets in your own store rather than pasted into one vendor's settings, and spend tagged by task rather than by vendor, so the numbers still add up when a team runs both. Platforms such as Replicas run Claude Code, Codex and other harnesses in the same isolated VMs and hand back pull requests, which makes swapping a harness a setting rather than a migration. For the provisioning side, see provisioning Claude Code and Codex cloud VMs under a single team license.
Which to pick
Pick Claude Code if
- Your team already pays for Claude Team or Enterprise seats, so cloud sessions add no new contract.
- Your code is on GitHub or GitHub Enterprise Server and you want an agent that watches pull requests and fixes CI failures and review comments.
- You need cloud sessions on your own infrastructure: self-hosted environments route them to runners you control.
- You run Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry and only need the CLI and SDK there.
Pick Codex if
- Your team already pays for ChatGPT Business or Enterprise, so Codex comes with seats you have.
- Your repositories are on GitLab.com, or you start work from Linear issues.
- You want a CLI you can read and fork: the Codex CLI is open source under Apache 2.0.
- Your cloud tasks need private services: Codex environments can join a Tailscale network.
Questions teams ask
Is Claude Code or Codex cheaper?
At the entry tier the list prices match: Claude Pro and ChatGPT Plus are both $20 a month billed monthly (checked 18 November 2026). What differs is how far that goes. Both meter usage in rolling windows with weekly limits that the vendors describe rather than fix, so the honest comparison is your own team's runs on each. Check claude.com/pricing and OpenAI's Codex pricing page for current numbers.
Can I use an API key instead of a subscription?
Yes for local and scripted work, no for the vendors' clouds. An Anthropic Console key (or Bedrock, Google Cloud, Foundry) runs the Claude Code CLI and SDK; an OpenAI API key runs the Codex CLI, SDK and IDE extension. Claude Code cloud sessions and Codex Cloud both require a subscription sign-in, and API-key usage is billed at API rates, separately from any plan.
Can one repository work with both?
Yes. Put your instructions in AGENTS.md: Codex reads it, and Claude Code can read it in place of or alongside CLAUDE.md.
Do cloud runs cost extra?
Anthropic says there is no separate charge for the cloud VM; sessions count toward your plan's usage limits. OpenAI says cloud tasks draw on the same allowance as local messages and may use more of it, and Plus and Pro users can buy credits once they reach the limit.
Which one works with GitLab?
Codex Cloud connects to GitLab.com. Claude Code's Anthropic-hosted cloud sessions need GitHub to clone and open pull requests; a GitLab repository can be uploaded as a bundle but can't be pushed back to, and Claude Code also runs in GitLab CI/CD with your own pipeline.
Sources
Prices, plans and limits change often. Everything above was checked against these pages on November 18, 2026; check them again before you buy.


