Claude Code vs Codex comes down to the account you already pay for. Claude Code needs a paid Claude plan (Pro at $20 billed monthly, up to Ultra at $200) or a Console account; Codex is included in every ChatGPT plan, Free included. Both have a terminal CLI, IDE extensions, a desktop app and cloud agents, and both support MCP, skills and hooks. The differences are entry price, usage limits, sandbox defaults and the instruction file.

Applies to: Claude Code 2.1.329 (changelog entry of November 19, 2026) and Codex CLI 0.171.0 (docs and changelogs as of November 20, 2026). Last checked: November 20, 2026.

On this page

At a glance

Item Claude Code OpenAI Codex
Vendor Anthropic OpenAI
Surfaces Terminal CLI, VS Code and Cursor extension, JetBrains plugin, desktop app, web and mobile (overview) Codex app (macOS, Windows), CLI (macOS, Windows, Linux), IDE extension for VS Code, Cursor and Windsurf, cloud (quickstart)
Cheapest plan with access Claude Pro, $20/month billed monthly; Free has no Claude Code (pricing) ChatGPT Free, $0/month (pricing)
Plan ladder Pro, Max, Ultra, Team, Enterprise; Ultra has no 5-hour limit for verified accounts (pricing) Free, Go, Plus, Pro, Business, Enterprise and Edu; Pro plans currently have no five-hour limit (pricing)
Project instructions file CLAUDE.md; also reads AGENTS.md when no CLAUDE.md exists (memory) AGENTS.md (AGENTS.md docs)
Main config file settings.json (~/.claude/, .claude/) config.toml (~/.codex/, .codex/)
Permission model Six permission modes plus allow/ask/deny rules (permission modes) Sandbox mode plus approval policy (approvals and security)
MCP claude mcp add, stdio, HTTP, SSE (MCP) codex mcp add, stdio and streamable HTTP (MCP)
Skills SKILL.md, Agent Skills standard (skills) SKILL.md, Agent Skills standard (skills)
Hooks Yes, in settings files (hooks) Yes, in hooks.json or config.toml (hooks)
GitHub @claude via GitHub Action, Code Review, PR auto-fix (GitHub Actions) @codex review and @codex task comments (GitHub)
CLI source Releases and changelog in anthropics/claude-code Open source, Apache-2.0, openai/codex

Install

Install Claude Code

The native installer is the recommended method on macOS, Linux and WSL (advanced setup):

curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell:

irm https://claude.ai/install.ps1 | iex

Windows CMD has its own command:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Homebrew and WinGet are also documented:

brew install --cask claude-code
winget install Anthropic.ClaudeCode

The claude-code Homebrew cask tracks the stable release channel, which the docs say is typically about a week behind and skips releases with major regressions; the claude-code@latest cask tracks the latest channel. The setup page also documents apt, dnf and apk installs for Debian, Fedora, RHEL and Alpine. Native installs update themselves in the background; Homebrew and WinGet installs do not (brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode). The docs list macOS 13.0+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+ and Alpine Linux 3.19+, with 4 GB+ RAM. Start it in a project with claude, and check the install with claude --version or claude doctor.

Install Codex

The Codex quickstart gives a standalone installer for macOS and Linux:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Or npm and Homebrew:

npm install -g @openai/codex
brew install --cask codex

The standalone installers download from https://releases.openai.com/codex by default and fall back to GitHub Releases; the openai/codex README documents CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false to force GitHub Releases. Run codex and sign in with a ChatGPT account or an OpenAI API key. The Codex app downloads are for macOS (Apple Silicon and Intel) and Windows.

Models

