Skip to main content
Claude CodeVSOpenAI Codex

Claude Code vs OpenAI Codex

OpenAI's coding agent, now part of ChatGPT: the same terminal-plus-cloud idea as Claude Code, with a cheaper default model and slightly lower benchmark scores.

Checked •24 things compared•Sources linked
The short answer

Claude Code leads the independent Terminal-Bench 4.0 board and is better at running many agents at once. Codex gets close for a fraction of the token cost, ships an open-source CLI and lets you use your plan in other tools, so ChatGPT subscribers should try it first.

Pick Claude Code if

  • You want the top independent benchmark scores (64.8% vs 58.2% on Terminal-Bench 4.0)
  • You run big jobs with many subagents and want to see what each one does
  • You want built-in /rewind checkpoints instead of managing Git snapshots
  • You already pay for Claude and use Claude chat too

Pick OpenAI Codex if

  • You already pay for ChatGPT Plus or Pro
  • Cost per task matters more than the last few points of quality
  • You want an open-source (Apache-2.0) CLI
  • You want to use your plan in other tools via "Sign in with ChatGPT"

At a glance

Claude Code

Anthropic
What it is
Agentic coding tool that reads your repo, edits files and runs commands
Where it runs
Terminal, VS Code, JetBrains, desktop app, web (cloud sessions), iOS and Android
Models
Claude: Opus 5.5 (default on paid plans), Sonnet 5.5, Haiku 5.5, Fable 5.1
Starts at
Pro $20/mo ($17/mo billed yearly). The Free plan does not include Claude Code
Best for
Hard multi-file work, long autonomous runs, heavy customization with hooks, skills and subagents

OpenAI Codex

OpenAI
What it is
Coding agent inside ChatGPT: CLI, IDE extension, desktop app and cloud tasks
Where it runs
Terminal, VS Code/Cursor/Windsurf, ChatGPT desktop app, web, ChatGPT mobile
Models
OpenAI: GPT-6.1 Sol (default), GPT-6 Astra, GPT-6 Luna
Starts at
Free and Go ($8) get GPT-6 Luna; Plus $20/mo for full Codex
Best for
ChatGPT subscribers, low cost per task, unattended cloud tasks

Feature by feature

Clear edgeRows without a highlight are a tie or a matter of taste.

Basics

Claude CodeOpenAI Codex
What it isTerminal agent, plus VS Code, JetBrains, desktop, web and mobileCLI, IDE extension, the Codex view in the ChatGPT desktop app, and Codex Cloud
Open sourceNo. The GitHub repo holds docs and plugins; the code is all rights reservedCLI, SDK, skills and plugins are Apache-2.0. App, IDE extension and cloud are closed. No outside PRs accepted
PlatformsmacOS 13+, Windows 10+ (native or WSL), Ubuntu 20.04+ and other LinuxCLI on macOS, Linux, Windows. Desktop app on macOS, Windows, Linux (preview)
Installcurl -fsSL https://claude.ai/install.sh | bash, Homebrew, WinGet, apt/dnfcurl -fsSL https://chatgpt.com/codex/install.sh | sh, npm, Homebrew

Models & context

Claude CodeOpenAI Codex
ModelsClaude: Opus 5.5 default, Sonnet 5.5, Haiku 5.5, Fable 5.1OpenAI: GPT-6.1 Sol default, GPT-6 Astra, GPT-6 Luna. Bedrock and Responses-API gateways
Default model API priceOpus 5.5: $4 in / $20 out per 1M tokensGPT-6.1 Sol: $2 in / $10 out per 1M tokens
Context window1M tokens by default on current models, 200K opt-out1.05M on the API (2x input price past 272K). Window inside ChatGPT plans not documented
Terminal-Bench 4.0 (independent board, Oct 2026)64.8% (Opus 5.5, max), 61.8% (Sonnet 5.5)58.2% (GPT-6.1 Sol or GPT-6 Astra, max)
Cost of one full run (same board)About $4.7k with Opus 5.5About $634 with GPT-6.1 Sol

Agent features

