Engine comparison

Codex vs Claude Code: a side by side comparison.

Codex and Claude Code do the same job: a coding agent that reads your repository, edits files and runs commands on your own machine. The real differences are who makes them, which plan pays for them, how each one fences off your machine, and where it keeps your history. Termdeck runs both every day, side by side, so this page sticks to what each vendor documents and what we see on disk. No benchmarks, no declared winner, and a clear answer for each situation.

In short

The two agents in a paragraph each

Claude Code

Anthropic's agent, running Claude models. It ships as a terminal CLI, IDE extensions for VS Code and JetBrains, a desktop app and a web version at claude.ai/code. Safety is one permission mode, from manual (ask before tools run) through accept edits, plan and auto (a classifier reviews risky actions) to bypass. An OS sandbox for shell commands exists but is off until you turn it on. The source is not published.

Codex

OpenAI's agent, running OpenAI models. The CLI is open source under Apache-2.0, and the same agent runs in the ChatGPT desktop app, an IDE extension and Codex Cloud. Safety is two dials: a sandbox mode that the operating system enforces, and an approval policy that decides when it stops to ask. By default it can write only inside the workspace, with network access off for commands.

The one-line answer

Pick the one your existing subscription already pays for, unless a specific difference below decides it for you: a default sandbox and open source point to Codex, a finer permission ladder and checkpoints point to Claude Code. Many people run both, and nothing stops you.

At a glance

Codex vs Claude Code, row by row

FeatureClaude CodeCodex CLI
MakerAnthropicOpenAI
Plans that include itClaude Pro, Max, Team and Enterprise; not the free planEvery ChatGPT plan: Free, Go, Plus, Pro, Business, Edu, Enterprise
API billing insteadAnthropic Console account, or a third-party providerOpenAI API key, billed at API rates; no cloud features
ModelsClaude models; --model takes an alias such as opus or sonnet, --effort low to maxOpenAI models; -m / --model, reasoning effort in config.toml
Source codeClosed; the GitHub repo is issues, plugins and examples, all rights reservedOpen source, Apache-2.0, at github.com/openai/codex
InstallNative installer (curl on macOS, Linux, WSL; irm on PowerShell), Homebrew, WinGetInstall script, npm install -g @openai/codex, Homebrew
PlatformsmacOS, Linux, WSL, native WindowsmacOS, Linux, WSL2, native Windows
Permission modelOne mode: manual, accept edits, plan, auto, don't ask, bypassTwo dials: sandbox (read-only, workspace-write, full access) plus approval policy (on request, never)
OS sandboxOff by default, turn on with /sandbox; macOS, Linux, WSL2; none on native WindowsOn by default; Seatbelt on macOS, bubblewrap on Linux and WSL2, a native sandbox on Windows
Network by defaultGoverned by permission rules; the sandbox adds a domain allowlist when onOff for commands in the default workspace-write sandbox
Plan modeYes, nativeYes, native
Write files, ask on commandsYes, accept editsNo equivalent pair of settings
Project instruction fileCLAUDE.md, and can read AGENTS.md instead; /init writes oneAGENTS.md, global plus per directory; /init writes one
Settings file~/.claude/settings.json and .claude/settings.json per projectconfig.toml under $CODEX_HOME (default ~/.codex)
MCP serversYes, claude mcpYes, codex mcp, local or remote
SubagentsYes; custom ones as Markdown in .claude/agents/Yes, on by default; custom ones as TOML in .codex/agents/
Headless / scriptingclaude -p, with --output-format json or stream-jsoncodex exec, with --json and --output-schema
Other surfacesVS Code, JetBrains, desktop app, web at claude.ai/code, Claude mobile appChatGPT desktop app, IDE extension, Codex Cloud on ChatGPT web and mobile
Sessions on disk~/.claude/projects/<slug>/<id>.jsonl, grouped by projectRollouts under $CODEX_HOME/sessions/YYYY/MM/DD, older ones compressed to .jsonl.zst
Resume in a terminalclaude --resume, once at process startcodex resume; a client resumes the thread before every turn

Every vendor row comes from Anthropic's and OpenAI's own docs and the CLIs' own --help; the session and resume rows come from the parsers Termdeck runs against both engines. Depth on each row: Claude Code permission modes, Codex approval and sandbox modes, Claude Code models, Codex models, Claude sessions, Codex sessions. Tell us if a row is out of date.

Pricing

Which is cheaper, Claude Code or Codex?

