Skip to content

Codex vs Claude Code: surfaces, models, permissions and extensibility side by side

On this page

Codex and Claude Code are both agentic coding tools that read a repository, edit files and run commands, from a terminal, an IDE, a desktop app or a cloud sandbox. The biggest practical differences are the models (OpenAI’s GPT models in Codex, Anthropic’s Claude models in Claude Code), how each is bought (Codex comes with ChatGPT plans, Claude Code with Claude’s paid plans), and the safety defaults: Codex runs shell commands in an OS sandbox with network off by default, while Claude Code relies on permission prompts and modes, with its Bash sandbox off until you turn it on. Both support MCP, hooks, subagents and an instruction file.

Checked as of 1 November 2026 against OpenAI’s Codex documentation and Anthropic’s Claude Code documentation; plan details come from each vendor’s pricing page as published at the start of November.

Codex vs Claude Code at a glance

CodexClaude Code
TerminalCodex CLI (codex)Claude Code CLI (claude)
IDEIDE extensionVS Code extension, JetBrains plugin
DesktopDesktop app for macOS and WindowsCode tab in the Claude desktop app
CloudCodex Cloud tasks from web, desktop, mobile or codex cloudCloud sessions at claude.ai/code, desktop and mobile
ModelsOpenAI GPT modelsClaude models (Opus, Sonnet, Haiku, Fable)
Bought throughChatGPT plans, or an API keyClaude Pro, Max, Ultra, Team, Enterprise, or API usage
Default safetyOS sandbox, workspace writes only, no networkPermission prompts by mode; Bash sandbox opt-in
Instruction fileAGENTS.mdCLAUDE.md, or AGENTS.md when no CLAUDE.md exists
MCP config~/.codex/config.tomlclaude mcp add, ~/.claude.json, .mcp.json
Hookshooks.json or [hooks] in config.tomlhooks in settings.json

Surfaces: CLI, IDE, desktop and cloud

Both tools treat the CLI as the full-featured surface. Codex’s CLI covers interactive sessions, codex exec for scripts and CI, local code review and codex cloud to hand work to the cloud. Claude Code’s platforms page says scripting and the Agent SDK are CLI-only.

The local surfaces share configuration on each side. OpenAI says the desktop app, CLI and IDE extension read the same config.toml, and Anthropic says configuration, project memory and MCP servers are shared across Claude Code’s local surfaces.

Cloud work differs in shape. Codex Cloud runs each task in its own cloud workspace and lets you review the changes before committing or opening a pull request. Claude Code’s cloud sessions run on Anthropic-managed infrastructure by default and continue after you disconnect; Team and Enterprise plans can also point them at self-hosted runners.

Models

Codex runs OpenAI models. OpenAI’s Codex pricing page at the start of November listed GPT-6.1 Sol, GPT-6 Astra, GPT-6 Sol, GPT-6 Luna, GPT-5.6 Sol, GPT-5.6 Luna and GPT-5.5, each drawing on the plan allowance at a different rate. You switch models in a session with /model, and custom agents can set their own model and reasoning effort.

Claude Code runs Claude models, selected with /model or --model and aliases such as opus, sonnet, haiku and fable. opusplan uses Opus while planning and Sonnet while executing. Claude Code can also run through Amazon Bedrock, Google Cloud, Microsoft Foundry or an LLM gateway, where the aliases may resolve to older model versions.

Neither tool runs the other’s models. If model choice decides it for you, the decision is already made.

Plans and pricing

Only what the official pages said at the start of November 2026:

  • Codex: the Codex pricing page says Codex is included in ChatGPT Free, Go, Plus, Pro, Business and Enterprise. Free and Go get limited Codex access, Plus gets expanded usage, and Pro (offered at $100 and $200) gets the most. Local messages and cloud chats share one allowance, weekly limits may apply, credits extend usage beyond the plan, and API-key usage is billed separately by usage. See ChatGPT pricing for plan prices.
  • Claude Code: Claude’s pricing page includes Claude Code in Pro ($20 a month, or $17 a month billed annually), Max ($100 a month, five times Pro usage) and Ultra ($200 a month, no five-hour limit for verified accounts). The Free plan doesn’t include it. Team seats cost $25 a month standard or $125 premium when billed monthly ($20 and $100 annually), and Enterprise is $20 per seat a month billed annually plus usage at API rates, with a 20-seat minimum. Claude Code can also bill straight to an API account.

