CI verdicts and evidence-backed review for agent-written changes.

Comparison

Codex vs Claude Code: how the two coding agents differ

Both agents now run in the terminal, the IDE, the cloud and CI. The differences that matter to a team are the defaults: what a command can touch, which instruction file is read, and how each one plugs into review.

Checked against OpenAI's and Anthropic's own documentation on .

The short answer

  • Pick Codex if you want an OS sandbox on by default (network off, writes limited to the workspace), an open-source CLI (Apache-2.0), or you already pay for ChatGPT: Codex comes with every ChatGPT plan, Free and Go included in the desktop app.
  • Pick Claude Code if you want more hook types (HTTP, prompt and agent hooks beside shell commands), a choice of cloud providers (Amazon Bedrock, Google Cloud, Microsoft Foundry), or you already pay for a Claude plan.
  • Running both on one repo works: Codex reads AGENTS.md, Claude Code reads it when there is no CLAUDE.md, and each has an /import command that copies setup from the other.
  • Neither one checks its own output for you. Whichever writes the code, the pull request still needs CI and review before it merges.

Codex vs Claude Code at a glance

Codex (OpenAI)Claude Code (Anthropic)
Where it runsCLI (macOS, Linux, Windows), IDE extension (VS Code, Cursor, Windsurf), ChatGPT desktop app, Codex cloud, ChatGPT mobile appCLI (macOS, Linux, Windows), VS Code, JetBrains, desktop app, web (claude.ai/code), iOS and Android
ModelsOpenAI GPT models; the docs' config example uses gpt-6.1-solClaude models; Opus 5.5 is the default on paid plans and the API
Local sandboxOn by default: workspace-write, network offOff by default; /sandbox turns it on, for shell commands only
Approvalson-request or never; in the app: Ask for approval, Approve for me, Full accessSix permission modes; auto is the starting mode in the terminal and VS Code
Instruction fileAGENTS.md (plus AGENTS.override.md)CLAUDE.md; AGENTS.md when there is no CLAUDE.md
Hook handlerscommand, mcp_toolcommand, http, mcp_tool, prompt, agent (experimental)
Headless / CIcodex exec, openai/codex-action GitHub Actionclaude -p, anthropics/claude-code-action, GitLab CI/CD (beta)
CLI licenseOpen source, Apache-2.0Proprietary ("All rights reserved")
Included inChatGPT Free, Go, Plus, Pro, Business, Edu and EnterpriseClaude Pro, Max, Ultra, Team and Enterprise (not Free)

Both vendors ship changes every few weeks, and several defaults below depend on the version you run. Each row links back to the page it came from in the sections that follow; check those pages before you standardise a team on either tool.

Where each one runs

Codex has a CLI for macOS, Linux and Windows, an IDE extension for VS Code, Cursor and Windsurf (Xcode and JetBrains have their own integrations), and runs locally inside the ChatGPT desktop app. Codex cloud runs tasks in cloud environments started from the web, the desktop app, the ChatGPT mobile app or codex cloud in the terminal.

Claude Code lists the same engine on every surface: the CLI, the desktop app, VS Code, JetBrains, the web and mobile. Cloud sessions run at claude.ai/code and in the Claude mobile and desktop apps, on Pro, Max, Ultra, Team and eligible Enterprise seats.

Sandboxing and permissions

This is the largest practical difference between the two, and it decides how much you have to trust the agent before it runs a command.

Codex: sandboxed unless you open it up

  • Local commands run in an OS sandbox: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows (sandboxing).
  • workspace-write is the default mode for local work, and "the agent runs with network access turned off" by default (approvals and security).
  • Approval policies are on-request and never; the older untrusted policy is no longer supported.
  • In the app you choose Ask for approval, Approve for me or Full access; in the CLI, /permissions (permission modes).

Claude Code: permission modes first, sandbox opt-in

  • Six permission modes: default (Manual), acceptEdits, plan, auto, dontAsk and bypassPermissions. From v2.1.283, auto is the starting mode for interactive terminal and VS Code sessions; claude -p and the Agent SDK start in default.
  • Permission rules are evaluated deny first, then ask, then allow.
  • The OS sandbox (Seatbelt on macOS, bubblewrap on Linux and WSL2) is off by default; /sandbox or sandbox.enabled turns it on. It covers shell commands only: file tools, MCP servers and hooks run outside it.
  • On native Windows, Claude Code runs commands unsandboxed.

If your team wants Claude Code to behave closer to Codex's default, turn on /sandbox and add deny rules for the paths and commands an agent should never touch.

Instruction files: AGENTS.md and CLAUDE.md

Codex reads AGENTS.md: a global file in ~/.codex, then one file per directory from the project root down to where you started. AGENTS.override.md takes priority over AGENTS.md at the same level, and the combined size is capped by project_doc_max_bytes, 32 KiB by default.

Claude Code reads CLAUDE.md at the managed-policy, user (~/.claude/CLAUDE.md), project (./CLAUDE.md or ./.claude/CLAUDE.md) and local (./CLAUDE.local.md) levels, and a file can pull in others with @path imports. From v2.1.277 it also reads AGENTS.md, but by default only when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. The Project instructions setting claude-md-and-agents-md loads both.

For a repo where both agents work, one AGENTS.md at the root is the shared baseline; keep Claude-only instructions in a CLAUDE.md that imports it. Our piece on AGENTS.md and agent context files for large repos covers what to put in it and where it stops scaling.

Hooks, MCP, skills, subagents and plugins