Claude CodeOpenAI Codex
Subagents and parallel workCustom subagents, worktree isolation, /batch, dynamic workflows (GA)Subagents on by default, "Ultra" effort fans out to parallel subagents, worktrees
Long and background runs/goal, cloud sessions, scheduled tasks (preview)/goal (GA) runs "for hours or even days", Codex Cloud keeps going while your laptop sleeps
Hooks, skills, plugins, MCPHooks, skills, plugins with marketplaces, MCP with tool searchHooks (GA May 2026), skills, plugins, MCP client. Codex as an MCP server was removed in Sept 2026
Memory fileCLAUDE.md, AGENTS.md (since Sept 2026), auto memoryAGENTS.md (global and per directory), Memories in the app
Undo/rewind checkpoints track every file editNo built-in rewind found. Docs say to make Git checkpoints before and after a task
SafetySandboxed Bash (Linux, macOS, WSL2), permission modes, auto modeOS sandbox incl. native Windows, auto-review agent for approvals

Workflow & integrations

Claude CodeOpenAI Codex
IDEVS Code extension (also installs in Cursor), JetBrains pluginExtension for VS Code, Cursor, Windsurf. Xcode and JetBrains integrations
CI and GitHub-p headless mode, GitHub Actions, GitLab CI, Agent SDK (Python, TS)codex exec, openai/codex-action, @codex review on PRs, TypeScript SDK
Phone and remoteiOS and Android app: start cloud sessions, Remote Control local onesChatGPT mobile app starts, steers and approves Cloud or connected-computer tasks
Moving your setupReads AGENTS.md directlyDesktop app imports Claude Code instructions, settings, skills, plugins and projects

Pricing & limits

Claude CodeOpenAI Codex
Entry pricePro $20/mo. No Claude Code on FreeFree and Go $8 get GPT-6 Luna in the desktop app. Plus $20 for full Codex
Top individual planMax 20x $200/moPro at $100, $200 or $500/mo
How limits workRolling 5-hour window + weekly caps, shared with Claude chat. No fixed message countEstimated messages per 5-hour window (Plus: 15-160 on GPT-6.1 Sol). Pro has no 5-hour limit for now
Use your plan in other toolsNo. Pro/Max login is only for Claude Code and claude.aiYes. "Sign in with ChatGPT" works in 16 partner tools

Privacy & licensing

Claude CodeOpenAI Codex
Training on your dataConsumer plans: you choose. 5-year retention if training is on, 30 days if off. Team/API: no training by defaultBusiness, Enterprise, Edu: no training by default. Consumer default not confirmed in our check

Pricing

Claude Code

Free
Claude chat only, no Claude Code
$0
Pro
Claude Code included. $17/mo billed yearly
$20/mo
Max 5x
5x Pro usage per 5-hour session
$100/mo
Max 20x
20x Pro usage per 5-hour session
$200/mo
Team / Enterprise / API
Team Premium $125/seat. Enterprise $20/seat + API usage. API: Opus 5.5 $4/$20 per 1M tokens
from $25/seat

OpenAI Codex

Free
GPT-6 Luna, desktop app only, subject to rollout
$0
Go
Same Codex access as Free
$8/mo
Plus
Codex on web, CLI, IDE, iOS. GPT-6.1 Sol and Luna
$20/mo
Pro
Three tiers. No 5-hour limit for now. Ultrafast on $500
$100-$500/mo
Business
$20 billed yearly. SSO, larger cloud VMs. API key: CLI/IDE only
$25/user/mo

Both cap usage in rolling 5-hour windows and neither publishes weekly numbers. Codex lists per-model message estimates; Claude Code shares one pool with Claude chat and gives no counts.

topFDEjobs
Forward Deployed Engineer roles

Building with Claude? Get paid for it.

Forward Deployed Engineers ship AI agents inside real customer systems. Open roles at Anthropic, OpenAI, Cognizant and more.

Up to $325k Anthropic, OpenAI, more Updated daily
Browse FDE jobs
Browse FDE jobs on topFDEjobs

The same job in both

How a typical task plays out in each tool. This is where the difference in approach shows.

Refactor a module across 40 files
Claude Code

Plan mode first, then /batch splits the change across 5-30 worktree subagents. Opus 5.5 has 1M context by default, and /rewind rolls back a bad step.

OpenAI Codex

/plan asks clarifying questions, then Ultra effort or /worktree spreads the work. You make Git checkpoints yourself, since there is no built-in rewind.

Fix a failing CI run
Claude Code

Mention @claude on the PR through the GitHub Action, run claude -p in the pipeline, or let a cloud session auto-fix the PR.