Item Claude Code Codex
Model aliases or IDs default, best, fable, opus, sonnet, haiku, sonnet[1m], opus[1m], opusplan (model config) gpt-6.2-astra, gpt-6.2-sol, gpt-6-astra, gpt-6.1-sol, gpt-6.1-terra, gpt-6-luna (models)
What the main names resolve to On the Anthropic API, opus is Opus 5.5, sonnet is Sonnet 5.5 and haiku is Haiku 5.5; fable is Fable 5.2 unless ANTHROPIC_DEFAULT_FABLE_MODEL is set GPT-6.2 Astra for demanding work; GPT-6.2 Sol for everyday coding at fewer credits per token than Astra; GPT-6.1 Terra as a fast, efficient model; GPT-6 Luna for focused, repeatable tasks
Switch in a session /model <alias|name> /model
Switch at launch claude --model <alias|name> codex -m <model>, for example codex -m gpt-6.2-sol
Persistent default model in a settings file model = "..." in config.toml
Third-party providers Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry (setup); on those providers the aliases can resolve to older models (Bedrock and Agent Platform: sonnet is Sonnet 4.5, haiku is Haiku 4.5) A custom model provider or gateway with a compatible Responses API endpoint; Chat Completions-only endpoints are not supported in current releases (models)

The Codex models page says GPT-6.2 Astra and GPT-6.2 Sol each support a context window of up to 1 million tokens; the default in Codex is 272,000 tokens for Astra and 500,000 for Sol, and a longer window is set with model_context_window in config.toml. Which models you see depends on plan and client: the pricing page lists GPT-6 Luna on Free and Go, and GPT-6.1 Sol and GPT-6 Luna on Plus.

Retired names matter for scripts. GPT-5.5 retired from Codex for ChatGPT sign-in on October 14, 2026 (API-key sessions are not affected), gpt-5.3-codex-spark retired on September 14, 2026, and gpt-5.4 and gpt-5.4-mini retired on August 31, 2026. Replace pinned names with a model available to your account (models).

Plans, prices and usage windows

Per-token API prices are on each vendor’s own page: Claude API pricing and OpenAI API pricing. The tables below cover subscription plans only.

Claude Code plans and usage windows

Plan Price Claude Code and usage
Free $0 Not included
Pro $17/month with annual billing ($200 up front); $20 billed monthly Included; more usage than Free every 5 hours and every week
Max $100/month Included; 5x Pro usage every 5 hours and every week; $100 a month in API credits
Ultra $200/month Included; no 5-hour limit for verified accounts, 10x Pro usage every week; $200 a month in API credits
Team Standard seat $20/seat/month annual; $25 monthly Listed as all Claude features with more usage than Pro
Team Premium seat $100/seat/month annual; $125 monthly 5x the usage of a standard seat; Claude Code listed
Enterprise US$20/seat/month plus usage at API rates, billed annually, 20 seat minimum Included

Source: claude.com/pricing, checked November 20, 2026. The $200 tier is named Ultra on the pricing page. Pro, Max and Team usage runs on a rolling five-hour limit with a weekly limit on top; Anthropic says how fast you reach a limit depends on the model, how long your chats are and how large your files are. When you hit a limit you can wait for the reset, upgrade, or use usage credits. Claude Code can also be billed per token through a Console account (costs). For the full per-plan breakdown, see how much Claude Code costs.

Codex plans and usage windows

Plan Price
Free $0/month
Go $8/month
Plus $20/month
Pro From $100/month (plans at $100, $200 or $500; Ultrafast mode access on the $500 plan)
Business $20/user/month billed annually; $25 monthly
Enterprise & Edu Contact sales

Source: learn.chatgpt.com/docs/pricing, checked November 20, 2026. Codex and ChatGPT Work share pricing, credits and usage limits. The page lists estimated local messages per five-hour period on Plus and Standard Business, and says Pro plans currently have no five-hour limit:

Model Local messages per 5 hours (Plus, Standard Business)
GPT-6.2 Astra 6–50
GPT-6.2 Sol 17–180
GPT-6 Astra 5–45
GPT-6.1 Sol 15–160
GPT-6.1 Terra 35–285
GPT-6 Sol 15–150
GPT-6 Luna 350–3,000

OpenAI notes these are not fixed message limits and that cloud tasks may use more of your allowance than local messages; check your usage dashboard for current limits and reset times. See Codex usage for the limit windows and credits.

