> ## Content Index
> Fetch the complete content index at: https://claudefox.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Claude Code vs Codex CLI (2026): which coding agent to use
- URL: https://claudefox.com/claude-code-vs-codex/
- Published: 2026-11-20T07:07:07.000Z
- Updated: 2026-11-20T11:44:49.000Z
- Description: A sourced comparison of Anthropic's Claude Code and OpenAI's Codex CLI in November 2026: who should pick which, an at-a-glance table, subscription and API pricing, usage limits, sandboxing, extensions and install, with every figure from the vendors' own pages.
- Author: hupicake
- Tags: Tips

*Updated November 20, 2026: Rechecked against both vendors' pages on November 20: updated versions and star counts, added OpenAI's long-context and Ultrafast rates, and tightened the sandbox and plan details.*

Last checked: 2026-11-20\. Claude Code facts come from Anthropic's Claude Code docs, claude.com pricing and the Claude Help Center; Codex facts come from OpenAI's Codex documentation, its API pricing page and the openai/codex GitHub repository. On that date the newest stable releases were Claude Code 2.1.329 (published November 19) and Codex CLI 0.171.0 (published November 20), according to GitHub. We do not rank the two on benchmarks here; the FAQ points to the independent evaluations we have covered.

Both are terminal coding agents that read your repository, edit files and run commands, and both come with IDE extensions, desktop apps, cloud runs, MCP, skills, subagents, hooks and plugins. The real differences are the models behind them, how each plan meters usage, how the sandbox works by default, and whether you can read the source.

## Pick Claude Code if

Claude Code fits best if you already work with Anthropic's plans and models:

- You already pay for Claude Pro, Max, Ultra or Team. Claude Code is included and shares your plan's usage.
- You want Anthropic's models: Opus 5.5 is Claude Code's default on subscriptions and the API, and Fable 5.2 is one /model command away (on Pro, only through usage credits).
- You want a 1M-token context window by default. Fable models, Opus 4.7 and later, Sonnet 5 and later, and Haiku 5.5 run with it in Claude Code.
- You need Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry, or signed apt, dnf and apk repositories and WinGet for fleet installs.
- You use JetBrains IDEs or want Claude Code in Slack and on the web as well as the terminal.

## Pick Codex if

Codex fits best if you already pay for ChatGPT or want an open-source CLI with a sandbox on by default:

- You already pay for ChatGPT. Plus at $20 a month includes Codex in the CLI, the IDE extension, the web and iOS.
- You want an open-source CLI. Codex CLI is Apache-2.0 licensed on GitHub; Claude Code is proprietary.
- You want OpenAI's GPT-6.2 Astra and GPT-6.2 Sol models, which OpenAI lists for Plus, Pro, Business, Enterprise and Edu in the Codex app and CLI.
- You want an OS sandbox on by default, including on native Windows. Codex runs local commands in a sandbox with network access off (on Linux and WSL 2 you install bubblewrap first). Claude Code's sandbox is opt-in and not available on native Windows; its default auto mode relies on background safety checks instead, where the session supports it.
- You are a heavy user who wants no 5-hour window. OpenAI says ChatGPT Pro plans currently have no five-hour limit, though weekly limits may apply.

## Claude Code vs Codex at a glance

Entry prices and flagship API prices match; the licence, default sandbox and plan metering differ. Each cell links its source:

