Last checked: October 2026. Models, plans and limits for both tools change every few weeks. Everything here comes from OpenAI's and Anthropic's own docs and pricing pages, listed under Sources. Check them before you buy a plan.
You pay $20 a month for one of them. A friend swears by the other. You give both the same bug in two terminals, and both fix it. So the question isn't "which one can code". It's which one fits your plan, your OS, your editor and how you like to review work.
Quick answer
- Both are full coding agents. They run in the terminal, in your IDE, in a desktop app and in the cloud. Both support MCP, hooks, subagents, worktrees and GitHub review.
Price to start: both have a $20/month plan (ChatGPT Plus, Claude Pro). Codex also has a Free tier and an $8 Go plan. Claude Code isn't included in Claude's Free plan.
Biggest differences: Codex CLI is open source (Apache-2.0) and sandboxes commands by default. Claude Code is closed source, keeps its sandbox off by default and uses permission modes plus an auto mode with a safety classifier instead.
Instructions file: Codex reads
AGENTS.md. Claude Code readsCLAUDE.md, and now also readsAGENTS.mdwhen there's noCLAUDE.md. One file can serve both.No absolute winner. Many people use both and switch when one hits its limit.
What each one is
OpenAI Codex is a family of surfaces under one name: the Codex CLI (open source at >github.com/openai/codex), an IDE extension, Codex inside the ChatGPT desktop app, Codex cloud tasks on chatgpt.com/codex, and a GitHub integration. You sign in with your ChatGPT account or use an API key.
Anthropic Claude Code is the same idea from Anthropic: a terminal CLI, extensions for VS Code (and Cursor) and JetBrains, the Code tab in the Claude desktop app, cloud sessions at claude.ai/code and in the mobile app, plus GitHub Actions and a Code Review service. You sign in with a Claude subscription or an Anthropic Console account. Its GitHub repo is "All rights reserved", so it is not open source.
Side by side
| OpenAI Codex | Anthropic Claude Code | |
|---|---|---|
| Current models | GPT-6 Astra (most capable), GPT-6.1 Sol (recommended for complex work), GPT-6 Luna (most efficient) | Opus 5.5 (default on Pro, Max, Team, Enterprise), Sonnet 5.5, Haiku 5.5, Fable 5.1 |
| Cheapest way in | Free ($0), Go ($8/month) | Pro ($20/month, or $17/month billed yearly) |
| Main individual plans | Plus $20, Pro $100 / $200 / $500 | Pro $20, Max 5x $100, Max 20x $200 |
| Team plans | Business: $20/user/month yearly, $25 monthly | Team: $20/$25 standard seats, $100/$125 premium seats |
| Limits | Plus and Business: 5-hour window in local messages, weekly limits may apply. Pro: no 5-hour limit currently | 5-hour session window plus a weekly limit on Pro and Max. Shared with Claude chat |
| Install | curl -fsSL https://chatgpt.com/codex/install.sh \| sh, npm, Homebrew, Windows installer |
curl -fsSL https://claude.ai/install.sh \| bash, Homebrew, WinGet, apt/dnf/apk |
| Open source | Yes, CLI under Apache-2.0 | No |
| Sandbox | On by default (workspace-write). Seatbelt on macOS, bubblewrap on Linux, native sandbox on Windows |
Off by default, turn on with /sandbox. Seatbelt on macOS, bubblewrap on Linux and WSL2. No sandbox on native Windows |
| Approvals | on-request or never, set with /permissions |
Manual, accept edits, plan, auto (classifier reviews actions), dontAsk, bypassPermissions |
| Instructions file | AGENTS.md (plus AGENTS.override.md) |
CLAUDE.md, or AGENTS.md when no CLAUDE.md exists |
| MCP | Yes: codex mcp add, stdio and streamable HTTP |
Yes: servers in settings or a project .mcp.json |
| Hooks | Yes, on by default; hooks.json or config.toml |
Yes; settings files |
| Subagents | Yes, TOML files in .codex/agents/; spawned when you ask |
Yes, Markdown files in .claude/agents/; Claude can delegate on its own |
| Worktrees | codex --worktree in the CLI; managed by the desktop app |
claude --worktree <name> in the CLI |
| Cloud / background | Codex cloud tasks (web, app, mobile, CLI) | Cloud sessions (claude --cloud), routines, background agents |
| IDE | VS Code, Cursor, Windsurf, Xcode, JetBrains | VS Code, Cursor, JetBrains |
| GitHub | @codex review, automatic reviews, @codex tasks |
@claude via GitHub Actions; Code Review service on Team/Enterprise |
Models
Codex recommends GPT-6.1 Sol for complex coding when your account has it, and GPT-6 Luna for focused, high-volume tasks. GPT-6 Astra is described as the most capable model. GPT-6.1 Sol isn't in the launch rollout for Free and Go. On Free you get GPT-6 Luna at standard speed in the desktop app.
Claude Code defaults to Opus 5.5 on every paid plan. You switch with /model: sonnet for everyday work, haiku for simple tasks, fable for the hardest and longest tasks. Fable is not the default on any plan. On Pro it runs on usage credits; on Max it has its own weekly limit.
We don't quote benchmarks here. They change with every release. Try both on your own repo for a day.
Plans, prices and limits
Codex comes with ChatGPT plans:
- Free ($0) and Go ($8) for light tasks.
- Plus ($20): a five-hour window measured in local messages. OpenAI publishes ranges per model (for example 15–160 messages with GPT-6.1 Sol). Weekly limits may also apply.
- Pro (from $100, also $200 and $500): currently no five-hour limit. The $500 tier adds "ultrafast" speed.
- Business: $20 per user per month billed yearly, $25 monthly.
- Fast modes cost more: 2.5× your included usage (ultrafast 8×).
Claude Code comes with Claude plans. Free doesn't include it.
- Pro ($20, or $17/month yearly): a five-hour session window and a weekly limit.
- Max 5x ($100) and Max 20x ($200): 5× and 20× Pro's per-session usage, plus a separate weekly limit for Fable.
- Team: standard seats $20 ($25 monthly), premium seats $100 ($125 monthly).
- The same allowance covers Claude chat on web, desktop and mobile, so long chats eat into your coding time.
How to check: /status in Codex, /usage in Claude Code. Our Claude Code usage limits guide explains both in detail.
Install
Both install with one line (see the table) and start with codex or claude in your project folder. Codex also installs with npm or Homebrew. Claude Code also installs with Homebrew or WinGet; only its native installer updates itself.
Sandbox and permissions
This is where the two differ the most.
Codex sandboxes by default. In workspace-write mode it can read, edit inside the workspace and run routine commands, and asks you (on-request) to go further. danger-full-access removes all limits.
Claude Code leans on permission modes. New interactive sessions start in auto mode (from v2.1.283): a separate classifier model reviews each action and blocks things like force pushes, curl | bash or sending secrets out. You can switch with Shift+Tab to manual, accept edits or plan mode. The OS-level sandbox for shell commands exists but is off by default; /sandbox turns it on, and then network access goes through a proxy with an allowlist.
Codex limits what a command can touch. Claude Code judges whether an action makes sense. In Claude Code you can turn on both.
AGENTS.md vs CLAUDE.md
Codex reads AGENTS.md: a global one in ~/.codex/, then one per folder from the repo root down. AGENTS.override.md wins in the same folder. The combined limit is 32 KiB by default, and project_doc_fallback_filenames in config.toml adds other file names.
Claude Code reads CLAUDE.md (user, project, local and managed levels) and keeps its own auto memory. Since v2.1.277 it reads AGENTS.md directly when there's no CLAUDE.md. If you have both, it reads only CLAUDE.md, unless you set Project instructions to claude-md-and-agents-md in /config.
MCP, hooks and subagents
MCP: both connect to MCP servers. Codex supports local (stdio) and streamable HTTP servers and keeps them in config.toml (~/.codex/ or the project's .codex/). Claude Code keeps them in its settings or a project .mcp.json. The same server usually works in both.
Hooks: both run your scripts at points in the agent loop, with many of the same event names, such as PreToolUse, PostToolUse and SessionStart. In Codex, hooks you didn't get from an admin must be reviewed and trusted with /hooks before they run.
Subagents: Codex spawns them only when you ask (or when AGENTS.md says to). Claude Code can hand work to them on its own.
Worktrees, cloud and background work
Worktrees: codex --worktree starts a CLI session in a new managed worktree, and the Codex desktop app manages worktrees for its chats. Claude Code has claude --worktree feature-auth, so each terminal gets its own checkout. See our guide to parallel Claude Code sessions.
Cloud: Codex cloud tasks run in a cloud environment you set up, keep working while your computer sleeps, and end in a diff you can turn into a PR. Claude Code cloud sessions run in an Anthropic-managed VM, start with claude --cloud "task", and come back to your terminal with claude --teleport. Both count toward your plan's limits.
IDE and GitHub
IDE: Codex covers VS Code, Cursor and Windsurf with its extension, and Xcode and JetBrains through their own integrations. Claude Code has a VS Code extension (also for Cursor) and a JetBrains plugin.
GitHub: comment @codex review on a PR, or turn on automatic reviews; Codex flags only P0 and P1 issues. With Claude Code, /install-github-app sets up @claude in GitHub Actions. Its managed Code Review service is for Team and Enterprise; anyone can run /code-review locally.
Which one should you pick
- You already pay for ChatGPT Plus: start with Codex. It's included, and Free/Go let you try it at no cost.
- You already pay for Claude Pro or Max: start with Claude Code, for the same reason.
- You want to read or change the agent's code: Codex CLI is open source. Claude Code isn't.
- You want a sandbox from the first minute: Codex. With Claude Code, turn on
/sandboxyourself. - You want fewer prompts without giving up checks: Claude Code's auto mode is built for that.
- You work on native Windows: Codex has a native Windows sandbox. Claude Code runs on Windows, but its sandbox needs WSL2.
- You use Xcode or Windsurf: Codex has integrations there. Claude Code doesn't list them.
- You hit the limit every week: compare Codex Pro (no 5-hour limit right now) with Claude Max 20x, or keep one $20 plan of each.
Using both
Plenty of developers keep both open. A few habits help:
- Keep one
AGENTS.md. Codex reads it. Claude Code reads it when there's noCLAUDE.md. If you need Claude-only rules, create aCLAUDE.mdwith@AGENTS.mdon the first line and the extra rules below. - Share MCP servers. Add the same servers to both. Most work unchanged.
- One task per worktree. Give each agent its own checkout so they don't edit the same files.
- Review one with the other. Let one write the change and ask the other to review the diff.
- Watch two sets of limits. Two plans means two five-hour windows and two weekly limits.
Where Aki fits
Aki is a free, source-available Mac app (>github.com/muriloprataviera/aki) that works with both.
- One sidebar for both agents. It shows one ring per open Claude Code or Codex session, plus the weekly limit of each tool, so you see which one has room left.
- Point instead of describe. Press ⇧⌘A, click an element in Chrome, drag an area or pick lines in the terminal, and write what should change. Aki sends the marks to the right session: a
localhostpage goes to the worktree running that port, anything else to the session you picked in the sidebar.
It's Mac only (Apple Silicon, macOS 14+), with no account.
FAQ
Is Codex better than Claude Code?
Neither is better for everyone. Both have MCP, hooks, subagents, cloud tasks and GitHub review. The real differences are price tiers, the sandbox approach, open vs closed source, and which plan you already pay for.
Is Codex free?
Codex has a Free tier ($0) for quick tasks, using GPT-6 Luna in the desktop app. Plus ($20) and above add more models and more usage. Claude Code needs a paid Claude plan, from Pro at $20.
Is Claude Code open source?
No. Its GitHub repository is "All rights reserved" and use falls under Anthropic's Commercial Terms. The Codex CLI is open source under Apache-2.0.
Can Claude Code read AGENTS.md?
Yes, since v2.1.277, when your project has no CLAUDE.md. With both files, it reads only CLAUDE.md unless you change Project instructions in /config or import @AGENTS.md from your CLAUDE.md.
Which one has higher usage limits?
It depends on the plan. Codex Pro currently has no five-hour limit, though weekly limits may apply. Claude Max 20x gives 20× Pro's per-session usage, with a weekly limit. Neither vendor publishes exact weekly numbers.
Can I use Codex and Claude Code on the same repo?
Yes. Share one AGENTS.md, add the same MCP servers to both, and give each agent its own worktree so they don't edit the same files at once.
Sources
- https://learn.chatgpt.com/docs/pricing
- https://learn.chatgpt.com/docs/models
- https://learn.chatgpt.com/docs/codex/cli
- https://learn.chatgpt.com/docs/sandboxing
- https://learn.chatgpt.com/docs/hooks
- https://learn.chatgpt.com/docs/agent-configuration/agents-md
- https://learn.chatgpt.com/docs/agent-configuration/subagents
- https://learn.chatgpt.com/docs/environments/git-worktrees
- https://learn.chatgpt.com/docs/cloud
- https://learn.chatgpt.com/docs/app
- https://learn.chatgpt.com/docs/ide
- https://learn.chatgpt.com/docs/extend/mcp
- https://learn.chatgpt.com/docs/code-review
- https://learn.chatgpt.com/docs/third-party/github
- https://github.com/openai/codex
- https://claude.com/pricing
- https://support.claude.com/en/articles/11049741-what-is-the-max-plan
- https://code.claude.com/docs/en/overview
- https://code.claude.com/docs/en/model-config
- https://code.claude.com/docs/en/memory
- https://code.claude.com/docs/en/sandboxing
- https://code.claude.com/docs/en/permission-modes
- https://code.claude.com/docs/en/common-workflows
- https://code.claude.com/docs/en/claude-code-on-the-web
- https://code.claude.com/docs/en/github-actions
- https://code.claude.com/docs/en/code-review
- https://github.com/anthropics/claude-code
- https://useaki.vercel.app