TierClaude (includes Claude Code)ChatGPT (includes Codex)
FreeFree plan, no Claude CodeFree, $0, with Codex for quick tasks
Entry paidPro, $20 a month, or $17 a month billed yearlyGo, $8 a month; Plus, $20 a month
Heavy useMax, from $100 a month (5x or 20x Pro usage)Pro, from $100 a month ($100, $200 or $500 tiers)
TeamsTeam, $25 a seat monthly or $20 yearly; premium seats $125 or $100Business, $25 a user monthly or $20 yearly
Enterprise$20 a seat yearly, plus usage at API ratesContact sales
Pay per tokenAnthropic Console API keyOpenAI API key

Prices in US dollars from claude.com/pricing and learn.chatgpt.com/docs/pricing on 23 October 2026, before tax. They change often, so check both pages before you buy.

On sticker price, Codex is cheaper to start: it is in every ChatGPT plan, including Free and the $8 Go plan, while Claude Code starts at Claude Pro. At $20 a month the two entry plans cost the same, and both top tiers start at $100. What the price does not tell you is how much work each plan carries before you hit a usage limit. Each vendor describes plan usage in its own terms (Claude Max as 5x or 20x Pro usage, ChatGPT plans by how many focused coding sessions they fit), so there is no like-for-like number to compare, and any "more usage per dollar" claim you read is a snapshot.

The cheapest agent is usually the one your existing subscription already covers. If you hit limits, a second plan on the other vendor costs the same as moving up a tier and gives you a second model family. When Codex says you have run out, Codex CLI usage limit reached explains the reset.

Straight answer

Is Claude Code better than Codex?

Neither is better across the board. Both vendors ship new models every few months, and a benchmark result or a "after 100 hours" verdict describes one model pair on one kind of task at one moment. We do not quote benchmark numbers here because they would be stale before this page is.

The differences that last are the ones in the table: the default sandbox and open source CLI on the Codex side, the accept edits and auto modes and checkpoint restore on the Claude Code side, and the plan each one rides on. The fastest way to settle it for your code is to give both the same task in the same repository and read the two diffs.

By situation

Codex or Claude Code: which should you pick?

You already pay OpenAI

Pick Codex. Sign in with ChatGPT and it draws on the usage your plan includes, with no separate subscription.

You already pay Anthropic

Pick Claude Code. A Claude Pro or Max plan covers it, so it costs nothing extra.

You want a sandbox from the first run

Pick Codex. It starts inside an OS-enforced sandbox: writes confined to the workspace, network off for commands. On native Windows that sandbox still applies, where Claude Code runs commands unsandboxed.

You want a finer ladder of trust

Pick Claude Code. Accept edits lets file changes through while every command still stops, and auto hands routine calls to a classifier. Codex has no mode that matches accept edits.

You need to read or patch the source

Pick Codex. The CLI is Apache-2.0: audit what it sends, build it yourself, file a fix upstream.

You lean on rewinding mistakes

Pick Claude Code. It can roll a session and its file edits back to an earlier checkpoint. In Termdeck, checkpoint restore is available on Claude chats only.

You script it in CI

Either. claude -p and codex exec both run a prompt without a terminal UI and print JSON. On shared runners, OpenAI recommends an API key over a ChatGPT sign-in.

You want work to continue while your laptop sleeps

Either. Codex Cloud and Claude Code on the web both run long tasks in the vendor's cloud, so you can close the laptop and check back when they are done.

You want the free option

Codex. It is the only one of the two in a free plan, meant for quick coding tasks. Claude Code needs at least Claude Pro or an API account.

Switching

Is there a Claude Code equivalent for Codex?

Yes: Codex CLI is OpenAI's equivalent of Claude Code, and most of what you do in one has a direct counterpart in the other. If you are moving across, this is the map. Claude Code can also pull your Codex setup in: claude import codex imports config from Codex, and --dry-run shows what it would write first.