__Each cell links the vendor page it comes from. Star counts and release dates from the GitHub API on November 20, 2026.__
| Feature                       | Claude Code                                                                                                                                                   | Codex CLI                                                                                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Maker and license             | [Anthropic; proprietary, all rights reserved](https://github.com/anthropics/claude-code/blob/main/LICENSE.md?ref=claudefox.com)                               | [OpenAI; open source, Apache-2.0](https://github.com/openai/codex?ref=claudefox.com)                                                                           |
| Latest stable version, Nov 20 | [2.1.329, published Nov 19](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md?ref=claudefox.com)                                               | [0.171.0, published Nov 20](https://github.com/openai/codex/releases/tag/rust-v0.171.0?ref=claudefox.com)                                                      |
| Cheapest plan with the CLI    | [Claude Pro, $20 a month or $17 billed annually](https://claude.com/pricing?ref=claudefox.com)                                                                | [ChatGPT Plus, $20 a month](https://learn.chatgpt.com/docs/pricing?ref=claudefox.com)                                                                          |
| Heavier plans                 | [Max $100, Ultra $200 a month](https://claude.com/pricing?ref=claudefox.com)                                                                                  | [Pro at $100, $200 or $500 a month](https://learn.chatgpt.com/docs/pricing?ref=claudefox.com)                                                                  |
| Team plans                    | [Team $20 or $100 per seat a month billed annually](https://claude.com/pricing?ref=claudefox.com)                                                             | [Business $20 per user a month billed annually, 2+ users](https://learn.chatgpt.com/docs/pricing?ref=claudefox.com)                                            |
| Usage limits                  | [5-hour and weekly; no 5-hour limit on verified Ultra](https://support.claude.com/en/articles/11647753-how-do-usage-and-length-limits-work?ref=claudefox.com) | [5-hour estimates for Plus and Business; Pro currently has no 5-hour limit; weekly limits may apply](https://learn.chatgpt.com/docs/pricing?ref=claudefox.com) |
| Default model                 | [Opus 5.5](https://code.claude.com/docs/en/model-config?ref=claudefox.com)                                                                                    | [Pick with /model or -m; GPT-6.2 Sol for everyday work, Astra for demanding work](https://learn.chatgpt.com/docs/models?ref=claudefox.com)                     |
| Flagship API price per MTok   | [Fable 5.2 $8 in, $40 out; Opus 5.5 $4, $20](https://platform.claude.com/docs/en/about-claude/pricing?ref=claudefox.com)                                      | [GPT-6.2 Astra $8 in, $40 out; GPT-6.2 Sol $2, $10 (prompts up to 272K tokens)](https://developers.openai.com/api/docs/pricing?ref=claudefox.com)              |
| Install                       | [curl or irm script, Homebrew, WinGet, apt, dnf, apk, npm](https://code.claude.com/docs/en/setup?ref=claudefox.com)                                           | [curl or irm script, npm, Homebrew](https://learn.chatgpt.com/docs/codex/cli?ref=claudefox.com)                                                                |
| Command sandbox               | [Off by default; macOS, Linux, WSL 2](https://code.claude.com/docs/en/sandboxing?ref=claudefox.com)                                                           | [On by default, network off; macOS, Linux, WSL 2, native Windows](https://learn.chatgpt.com/docs/sandboxing?ref=claudefox.com)                                 |
| Project instructions          | [CLAUDE.md; can read AGENTS.md](https://code.claude.com/docs/en/memory?ref=claudefox.com)                                                                     | [AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md?ref=claudefox.com)                                                                    |
| GitHub stars, Nov 20          | [156,402](https://github.com/anthropics/claude-code?ref=claudefox.com)                                                                                        | [135,961](https://github.com/openai/codex?ref=claudefox.com)                                                                                                   |

## How does Claude Code pricing compare with Codex pricing?

At the entry level the two are priced the same: Claude Pro and ChatGPT Plus both cost $20 a month, and both include their coding agent. Anthropic discounts Pro to $17 a month on annual billing. Neither free tier gives you the CLI: the free Claude plan excludes Claude Code, and OpenAI lists ChatGPT Free and the $8 Go plan only with GPT-6 Luna in the desktop app, subject to rollout.

Above that, Anthropic sells Max at $100 with 5x Pro's usage and Ultra at $200 with 10x Pro's weekly usage. OpenAI sells three Pro tiers at $100, $200 and $500 a month, with Ultrafast mode access listed for the $500 tier; OpenAI's pricing page says Ultrafast on GPT-6.2 Astra and Sol uses included usage at 6x the Standard rate. For teams, Claude Team costs $20 per Standard seat or $100 per Premium seat billed annually; ChatGPT Business costs $20 per user billed annually, $25 monthly.

On API keys, the flagship prices line up exactly: Claude Fable 5.2 and GPT-6.2 Astra both list at $8 per million input tokens and $40 per million output tokens. Sonnet 5.5 and GPT-6.2 Sol both list at $2 and $10\. The differences are in the details: Fable 5.2's cache hits cost $0.20 per million tokens against Astra's $0.40, and OpenAI's rates apply to prompts up to 272K input tokens, above which Astra costs $16 and $60 and Sol $4 and $15\. Claude bills its 1M context at standard rates on Fable, Opus and Sonnet, while Haiku 5.5 costs more on prompts over 100K tokens. Opus 5.5, Claude Code's default, sits between them at $4 and $20.

Our Claude Code pricing guide breaks down Anthropic's side in more detail, including worked session costs, and our API pricing calculator works out a cost for your own token mix.

## How do the usage limits differ?

Both meter subscription usage over five-hour windows, and both can add weekly limits; neither gives a fixed message count. Anthropic describes limits relative to Pro: Max gets 5x every five hours and every week, and Ultra 10x a week with no five-hour limit once the account is verified. Max and Ultra also have a separate weekly limit for Fable, which can use up to half of the weekly limit.

OpenAI publishes ranges instead. For Plus and Standard Business it estimates 6 to 50 local messages per five hours with GPT-6.2 Astra and 17 to 180 with GPT-6.2 Sol, and says the numbers are estimates rather than fixed limits. Past the limit, both let you keep going: Claude with usage credits at API rates, Codex with ChatGPT credits or an API key. Codex shows remaining limits in a CLI session with /status; in Claude Code, /usage shows your plan limits and when they reset. Our usage limits guide covers the Claude side.

## How do the features compare?

Feature for feature they are close; the biggest gaps are the safety model and the surfaces each runs on:

- Models and context: Claude Code runs Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 with a 1M-token window by default. OpenAI lists a default context in Codex of 272,000 tokens for GPT-6.2 Astra and 500,000 for GPT-6.2 Sol; both support up to 1 million tokens if you set model\_context\_window.
- Safety model: Codex combines an OS-enforced sandbox, limited by default to the workspace with no network, with an approval policy; on native Windows it uses a Windows sandbox. Claude Code relies on permission modes: since v2.1.283 terminal and VS Code sessions start in auto mode, which runs actions with background safety checks, falling back to Manual mode when auto mode is unavailable. In Manual mode Claude Code asks before most actions that edit files, run shell commands or reach the network. Its OS sandbox for shell commands is optional and covers macOS, Linux and WSL 2.
- Project instructions: Codex reads AGENTS.md. Claude Code reads CLAUDE.md and can read a repository's AGENTS.md in its place, so one file can serve both.
- Extensions: both support MCP servers, skills, subagents, hooks and plugins. Claude Code adds plugin marketplaces and mods that change its own interface; Codex adds an Ultra mode that spreads work across subagents.
- Automation: Claude Code runs one-off jobs with claude -p; Codex has codex exec and a GitHub Action, openai/codex-action.
- Surfaces: Claude Code runs in the terminal, VS Code and Cursor, JetBrains IDEs, the Claude desktop app, the web and Slack. Codex runs in the CLI, an IDE extension for VS Code, Cursor and Windsurf, a desktop app and Codex cloud.
- Cloud and review: Codex cloud requires signing in with ChatGPT, and API-key users lose cloud features such as GitHub code review. Claude Code has cloud sessions on the web, and Code Review for GitHub pull requests on Team and Enterprise plans.

## Is Claude Code or Codex easier to install?

They are about equally easy: each installs with one command and signs in through the browser on first run, where you pick your Claude or ChatGPT account (or another sign-in method).

```
# Claude Code, macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

# Codex CLI, macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
```

On Windows, Claude Code uses irm https://claude.ai/install.ps1 | iex, and Codex runs powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" from a new PowerShell window. Claude Code offers more managed options for fleets, with WinGet and signed Linux repositories. Codex ships prebuilt binaries on GitHub Releases. Our install guide has the full Claude Code steps and error fixes.

## Can you use Claude Code and Codex together?

Yes. Keep project rules in AGENTS.md so both agents read the same instructions, and give each its own login: Claude Code uses your Claude account or an Anthropic key, and Codex your ChatGPT account or an OpenAI key. Several tools we have covered, such as Agent Autoloop, Floorplan and tstack, are built to work with both.

## Frequently asked questions

- Is Codex CLI free? The CLI itself is open source, but using it needs ChatGPT Plus or higher, or an OpenAI API key billed per token. OpenAI lists Free and Go with Codex only in the desktop app, subject to rollout.
- Is Claude Code open source? No. The anthropics/claude-code repository is public, with the README, changelog and issue tracker, but its license file says all rights reserved and use falls under Anthropic's Commercial Terms.
- Which is cheaper? At $20 a month the entry plans cost the same. On the API, Fable 5.2 and GPT-6.2 Astra list at the same $8 and $40 per million tokens, and Sonnet 5.5 and GPT-6.2 Sol at the same $2 and $10, for prompts up to OpenAI's 272K threshold.
- Which one is better at coding? It depends on the task and the harness. We have covered independent results in our GPT-6.2 vs Fable 5.2 benchmarks piece and the FrontierHarness eval, rather than repeat vendor claims here.
- Which works better on Windows? Both run natively. Codex sandboxes commands on native Windows; Claude Code needs WSL 2 for its sandbox.
- Can both read the same instructions file? Yes. Codex uses AGENTS.md, and Claude Code can read AGENTS.md in place of CLAUDE.md.

## Related on claudefox

- [Claude Code vs Cursor (2026): pricing, models, which to use](https://claudefox.com/claude-code-vs-cursor/)
- [Claude Code vs GitHub Copilot (2026): pricing, Claude models, which to use](https://claudefox.com/claude-code-vs-github-copilot/)
- [GPT-6.2 Astra vs Claude Fable 5.2: independent benchmarks](https://claudefox.com/gpt-6-2-benchmarks-vs-claude-fable-5-2/)
- [FrontierHarness Eval v1.1: best harness for each model](https://claudefox.com/frontierharness-eval-v1-1-best-harness-per-model/)
- [Claude Code pricing (November 2026): plans and API costs](https://claudefox.com/claude-code-pricing/)
- [Agent Autoloop: run Claude Code and Codex in the background](https://claudefox.com/agent-autoloop/)

Source: [Codex pricing (ChatGPT docs)](https://learn.chatgpt.com/docs/pricing?ref=claudefox.com), [Codex CLI (ChatGPT docs)](https://learn.chatgpt.com/docs/codex/cli?ref=claudefox.com), [Codex models (ChatGPT docs)](https://learn.chatgpt.com/docs/models?ref=claudefox.com), [Codex authentication (ChatGPT docs)](https://learn.chatgpt.com/docs/auth?ref=claudefox.com), [Agent approvals and security (ChatGPT docs)](https://learn.chatgpt.com/docs/agent-approvals-security?ref=claudefox.com), [Sandboxing (ChatGPT docs)](https://learn.chatgpt.com/docs/sandboxing?ref=claudefox.com), [Codex open-source components (ChatGPT docs)](https://learn.chatgpt.com/docs/open-source?ref=claudefox.com), [openai/codex on GitHub](https://github.com/openai/codex?ref=claudefox.com), [OpenAI API pricing](https://developers.openai.com/api/docs/pricing?ref=claudefox.com), [Claude plans and pricing (claude.com)](https://claude.com/pricing?ref=claudefox.com), [Claude API pricing (Claude Platform docs)](https://platform.claude.com/docs/en/about-claude/pricing?ref=claudefox.com), [How do usage and length limits work? (Claude Help Center)](https://support.claude.com/en/articles/11647753-how-do-usage-and-length-limits-work?ref=claudefox.com), [What is the Ultra plan? (Claude Help Center)](https://support.claude.com/en/articles/17728952-what-is-the-ultra-plan?ref=claudefox.com), [Advanced setup (Claude Code docs)](https://code.claude.com/docs/en/setup?ref=claudefox.com), [Model configuration (Claude Code docs)](https://code.claude.com/docs/en/model-config?ref=claudefox.com), [Configure the sandboxed Bash tool (Claude Code docs)](https://code.claude.com/docs/en/sandboxing?ref=claudefox.com), [Permission modes (Claude Code docs)](https://code.claude.com/docs/en/permission-modes?ref=claudefox.com), [Claude Code README (GitHub)](https://github.com/anthropics/claude-code?ref=claudefox.com), [CLAUDE.md and AGENTS.md (Claude Code docs)](https://code.claude.com/docs/en/memory?ref=claudefox.com), [Claude Code changelog (GitHub)](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md?ref=claudefox.com), [Claude Code license (GitHub)](https://github.com/anthropics/claude-code/blob/main/LICENSE.md?ref=claudefox.com), [Codex CLI 0.171.0 release (GitHub)](https://github.com/openai/codex/releases/tag/rust-v0.171.0?ref=claudefox.com), [Custom instructions with AGENTS.md (ChatGPT docs)](https://learn.chatgpt.com/docs/agent-configuration/agents-md?ref=claudefox.com), [Codex hooks (ChatGPT docs)](https://learn.chatgpt.com/docs/hooks?ref=claudefox.com), [Codex GitHub Action (ChatGPT docs)](https://learn.chatgpt.com/docs/github-action?ref=claudefox.com), [Claude Code overview (Claude Code docs)](https://code.claude.com/docs/en/overview?ref=claudefox.com), [Plugins (Claude Code docs)](https://code.claude.com/docs/en/plugins?ref=claudefox.com), [Mods overview (Claude Code docs)](https://code.claude.com/docs/en/plugins/mods/overview?ref=claudefox.com), [Code Review (Claude Code docs)](https://code.claude.com/docs/en/code-review?ref=claudefox.com), [Claude Code in Slack (Claude Code docs)](https://code.claude.com/docs/en/slack?ref=claudefox.com), [Error reference (Claude Code docs)](https://code.claude.com/docs/en/errors?ref=claudefox.com)