Both pages describe usage limits, not unlimited use, so the plan that fits depends on how many hours a day the agent runs more than on the sticker price.

Permission and sandbox models

This is where the two differ most in daily use.

Codex combines a sandbox mode with an approval policy (OpenAI’s approvals and security page). The sandbox is enforced by the operating system: read-only, workspace-write or danger-full-access. The approval policy decides when Codex stops to ask: on-request for interactive work, never for unattended runs. The default Auto preset is workspace-write with on-request: Codex edits and runs commands in the working directory without asking, and asks before writing outside it or using the network.

Shell
codex --sandbox read-only --ask-for-approval on-request

Claude Code starts from permission rules and modes instead. Modes such as default, acceptEdits, plan, auto, dontAsk and bypassPermissions set the baseline, and allow, ask and deny rules in settings.json decide individual tools and commands. The OS-level Bash sandbox is off by default; /sandbox or sandbox.enabled turns it on, after which shell commands can only write to the working directory and reach allowed domains. The sandbox covers shell commands only. File tools, MCP servers and hooks run outside it.

In short, Codex’s boundary is on by default and you loosen it, while Claude Code asks first and you add rules and a sandbox to reduce prompts. The Claude Code permissions guide covers modes and rules in detail.

MCP support in each

Both connect to local stdio servers and remote streamable HTTP servers with OAuth sign-in, and both let you restrict MCP tools. Codex keeps servers in [mcp_servers.<name>] tables in config.toml, with enabled_tools, disabled_tools and per-tool approval modes. Claude Code adds them with claude mcp add at local, project or user scope, and controls tools with the same permission rules as everything else, named mcp__<server>__<tool>.

Setup steps are in the Codex client guide and the Claude Code client guide.

AGENTS.md vs CLAUDE.md

Codex reads AGENTS.md: a global file in ~/.codex, then one per directory from the project root down to the working directory, concatenated up to 32 KiB by default, with AGENTS.override.md taking a directory’s place when present. Claude Code reads CLAUDE.md, and reads AGENTS.md when the repository has no CLAUDE.md. A repository that both tools work in can keep one AGENTS.md and import it from CLAUDE.md. CLAUDE.md vs AGENTS.md covers the loading rules and the symlink and import options.

Hooks and subagents

Both have lifecycle hooks with similar names. Codex’s hooks cover SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, compaction, subagent start and stop, and Stop, defined in hooks.json or inline in config.toml. One design choice stands out: Codex makes you review and trust each non-managed hook, records trust against the hook’s hash, and skips a hook that changes until you trust it again in /hooks. Claude Code holds back settings-file hooks until you trust the workspace, then runs them, and supports more handler types (command, HTTP, MCP tool, prompt and agent). Claude Code hooks walks through events, exit codes and examples.

Subagents work similarly in both: the main agent delegates a focused job to another agent with its own context and gets a summary back. Codex can spawn subagents in parallel and collect their results in the main thread, and local clients can define custom agents with their own model and instructions. Claude Code defines subagents as Markdown files with frontmatter in .claude/agents/ or ~/.claude/agents/. Claude Code subagents covers that format.

Claude Code vs Codex for different kinds of work

There’s no overall winner; these are the criteria that usually decide it.

  • You already pay for one ecosystem: Codex comes with ChatGPT plans, Claude Code with Claude’s paid plans. For a team standardized on one, that settles most cases.
  • You want a restrictive default: Codex’s sandbox with network off is on from the first run. Claude Code can match it, but you configure the sandbox yourself.
  • You run unattended jobs: both have non-interactive modes (codex exec, claude -p). Codex pairs never approvals with the sandbox; Claude Code pairs dontAsk with explicit allow rules.
  • You need fine-grained policy hooks: Claude Code has more hook events and handler types. Codex’s hash-based trust is stricter about hooks a repository brings in.
  • You work across several providers: Claude Code can run on Bedrock, Google Cloud or Foundry. Codex accepts other model providers through model_providers in config.toml.
  • You hand off cloud tasks: both do it. Try each on the same small task in your own repository and compare the diffs.

Teams that use both often keep remote MCP access in one place so the two tools don’t drift. Toolstile, for example, gives Codex and Claude Code each their own agent with Allow, Require approval or Block per tool on shared remote MCP servers, and logs every call either one makes.