To do thisClaude CodeCodex CLI
Start in a repositoryclaudecodex
Run one prompt, no UIclaude -p "..."codex exec "..."
Continue the last sessionclaude --continuecodex resume --last
Pick a session to resumeclaude --resumecodex resume
Choose a model--model opus-m <model>
Add an MCP serverclaude mcp addcodex mcp add
Write the instruction file/init writes CLAUDE.md/init writes AGENTS.md
Custom subagents.claude/agents/*.md.codex/agents/*.toml
Skip every prompt--dangerously-skip-permissions--dangerously-bypass-approvals-and-sandbox
Extra directories--add-dir--add-dir

Flags checked against claude --help (Claude Code 2.1.309) and codex --help (codex-cli 0.163.0). Resume behaves differently under the hood: see resume a Claude Code session and resume a Codex CLI session.

Both

Can I use both Codex and Claude Code?

Yes, and plenty of people do. They are separate programs with separate logins and separate session files, so both install on one machine and run at the same time. One AGENTS.md can serve both, since Claude Code reads it when there is no CLAUDE.md. A common split is a premium plan on the hard problems and a cheaper plan on routine work.

The fairest comparison is your own repository. Install both CLIs on a machine, connect it to Termdeck, and start two chats on the same folder: one on Claude Code, one on Codex, same prompt. Both appear in one sidebar, stream into the same transcript view, and stop for approval on the same cards. Each engine runs unmodified under your own login and keeps its own session files, so claude --resume and codex resume still work in a terminal afterwards. Use Claude Code and Codex in one UI walks through the setup step by step.

Do not point both at the same chat at once: two writers fork a transcript, so Termdeck keeps a session attached to another process view-only. Termdeck uses one set of permission mode names for both engines and prints the caveat where an engine differs.

In TermdeckClaude Code chatCodex chat
Live tool approvalsYesYes
Image attachmentsYesYes
Plan modeNativeNative
Accept edits modeYesNot offered
Output of a running commandWhen it returnsAs it prints
Checkpoint restoreYesNo
Saved account switchingYesYes
Terminal resumeYesYes

The full engine table, Grok included, is on Install a coding CLI. Want GPT models inside the Claude Code CLI instead? See Codex in Claude Code.

Name confusion

Is Codex obsolete?

No, but the name has been used twice. OpenAI first called a family of code completion models in its API Codex; those (code-davinci-002, code-cushman-001 and their siblings) were shut down on 23 March 2023, which is where most "Codex is deprecated" posts come from. Today's Codex is a different product: the coding agent in the CLI, the ChatGPT desktop app, the IDE extension and Codex Cloud. It is under active development and included in every ChatGPT plan.

Individual models that Codex runs do get retired on a schedule, as with any OpenAI model, so a model name pinned in your config.toml can stop working. OpenAI's deprecations page lists the dates. The same is true of Claude models in Claude Code.

Questions

Codex vs Claude Code, answered

Is Claude Code better than Codex?

Neither is better across the board, and benchmark results go stale with every model release. The lasting differences are the plan you already pay for, how each one fences off your machine (a default OS sandbox in Codex, permission modes in Claude Code), and features such as checkpoints in Claude Code or the open source CLI in Codex. Give both the same task in the same repository and compare the diffs.

Which is cheaper, Claude Code or Codex?

Codex is cheaper to start: it is included in every ChatGPT plan, including Free and the 8 dollar Go plan, while Claude Code starts at Claude Pro at 20 dollars a month, or 17 billed yearly. At 20 dollars the entry plans cost the same, and both top tiers start at 100 dollars. Usage per plan is described differently by each vendor, so check both pricing pages.

Is there a Claude code equivalent for Codex?

Yes. Codex CLI is OpenAI's equivalent of Claude Code: claude -p maps to codex exec, claude --resume to codex resume, claude mcp to codex mcp, and CLAUDE.md to AGENTS.md. Claude Code can also import your Codex config with claude import codex.

Can I use both Codex and Claude code?

Yes. They are separate programs with separate logins and separate session files, so both can be installed on one machine and run at the same time, and one AGENTS.md can serve both. Termdeck puts them in one browser UI: pick the engine per chat, and both appear in the same sidebar with the same approval cards.

Is Codex obsolete?

No. The original Codex code completion models in OpenAI's API, such as code-davinci-002, were shut down on 23 March 2023. Today's Codex is a different product, a coding agent in the CLI, the ChatGPT desktop app, the IDE extension and Codex Cloud, and it is included in every ChatGPT plan.

What is the difference between Codex CLI and Claude Code?

Both are terminal coding agents that read your repository, edit files and run commands on your machine. Codex CLI is OpenAI's, is open source under Apache-2.0, runs OpenAI models, and sandboxes commands by default. Claude Code is Anthropic's, is closed source, runs Claude models, and gates actions mainly through permission modes, with an OS sandbox you switch on.

Does Claude Code read AGENTS.md?

Yes. Claude Code reads CLAUDE.md at the start of every session, and Anthropic documents that it can read an existing AGENTS.md in place of a CLAUDE.md. Codex CLI reads AGENTS.md, layering a global file from its home directory with project files from the repository root down to the working directory.

Do Codex CLI and Claude Code work on Windows?

Both install natively on Windows from PowerShell, as well as on macOS and Linux. Codex uses a native Windows sandbox in PowerShell. Claude Code runs commands unsandboxed on native Windows, and its sandbox needs WSL2 there.

Keep reading

Related

Use Claude Code and Codex in one UI

Install both CLIs, connect the machine, and pick the engine per chat.

A web UI for Codex CLI

What Codex gains in a browser, if Codex is the engine you mostly use.

A web UI for Claude Code

The same, for Claude Code on your own machines.

Same task, two engines, one window.

Try Codex and Claude Code side by side.