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
Basics
| Claude Code | OpenAI Codex | |
|---|---|---|
| What it is | Terminal agent, plus VS Code, JetBrains, desktop, web and mobile | CLI, IDE extension, the Codex view in the ChatGPT desktop app, and Codex Cloud |
| Open source | No. The GitHub repo holds docs and plugins; the code is all rights reserved | CLI, SDK, skills and plugins are Apache-2.0. App, IDE extension and cloud are closed. No outside PRs accepted |
| Platforms | macOS 13+, Windows 10+ (native or WSL), Ubuntu 20.04+ and other Linux | CLI on macOS, Linux, Windows. Desktop app on macOS, Windows, Linux (preview) |
| Install | curl -fsSL https://claude.ai/install.sh | bash, Homebrew, WinGet, apt/dnf | curl -fsSL https://chatgpt.com/codex/install.sh | sh, npm, Homebrew |
Models & context
| Claude Code | OpenAI Codex | |
|---|---|---|
| Models | Claude: Opus 5.5 default, Sonnet 5.5, Haiku 5.5, Fable 5.1 | OpenAI: GPT-6.1 Sol default, GPT-6 Astra, GPT-6 Luna. Bedrock and Responses-API gateways |
| Default model API price | Opus 5.5: $4 in / $20 out per 1M tokens | GPT-6.1 Sol: $2 in / $10 out per 1M tokens |
| Context window | 1M tokens by default on current models, 200K opt-out | 1.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.5 | About $634 with GPT-6.1 Sol |
Agent features
| Claude Code | OpenAI Codex | |
|---|---|---|
| Subagents and parallel work | Custom 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, MCP | Hooks, skills, plugins with marketplaces, MCP with tool search | Hooks (GA May 2026), skills, plugins, MCP client. Codex as an MCP server was removed in Sept 2026 |
| Memory file | CLAUDE.md, AGENTS.md (since Sept 2026), auto memory | AGENTS.md (global and per directory), Memories in the app |
| Undo | /rewind checkpoints track every file edit | No built-in rewind found. Docs say to make Git checkpoints before and after a task |
| Safety | Sandboxed Bash (Linux, macOS, WSL2), permission modes, auto mode | OS sandbox incl. native Windows, auto-review agent for approvals |
Workflow & integrations
| Claude Code | OpenAI Codex | |
|---|---|---|
| IDE | VS Code extension (also installs in Cursor), JetBrains plugin | Extension 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 remote | iOS and Android app: start cloud sessions, Remote Control local ones | ChatGPT mobile app starts, steers and approves Cloud or connected-computer tasks |
| Moving your setup | Reads AGENTS.md directly | Desktop app imports Claude Code instructions, settings, skills, plugins and projects |
Pricing & limits
| Claude Code | OpenAI Codex | |
|---|---|---|
| Entry price | Pro $20/mo. No Claude Code on Free | Free and Go $8 get GPT-6 Luna in the desktop app. Plus $20 for full Codex |
| Top individual plan | Max 20x $200/mo | Pro at $100, $200 or $500/mo |
| How limits work | Rolling 5-hour window + weekly caps, shared with Claude chat. No fixed message count | Estimated 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 tools | No. Pro/Max login is only for Claude Code and claude.ai | Yes. "Sign in with ChatGPT" works in 16 partner tools |
Privacy & licensing
| Claude Code | OpenAI Codex | |
|---|---|---|
| Training on your data | Consumer plans: you choose. 5-year retention if training is on, 30 days if off. Team/API: no training by default | Business, Enterprise, Edu: no training by default. Consumer default not confirmed in our check |
Pricing
Claude Code
OpenAI Codex
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.
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.
The same job in both
How a typical task plays out in each tool. This is where the difference in approach shows.
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.
/plan asks clarifying questions, then Ultra effort or /worktree spreads the work. You make Git checkpoints yourself, since there is no built-in rewind.
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-action runs codex exec in CI, or kick off a Codex Cloud task from the PR. @codex review checks the fix.
/goal keeps working until a condition is met. Cloud sessions keep running after you close the laptop.
/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.
The Claude app starts and monitors cloud sessions, and Remote Control drives a session running on your own machine.
The ChatGPT mobile app starts, steers and approves tasks on Codex Cloud or a connected Mac or Windows PC.
What developers say
Claude Code
- 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
- 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
- "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)
- 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.Install: curl -fsSL https://claude.ai/install.sh | bash, then run claude and log in with Pro or Max.
- 2.Keep AGENTS.md. Claude Code reads it directly (since v2.1.277); add CLAUDE.md only for Claude-specific notes.
- 3.Port your Codex skills into .claude/skills/ so Claude Code can load them.
- 4.Re-create hooks: Codex events like PreToolUse, PostToolUse and Stop map to Claude Code hooks.
- 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.
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.
- Claude Code overview
- Claude pricing
- Claude Code model config
- Claude Code data usage
- Claude Code license
- Claude Opus 5.5 announcement
- Codex pricing
- Codex models
- Codex changelog
- Codex open source scope
- openai/codex on GitHub
- GPT-6.1 Sol API model page
- Terminal-Bench 4.0 leaderboard
Prices and features change often. Everything here was checked against official pages on 2026-10-21. Spotted something out of date? Tell us on GitHub.