“Local messages and cloud chats share your plan’s usage allowance. Weekly limits may also apply.” Codex also works with an API key, billed at API rates.

Project instructions: CLAUDE.md vs AGENTS.md

Claude Code reads CLAUDE.md from four scopes (memory docs):

Scope Location
Managed policy /Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux, WSL), C:\Program Files\ClaudeCode\CLAUDE.md (Windows)
User ~/.claude/CLAUDE.md
Project ./CLAUDE.md or ./.claude/CLAUDE.md
Local ./CLAUDE.local.md

/init generates a starting CLAUDE.md. Since v2.1.277, Claude Code reads AGENTS.md directly when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. The Project instructions setting in /config can be set to claude-md-and-agents-md to load both. It does not read AGENTS.override.md.

Codex reads AGENTS.md (AGENTS.md docs):

  • Global: ~/.codex/AGENTS.override.md if present, otherwise ~/.codex/AGENTS.md (or the CODEX_HOME directory).
  • Project: from the Git root down to the current directory, checking AGENTS.override.md, then AGENTS.md, then any fallback names. Files are concatenated root-down, so closer files win.
  • Default size cap: 32 KiB (project_doc_max_bytes).
project_doc_fallback_filenames = ["TEAM_GUIDE.md", ".agents.md"]
project_doc_max_bytes = 65536

A repository that keeps a single AGENTS.md and no CLAUDE.md is read by both tools under their defaults.

Permission and sandbox modes

Claude Code: permission modes

Mode Runs without asking
default Reads only
acceptEdits Reads, file edits, common filesystem commands
plan Reads only
auto Everything, with background safety checks
dontAsk Only pre-approved tools
bypassPermissions Everything

Source: Choose a permission mode. Shift+Tab cycles default, acceptEdits and plan. Separately, the Bash sandbox (off by default, turned on with /sandbox or sandbox.enabled) limits which files and network hosts shell commands can reach; it uses Seatbelt on macOS and bubblewrap on Linux and WSL2, and is not available on native Windows (sandboxing).

Warning

Anthropic says to use bypassPermissions (enabled by --dangerously-skip-permissions) “only in isolated environments like containers, VMs, or dev containers without internet access”, and that it “offers no protection against prompt injection or unintended actions.” For fewer prompts with safety checks, the docs point to auto mode (permission modes).

Codex: sandbox and approval modes

Codex combines a sandbox mode with an approval policy (agent approvals and security):

Sandbox mode What Codex can do
read-only Read files and run commands in a read-only sandbox
workspace-write Read, edit and run commands in the workspace (default)
danger-full-access No sandbox, no approvals

The default for version-controlled folders is --sandbox workspace-write --ask-for-approval on-request, with network access off. With interactive approvals such as on-request, approval requests go to you by default (approvals_reviewer = "user"). Setting approvals_reviewer = "auto_review" routes eligible requests through a reviewer agent before Codex runs the action; it evaluates only actions that already need approval, such as sandbox escalations or network requests (agent approvals and security):

approval_policy = "on-request"
approvals_reviewer = "auto_review"

Network access in workspace-write is turned on in config.toml:

[sandbox_workspace_write]
network_access = true

The sandbox uses Seatbelt (sandbox-exec) on macOS, bwrap plus seccomp on Linux, and a WSL2 or native Windows sandbox on Windows.

Warning

OpenAI labels --dangerously-bypass-approvals-and-sandbox (alias --yolo) as elevated risk: “No sandbox; no approvals (not recommended)” (agent approvals and security).

MCP

Claude Code (MCP docs):

claude mcp add --transport http notion https://mcp.notion.com/mcp

Servers can be local-scoped (default, stored in ~/.claude.json), project-scoped (.mcp.json, checked into the repo, approved on first use) or user-scoped. Transports: stdio, HTTP, SSE (deprecated) and WebSocket.

Codex (MCP docs):