OpenAI Codex

openai/codex-action runs codex exec in CI, or kick off a Codex Cloud task from the PR. @codex review checks the fix.

Leave a big task running unattended
Claude Code

/goal keeps working until a condition is met. Cloud sessions keep running after you close the laptop.

OpenAI Codex

/goal is built for runs of "hours or even days", and Cloud tasks continue while your computer sleeps. Pro has no 5-hour cap right now.

Check on work from your phone
Claude Code

The Claude app starts and monitors cloud sessions, and Remote Control drives a session running on your own machine.

OpenAI Codex

The ChatGPT mobile app starts, steers and approves tasks on Codex Cloud or a connected Mac or Windows PC.

What developers say

Claude Code

Praised for
  • Opus 5.5 cut "done, but it doesn't work" loops (Reddit)
  • Better at running many agents and showing what subagents do (HN)
  • Holds the top two Terminal-Bench 4.0 spots
Complaints
  • Weekly caps drain fast on heavy Opus use
  • Most expensive and slowest harness on the Artificial Analysis index
  • Security requests get rerouted to an older model

OpenAI Codex

Praised for
  • "Best bang for your buck", and the plan works in other tools (HN)
  • A good second-opinion reviewer next to Claude Code (HN)
  • Some rate it slightly above Claude Code (HN, Astra launch)
Complaints
  • Astra "blows through usage limits too fast" for daily use (HN)
  • Writes odd code despite house-style rules (HN)
  • The Codex app was folded into ChatGPT's desktop app (HN)

Switching, or using both

Moving from OpenAI Codex to Claude Code

  1. 1.Install: curl -fsSL https://claude.ai/install.sh | bash, then run claude and log in with Pro or Max.
  2. 2.Keep AGENTS.md. Claude Code reads it directly (since v2.1.277); add CLAUDE.md only for Claude-specific notes.
  3. 3.Port your Codex skills into .claude/skills/ so Claude Code can load them.
  4. 4.Re-create hooks: Codex events like PreToolUse, PostToolUse and Stop map to Claude Code hooks.
  5. 5.Re-add your MCP servers in Claude Code's MCP config.

Running both side by side

A common HN setup: Claude Code writes, Codex reviews. One user calls Codex from a Claude Code hook at commit time for a second opinion. Both read AGENTS.md, so one instruction file covers both.

More Claude Code comparisons

Frequently asked questions

Is Claude Code better than Codex?

On the independent Terminal-Bench 4.0 board (Oct 2026), Claude Code with Opus 5.5 scores 64.8% and Codex with GPT-6.1 Sol or GPT-6 Astra scores 58.2%. Codex reached its score for about $634 per full run against about $4.7k for Opus 5.5. Claude Code wins on quality, Codex on cost per task.

Claude Code vs Codex pricing: which is cheaper?

Both start at $20/mo (Claude Pro, ChatGPT Plus). Codex also has Free and Go ($8) with GPT-6 Luna only. Top plans: Claude Max 20x at $200, ChatGPT Pro at $100, $200 or $500. On the API, GPT-6.1 Sol costs $2/$10 per 1M tokens and Opus 5.5 costs $4/$20.

Can Codex use Claude models?

Not out of the box. Codex is built for OpenAI models, and custom providers must offer a Responses-API-compatible endpoint. Claude Code is built for Claude models, via Anthropic or Bedrock, Google Cloud and Foundry.

Is Codex open source?

The Codex CLI, SDK, skills and plugins are Apache-2.0, though the repo does not accept outside pull requests. The desktop app, IDE extension and cloud are closed. Claude Code is not open source at all.

Which has better usage limits?

ChatGPT Pro currently has no 5-hour limit, while Claude Code plans use 5-hour and weekly caps shared with Claude chat. Anthropic raised 5-hour limits with Opus 5.5. Users report hitting limits on both, especially with GPT-6 Astra and Opus.

Which is better for beginners?

Codex is cheaper to try: Free and Go include GPT-6 Luna in the ChatGPT desktop app. Claude Code needs at least Pro at $20. Both have a desktop app if you would rather not start in the terminal.

Can I use Claude Code and Codex together?

Yes. Both read AGENTS.md, Codex can import your Claude Code setup, and a common pattern is Claude Code for building and Codex for review.

WebMCP Developers