Most Claude Code vs Codex articles are written by someone who used both for an afternoon. We'd rather tell you exactly how lopsided our experience is, then compare the parts that documentation and a terminal can settle.
- Our experience is uneven, and we say where. Claude Code is the studio's daily tool: its prompt history on our main machine holds a little over four thousand entries. Codex CLI's holds about 130.
- The biggest real difference is the safety default. Codex sandboxes commands by default and asks before leaving the sandbox. Claude Code's shell sandbox is opt-in, and its interactive sessions start in a classifier-reviewed auto mode.
- The extension layers have converged. Both have instruction files, skills in the same SKILL.md format, plugins with marketplaces, MCP servers, hooks and subagents.
- Instruction files are no longer a wall. Codex reads AGENTS.md. Claude Code now reads AGENTS.md when there is no CLAUDE.md.
- Licensing follows your chat subscription. Codex comes with ChatGPT plans, Claude Code with paid Claude plans. Both also run on API billing.
- No benchmark winner here. We didn't run one, and we won't quote one we can't trace to a primary source.
Claude Code vs Codex: what you are actually comparing
Both products are the same kind of thing: an agent that reads your repository, edits files, runs commands and reports back. Anthropic's overview calls Claude Code "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools". OpenAI's README calls Codex CLI "a coding agent from OpenAI that runs locally on your computer". If you're new to the category, start with our plain-language guide to what AI agents are and how they work.
Neither is just a terminal program any more. As of November 2026, each vendor documents the same spread of surfaces: a terminal CLI, editor extensions, a desktop app, a web and cloud version, and a mobile route into running sessions. So "Claude Code vs Codex" is really a comparison of two families that share a config directory and an instruction file across surfaces.
Here is the evidence we're working from, so you can weigh each section:
- Claude Code: first-hand, daily. Version 2.1.327 is installed here. The studio's global instruction file, around twenty project instruction files, 22 personal skills, a pre-tool hook and a skills plugin all exist because of daily use.
- Codex CLI: first-hand, light. Version 0.166.0 is installed. We ran
codex --helpand each subcommand's help while writing this, and read our own~/.codex/config.toml. About 130 prompts is enough to know the tool's shape, not enough to rank it. - Cursor and Gemini CLI: documentation only. They get a short labelled section near the end.
One claim we won't make: which model writes better code. We have no controlled test, and vendor benchmark tables change monthly.
Install and sign-in, side by side
Both install with one command and both sign in through a browser.
Claude Code, from Anthropic's overview page:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Homebrew (stable channel)
brew install --cask claude-code
# then, in a project directory
claude
On Windows the same page gives irm https://claude.ai/install.ps1 | iex for PowerShell and winget install Anthropic.ClaudeCode. Native installs update themselves in the background. Homebrew and WinGet installs do not, so you upgrade those by hand.
Codex CLI, from OpenAI's README:
# macOS, Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# package managers
npm install -g @openai/codex
brew install --cask codex
# then, in a project directory
codex
On Windows the README gives a PowerShell installer. Updating is codex update, which is in our installed CLI's help as "Update Codex to the latest version".
Sign-in is where the business model shows. On first run, Codex offers "Sign in with ChatGPT" and recommends it for people on a ChatGPT plan; the alternative is an API key. Claude Code opens a browser for a claude.ai login, or uses an API key from the Claude Console, or routes through a cloud provider such as Amazon Bedrock. We'll come back to what that means for cost and limits.
The full Codex walkthrough, with every flag checked against the installed CLI, is in our Codex CLI guide.
Permissions and sandboxing: the real design difference
If you read one section, read this one. The two tools made different default choices about what an agent may do without asking, and that changes how they feel more than any model difference.
Codex starts inside a sandbox. OpenAI's sandbox documentation describes three sandbox modes: read-only, workspace-write and danger-full-access. workspace-write is the default for local work, so the agent can read files, edit inside the workspace and run routine commands there, and it asks before going beyond that boundary. Enforcement is at the operating-system level: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native Windows sandbox. A separate approval policy (on-request or never) decides when it pauses.
On top of that, Codex's permission modes page lists four user-facing modes: Ask for approval, Approve for me, Full access and Custom (config.toml). "Approve for me" keeps the same sandbox but sends eligible approval requests to a reviewer agent instead of to you. On the command line that's the --approve-for-me flag, which we confirmed in codex --help.
Claude Code starts with permission rules and a classifier. Anthropic's permission modes page lists six modes: Manual (default), Accept edits, Plan, Auto, Don't ask and Bypass permissions. You cycle them with Shift+Tab or start in one:
claude --permission-mode plan
As of November 2026 the docs say interactive terminal sessions on v2.1.283 or later start in auto mode, where a separate classifier model reviews each action before it runs and blocks things like force pushes, production deploys and piping downloads into a shell. Print-mode runs (claude -p) start in Manual.
The operating-system sandbox is a separate, optional layer in Claude Code. The sandboxing page says it is off by default, is switched on with /sandbox, covers shell commands only, and does not run on native Windows (you need WSL2).
So the honest summary:
| Codex | Claude Code | |
|---|---|---|
| OS sandbox for commands | On by default (workspace-write) |
Off by default; enable with /sandbox |
| Native Windows sandbox | Yes, documented | No; WSL2 only |
| Automatic reviewer | "Approve for me" (auto-review of approval requests) | Auto mode (classifier reviews actions) |
| Plan-only mode | /plan |
Plan mode |
| Skip everything | --dangerously-bypass-approvals-and-sandbox |
--dangerously-skip-permissions |
Both vendors say plainly that their automatic reviewer is not a guarantee. OpenAI: auto-review "is not a deterministic security guarantee". Anthropic: use auto mode where you trust the general direction, not as a replacement for review on sensitive operations.
What daily use has taught us on the Claude side is that a mode is not a policy. Our standing rules live in an instruction file ("confirm before pushing to production, publishing a page, or sending anything outward") and the one rule that must never bend lives in a hook, because an instruction is a request and a hook is enforcement. We cover that in Claude Code hooks. Codex documents hooks too; we haven't written one for it.
Instruction files, skills, plugins, MCP and subagents
A year ago this section would have been a list of differences. Today it's closer to a translation table.
| Layer | Claude Code | Codex |
|---|---|---|
| Always-on instructions | CLAUDE.md (user, project, local), or AGENTS.md when no CLAUDE.md exists |
AGENTS.md (global in ~/.codex, then project root down to the working directory) |
| Scaffold command | /init |
/init |
| Skills | SKILL.md folders, invoked with /name or picked automatically |
SKILL.md folders under .agents/skills, invoked with $ or /skills, or picked automatically |
| Plugins | Bundles of skills, hooks, subagents and MCP servers, from marketplaces | Bundles of skills, MCP servers and hooks, from marketplaces |
| External tools | MCP servers (claude mcp) |
MCP servers (codex mcp, [mcp_servers.*] in config.toml) |
| Subagents | Isolated workers; custom ones are Markdown files | Agent threads; custom ones are TOML files in .codex/agents/ |
| Deterministic automation | Hooks | Hooks |
A few specifics worth knowing before you assume parity:
Instruction files load differently. Codex concatenates AGENTS.md files from the project root down and stops at a combined 32 KiB by default (project_doc_max_bytes). Claude Code concatenates CLAUDE.md files from the filesystem root down and recommends keeping each under 200 lines. Claude Code's memory docs now say it reads AGENTS.md directly when a repository has no CLAUDE.md. The details, including how to keep one file for both tools, are in CLAUDE.md vs AGENTS.md.
Skills really are portable. OpenAI's skills documentation says Codex skills "build on the open agent skills standard". We have first-hand evidence that this works across vendors: the same third-party skills collection (Matt Pocock's, from github.com/mattpocock/skills) is installed as a plugin in our Claude Code and registered as a Git marketplace in our Codex config.toml. Same source, two tools.
Subagents exist in both, with different ergonomics. In Codex you ask for them ("spawn two agents") and switch threads with /subagents; they inherit the parent's sandbox and approval settings. Claude Code spawns them through an Agent tool, and adds scripted fan-outs it calls dynamic workflows. One caution that applies to both: OpenAI's docs say subagent workflows "use more tokens than single-agent runs", and our own instruction file says the same thing in blunter words: delegate only large, independent, parallel work.
MCP is configured twice. A server you add to Claude Code is not visible to Codex, and the reverse. If you use both tools, that's two configs to keep in step.
Cloud, background and non-interactive work
Both vendors now sell the same promise: start a task, close the laptop, review a pull request later.
Claude Code calls these cloud sessions. From the cloud docs:
claude --cloud "Fix the flaky test in auth.spec.ts"
claude --teleport # pull a cloud session into your terminal
The session clones your GitHub remote at the current branch, not your local checkout, so push first. Handoff from the CLI is one-way: you can pull a cloud session down, but you can't push an existing terminal session up. One thing our notes record from use: --cloud expects a Git repository.
Codex calls it Codex Cloud. You start tasks from the web, desktop or mobile app by choosing to work in Cloud, against an environment that defines repositories, dependencies and network access. From the terminal there is codex cloud (marked experimental in the CLI's own help) and codex apply, which applies the latest cloud diff to your working tree. We have not run a Codex Cloud task, so that is documentation plus --help.
For scripts and CI, the two commands are:
claude -p "review these changed files for security issues"
codex exec "summarize the failing tests"
The defaults differ again. OpenAI's non-interactive docs say codex exec runs in a read-only sandbox unless you pass --sandbox workspace-write. claude -p starts in Manual permission mode, where anything that would prompt needs a rule or a handler. Either way, an unattended agent can do only what you explicitly granted, which is the right default.
Our scheduled agents don't use either CLI. They call the Claude API directly from GitHub Actions, which we describe in building a daily SEO audit agent. A CLI in CI is convenient; a short script against the API is easier to cap and audit.
Subscriptions, API keys and usage limits
No prices here, because both vendors change them and your plan may differ. The structure is what matters.
Codex. OpenAI's Codex pricing page says, as of November 2026, that Codex is included in every ChatGPT plan from Free up to Enterprise, each with a usage allowance. Some plans get a set number of local messages per five-hour period, weekly limits may also apply, and local messages and cloud tasks draw from one pool. When you hit the limit you can buy credits on some plans. Signing in with an API key instead bills at API rates and, per the authentication docs, loses the features that depend on a ChatGPT workspace, including Codex Cloud.
Claude Code. Anthropic's authentication page lists Claude Pro, Max and Ultra subscriptions, Team and Enterprise seats, a Claude Console account with API billing, and cloud providers. The desktop app requires a paid subscription. Cloud sessions "always use your subscription credentials" and count toward the same plan limits as everything else you do with Claude.
Two practical points from our own setup:
- A chat subscription is not an API key. The studio's Claude plan runs Claude Code, and it gives no key for the scripts we run in CI. Those need a separate Console account with its own key. The same split exists on the OpenAI side.
- An environment variable can silently change who pays. Anthropic's docs warn that if
ANTHROPIC_API_KEYis set and approved, Claude Code uses it instead of your subscription. Run/statusto see which credential is active.
If usage limits are your deciding factor, the only honest advice is to read the two pricing pages on the same day and compare them against how you actually work: long single sessions, or many parallel ones.
The two, honestly
Claude Code
Right when: you want one agent across terminal, editor, desktop and cloud, you're willing to invest in instruction files, skills and hooks, and you already pay for a Claude plan. Our whole delivery practice runs on it: client sites, scheduled agents, this blog.
Wrong when: you need an operating-system sandbox on native Windows, or you want sandboxing on without anyone having to remember to enable it. That's Codex's default, not Claude Code's.
What people overestimate: the instruction file. Anthropic's own docs say Claude treats CLAUDE.md as "context, not enforced configuration". The one rule we cannot afford to have skipped, how commits are made in a checkout several sessions share, is enforced by a hook instead of being left in the file. A long file makes adherence worse, so the most useful edit to ours is usually a deletion.
What people underestimate: how much of the value is the harness. The pieces we rely on most are not model features: memory notes that persist between sessions, subagents that keep noisy work out of the main context, and a permission mode we can change mid-task.
Codex
Right when: you already pay for ChatGPT, you want the conservative default (sandboxed, ask before leaving), or your repository already standardised on AGENTS.md. It is also the natural choice if your team's review flow is GitHub comments, since Codex documents a @codex review trigger on pull requests.
Wrong when: you expect our depth of opinion on it. We can't give you that. What we can say from light use and from its own help output is that the CLI is broad and well documented, and that several of its newer commands are labelled experimental in that same output (cloud, remote-control, app-server).
What people overestimate: how different it is. People arrive expecting a different category of tool and find the same layers under different names. If you know one, you can be productive in the other in a day.
What people underestimate: the sandbox. A default that limits writes to the workspace and asks before reaching further is a real safety property, and it's there before you configure anything.
Cursor and Gemini CLI, from the documentation only
These two come up in every "vs" search, so here is what their own documentation says today. We have not run either in production.
Cursor (documentation only). Cursor's docs describe it as "a coding agent for building ambitious software", built around an editor. It also has a terminal CLI whose command is agent, with Agent, Plan and Ask modes and a print mode for scripts, and you can hand a task to a cloud agent from the CLI. Its rules documentation describes project rules as .mdc files in .cursor/rules, plus support for AGENTS.md in the project root and subdirectories. If your team wants the agent inside the editor, Cursor is the one built around that.
Gemini CLI (documentation only). Google's README describes an open-source terminal agent under the Apache 2.0 licence, with a GEMINI.md context file, MCP servers configured in ~/.gemini/settings.json, and a non-interactive -p mode. As of November 2026 the README also says the CLI is aimed at organisations with Gemini Code Assist licences, and that free individual access and consumer Google AI plans moved to a separate Antigravity CLI on June 18, 2026. Check which of the two your Google plan covers before you compare anything else.
Our defaults
- You pay for a Claude plan → Claude Code. Learn the permission modes first, write a short
CLAUDE.md, add a hook for the one rule that must never break. - You pay for a ChatGPT plan → Codex. Keep the default sandbox, try "Approve for me" once the prompts get repetitive, write a short
AGENTS.md. - Your team uses both → one instruction file. Make
AGENTS.mdthe source of truth and let Claude Code read or import it. - You need a sandbox on native Windows → Codex documents one. Claude Code needs WSL2 for its sandbox.
- You're choosing for a business, not a developer → the tool matters less than who supervises it. Our piece on AI agents for business starts there.
The honest answer to Claude Code vs Codex is that the gap between them is smaller than the gap between a configured agent and an unconfigured one. Pick the subscription you already have, then spend the saved time on instructions, permissions and review.
If you want an agent set up properly in your own repositories, with the guardrails written down, that's part of our AI integration work. Tell us what you're building.
Common questions
Claude Code vs Codex: what is the actual difference?
Both are coding agents that read a repository, edit files and run commands from a terminal, an editor, a desktop app or the cloud. The differences that matter in practice are the defaults. As of November 2026, Codex runs commands inside an operating-system sandbox by default and asks before leaving it, while Claude Code's sandbox for shell commands is opt-in and its interactive sessions start in a classifier-reviewed auto mode. They also read different instruction files by default (AGENTS.md for Codex, CLAUDE.md for Claude Code) and are licensed through different subscriptions.
Codex vs Claude Code: which is better?
Neither vendor's documentation settles that, and we will not pretend a small studio's habits do. We use Claude Code daily and Codex lightly, so our honest answer is narrower: the better tool is the one whose permission model, instruction files and subscription you already understand. If you pay for a ChatGPT plan, Codex is included and worth learning first. If you pay for a Claude plan, the same is true of Claude Code. Switching costs sit in your instruction files, skills and habits, not in the install.
How do Codex vs Claude Code usage limits compare?
Both attach usage limits to a subscription and both offer pay-as-you-go API billing as an alternative. As of November 2026, OpenAI's Codex pricing page describes an allowance per five-hour period on some plans, possible weekly limits, and one shared pool for local messages and cloud tasks, with credits available after the limit. Anthropic's docs say cloud sessions count toward the same plan limits as the rest of your Claude usage. The numbers change often, so read each vendor's pricing page on the day you decide.
Codex vs Claude Code for coding: does the model or the harness matter more?
For day-to-day coding work the harness matters more than most comparisons admit. The harness is everything around the model: how instructions load, what the agent may run without asking, how it delegates to subagents, and how it reports back. Two tools with strong models still behave very differently when one runs unsandboxed with a classifier reviewing actions and the other runs inside a workspace sandbox. Set the permissions and instruction files up properly in either tool before you judge the model.
Codex vs Claude Code vs Cursor: where does Cursor fit?
Documentation only: we have not run Cursor in production. Cursor describes itself as an AI editor and coding agent, so its centre of gravity is the editor rather than the terminal. Its docs also describe a terminal CLI whose command is agent, with Agent, Plan and Ask modes, and cloud agents you can hand a task to. Cursor reads project rules from .cursor/rules and also reads AGENTS.md. If your team lives in an editor and wants the agent there, look at Cursor. If you want a terminal agent, compare Claude Code and Codex.
Codex vs Claude Code vs Gemini CLI: is Gemini CLI a third option?
Documentation only: we have not run Gemini CLI in production. Its GitHub README describes an open-source terminal agent under the Apache 2.0 licence that reads a GEMINI.md context file, supports MCP servers and has a non-interactive mode. As of November 2026 the same README says the CLI is aimed at organisations with Gemini Code Assist licences and that individual access moved to a separate Antigravity CLI in June 2026. Check which product your Google plan actually covers before comparing features.
Can I use Claude Code and Codex in the same repository?
Yes, and it is less work than it used to be. Codex reads AGENTS.md. As of November 2026, Claude Code reads AGENTS.md too when a repository has no CLAUDE.md, and its docs show how to import AGENTS.md into a CLAUDE.md when you need both. Skills follow the same open SKILL.md format in both tools, though they live in different folders. MCP servers are configured separately for each tool. Keep one instruction file as the source of truth and let the second tool read or import it.

