Claude Code vs Codex comes down to the account you already pay for and the surfaces you work in: Claude Code runs on a Claude Pro, Max, Team, Enterprise or Console account, while Codex is included in every ChatGPT plan, Free included. Both ship a terminal CLI, IDE extensions, a desktop app and cloud agents, and both support MCP, skills and hooks.
Applies to: Claude Code 2.1.285 and Codex CLI 0.160.0 (docs as of October 2, 2026). Last checked: October 2, 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) |
| 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
Homebrew and WinGet are also documented:
brew install --cask claude-code
winget install Anthropic.ClaudeCode
Native installs update themselves in the background; Homebrew and WinGet installs do not. 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
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-astra, gpt-6.1-sol, gpt-6-luna (models) |
| What the main aliases resolve to | On the Anthropic API, opus is Opus 5.5 and sonnet is Sonnet 5.5 | GPT-6 Astra is described as the most capable; GPT-6.1 Sol as near-Astra at lower cost; GPT-6 Luna as the most efficient |
| Switch in a session | /model <alias|name> | /model |
| Switch at launch | claude --model <alias|name> | codex -m <model> |
| Persistent default | model in a settings file | model = "..." in config.toml |
| Third-party providers | Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry (setup) | 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 lists GPT-5.5 as retiring from ChatGPT and Codex on October 14, 2026, and GPT-5.4 and GPT-5.4-mini as retired on August 31, 2026. Scripts that pin those names need updating.
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 |
|---|---|---|
| Free | $0 | Not included |
| Pro | $17/month with annual billing ($200 up front); $20 billed monthly | Included |
| Max 5x | $100/month | Included |
| Max 20x | $200/month | Included |
| Team Standard seat | $20/seat/month annual; $25 monthly | Included |
| Team Premium seat | $100/seat/month annual; $125 monthly | Included |
| Enterprise | US$20/seat/month plus usage at API rates, billed annually | Included |
Source: claude.com/pricing. Usage runs on a rolling five-hour session window, with weekly limits on top for paid plans; when you hit a limit you can wait for the reset, upgrade, or turn on usage credits. Claude Code can also be billed per token through a Console account (costs).
Codex plans and usage windows
| Plan | Price |
|---|---|
| Free | $0/month |
| Go | $8/month |
| Plus | $20/month |
| Pro | From $100/month ($100, $200 or $500 options) |
| Business | $20/user/month billed annually; $25 monthly |
| Enterprise & Edu | Contact sales |
Source: learn.chatgpt.com/docs/pricing. The page lists local messages per five-hour period on Plus and Standard Business:
| Model | Local messages per 5 hours (Plus, Standard Business) |
|---|---|
| GPT-6 Astra | 5–45 |
| GPT-6.1 Sol | 15–160 |
| GPT-6 Luna | 350–3,000 |
“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.mdif present, otherwise~/.codex/AGENTS.md(or theCODEX_HOMEdirectory). - Project: from the Git root down to the current directory, checking
AGENTS.override.md, thenAGENTS.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. Approval policies include on-request, never and 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 and Team, and for Enterprise premium 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. 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 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 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 noCLAUDE.mdexists, or always withclaude-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,promptandagent; 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.