codex mcp add context7 -- npx -y @upstash/context7-mcp
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

Config lives in ~/.codex/config.toml or a trusted project’s .codex/config.toml; OAuth servers sign in with codex mcp login <server-name>. Both tools can run the same servers from the MCP directory, for example Context7.

Skills and hooks

Both tools use SKILL.md folders built on the Agent Skills open standard.

Item Claude Code Codex
Skill locations ~/.claude/skills/<name>/SKILL.md, .claude/skills/<name>/SKILL.md, plugins (skills) .agents/skills (repo), $HOME/.agents/skills, /etc/codex/skills, built-in (skills)
Invoke /skill-name or automatic /skills, $skill-name, or automatic
Hook config hooks block in settings files hooks.json or [hooks] in config.toml, user or repo level
Hook handler types command, http, mcp_tool, prompt, agent (hooks guide) Command hooks and MCP tool hooks (hooks)
Sample events PreToolUse, SessionStart, CwdChanged, UserPromptSubmit PreToolUse, PermissionRequest, PostToolUse, SessionStart, Stop

See the skills directory for collections that document support for each tool.

Cloud agents and GitHub

Claude Code cloud sessions run in isolated Anthropic-managed VMs and are available on Pro, Max, Ultra and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats (cloud docs). Start one from claude.ai/code, the mobile app, the desktop app, or the terminal:

claude --cloud "Fix the authentication bug in src/auth/login.ts"

claude --teleport pulls a cloud session into the terminal; the older --remote spelling still works as a deprecated alias for --cloud. Cloud sessions share rate limits with other Claude usage. On GitHub, /install-github-app sets up the Claude Code GitHub Action so @claude mentions in issues and PRs run Claude (GitHub Actions); auto-fix can watch a PR for CI failures and review comments.

Codex cloud runs tasks from ChatGPT on the web or the desktop app against environments connected to GitHub repositories, and can commit or open a pull request when done (Codex cloud). On GitHub, @codex review in a PR comment requests a review, automatic review can be turned on in Codex settings, and @codex followed by any other request starts a task with the PR context (GitHub). The pricing page lists cloud features such as GitHub code review as unavailable with API-key sign-in.

Which to pick

  • If you want the lowest entry price, the pricing pages show Codex from $0 (Free) or $8 (Go) against Claude Pro at $20 billed monthly, and Free on Claude does not include Claude Code.
  • If you need a free tier, the docs show Codex is included in ChatGPT Free, while Claude’s Free plan does not include Claude Code.
  • If you need no five-hour limit, Anthropic lists none for verified Ultra accounts at $200/month, and OpenAI says Codex Pro plans currently have no five-hour limit (Claude pricing, Codex pricing).
  • If you need an open-source CLI you can audit or fork, the docs show the Codex CLI repository is Apache-2.0.
  • If you need JetBrains IDE support, the docs show a Claude Code plugin for JetBrains IDEs; the Codex quickstart lists VS Code, Cursor and Windsurf.
  • If you need Linux for the desktop app, Claude documents a Linux beta of its desktop app; the Codex app downloads are for macOS and Windows.
  • If you need one instruction file for both tools, the docs show both read AGENTS.md; Claude Code does so when no CLAUDE.md exists, or always with claude-md-and-agents-md.
  • If you need the shell sandbox on native Windows, the docs show Codex has a native Windows sandbox; Claude Code’s sandbox needs WSL2.
  • If you need hooks that call an HTTP endpoint or a model, the docs show Claude Code hook types http, prompt and agent; Codex runs command and MCP tool handlers and skips prompt and agent handlers.
  • If you need to route through your own cloud provider, the docs show Claude Code on Bedrock, Google Cloud and Microsoft Foundry, and Codex with a custom provider or gateway that exposes a compatible Responses API endpoint.

For per-plan usage details, see the plans tracker. The permission flags have their own pages: claude --dangerously-skip-permissions and Codex: dangerously skip permissions. For the instruction files, see CLAUDE.md vs AGENTS.md.