CodexClaude Code
Hookscommand and mcp_tool handlers, in hooks.json or config.toml (docs)command, http, mcp_tool, prompt and agent handlers (docs)
MCP serverscodex mcp add or config.toml (docs)claude mcp add or a project .mcp.json (docs)
SkillsSKILL.md folders under .agents/skillsSKILL.md folders under .claude/skills (docs)
SubagentsBuilt-in default, worker and explorer; custom agents as TOML in .codex/agents/ (docs)Built-ins include Explore and Plan; custom agents as Markdown in .claude/agents/ (docs)
Plugins/plugins, with a .codex-plugin/plugin.json manifest/plugin, with a .claude-plugin/plugin.json manifest (docs)

Both tools fire hooks on the same core events (PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit). The difference is what a hook can be: Codex runs a command or an MCP tool, while Claude Code can also POST to a URL or hand the decision to a model.

Headless runs, CI and pull request review

  • Codex: codex exec runs non-interactively (docs), and the openai/codex-action GitHub Action runs it in a workflow (docs). On GitHub, @codex review or the Automatic review setting reviews pull requests (docs); GitLab review is in preview.
  • Claude Code: claude -p runs headless (docs); Claude Code GitHub Actions (anthropics/claude-code-action, set up with /install-github-app) and GitLab CI/CD (beta) run it in pipelines (docs). Code Review on GitHub pull requests is for Team and Enterprise (docs); locally, /review, /security-review and /ultrareview run from the CLI.

An agent reviewing its own vendor's output is one signal, not a verdict. What a pull request needs before it merges is the same either way: the team's CI passing on the change, and a review that says what changed in behaviour and how each finding is known. See what each CI check can tell you and when autonomous agents need a human gate.

Plans, API keys and licensing

Codex is included in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise; on Free and Go it is in the desktop app only, subject to rollout. An OpenAI API key works for the CLI, and Codex can run OpenAI models through Amazon Bedrock. Limits and prices are on OpenAI's Codex pricing page.

Claude Code is "included in all paid plans": Pro, Max, Ultra, Team and Enterprise, not Free. It also runs with an Anthropic Console API key, on Amazon Bedrock, Google Cloud and Microsoft Foundry (feature availability). Limits and prices are on Anthropic's pricing page.

Usage limits differ by plan and model on both sides and change often, so compare the two pricing pages for the plan you would actually buy rather than relying on a third-party table.

On licensing, the Codex CLI is Apache-2.0; OpenAI lists the IDE extension and Codex cloud as not open source. Claude Code is "All rights reserved" under Anthropic's commercial terms, though its sandbox is built on the open-source @anthropic-ai/sandbox-runtime.

Which to choose, by situation

  • You already pay for ChatGPT: start with Codex; it comes with your plan.
  • You already pay for Claude: start with Claude Code; it comes with every paid plan.
  • You want commands sandboxed by default, or you work on native Windows: Codex. Claude Code's sandbox is opt-in and does not cover native Windows.
  • You need a CLI you can read or fork: Codex, under Apache-2.0.
  • Your company buys models through a cloud provider: Claude Code documents Bedrock, Google Cloud and Microsoft Foundry; Codex documents Bedrock.
  • You want hooks that call a URL or ask a model: Claude Code.
  • Your team uses both: keep one AGENTS.md as the shared baseline and use each tool's /import to copy setup across.

FAQ

Can Codex and Claude Code work on the same repository?

Yes. Codex reads AGENTS.md, and Claude Code reads it too when the repo has no CLAUDE.md (or alongside one with the claude-md-and-agents-md setting). The Codex CLI's /import brings over a Claude Code setup, and Claude Code's /import codex does the reverse.

Is Claude Code open source like the Codex CLI?

No. The Codex CLI is Apache-2.0 at github.com/openai/codex. Claude Code's license reads "All rights reserved" and use falls under Anthropic's commercial terms; only its sandbox runtime is open source.

Which one is safer to run on my machine by default?

Codex starts inside an OS sandbox with network off and writes limited to the workspace. Claude Code starts in auto mode, where a classifier reviews actions, with its OS sandbox off until you run /sandbox. Both can be configured tighter or looser than their defaults.

Can I use either one without a subscription?

Codex is in ChatGPT's Free plan (desktop app, subject to rollout) and works in the CLI with an OpenAI API key. Claude Code is not in Claude's Free plan, but runs with an Anthropic Console API key or through Bedrock, Google Cloud or Microsoft Foundry.

How much do Codex and Claude Code cost?

Both are bundled into their vendor's plans, with usage limits that vary by plan and model. Check OpenAI's Codex pricing and Anthropic's Claude pricing for current terms.

Sources

  1. OpenAI: Codex sandboxing
  2. OpenAI: Codex approvals and security
  3. OpenAI: Codex AGENTS.md
  4. OpenAI: Codex hooks
  5. OpenAI: Codex subagents
  6. OpenAI: Codex non-interactive mode
  7. OpenAI: Codex code review
  8. OpenAI: Codex pricing
  9. OpenAI: Codex open source
  10. Anthropic: Claude Code permission modes
  11. Anthropic: Claude Code sandboxing
  12. Anthropic: Claude Code memory (CLAUDE.md)
  13. Anthropic: Claude Code hooks
  14. Anthropic: Claude Code platforms
  15. Anthropic: Claude Code feature availability
  16. Anthropic: Claude pricing
  17. openai/codex on GitHub
  18. anthropics/claude-code on GitHub

Related reading