Coding agents compared
Codex vs Claude Code: what each is, what it costs and who should pick which
You get a dated, vendor-sourced comparison of OpenAI Codex and Anthropic Claude Code, with a table of when to pick each.
Codex and Claude Code are both coding agents that start in the terminal and also run in an IDE, a desktop app and the web. The facts that usually decide the choice are the plan and models you already pay for, the licence of the command-line tool, and how each tool handles permissions and custom model endpoints. The Codex command-line tool is open source under Apache-2.0. The Claude Code command-line tool is proprietary. Every price, plan name and model name below is as the vendor published it on 2026-10-07, and anything we could not read says so.
Last verified 2026-10-07. Sources are listed at the end of the page.
Who wrote this comparison, and what does Swfte sell?
Swfte sells neither Codex nor Claude Code and does not rank them. We sell a governance layer, Swfte Nexus, that can wrap both. That is a commercial interest, so this page limits itself to what the two vendors publish, with the date we read it, and marks every gap as not verified.
Both products change often: the vendors' own pages list model retirements and changed defaults during 2026. Treat the tables as a snapshot of 2026-10-07 and re-read the vendor pages linked under the sources before you buy.
Codex and Claude Code at a glance
Each cell comes from the vendor's own documentation, pricing page or repository, read on 2026-10-07.
| Topic | OpenAI Codex | Anthropic Claude Code |
|---|---|---|
| Surfaces | CLI, IDE extension (the repository names VS Code, Cursor and Windsurf), desktop app, web (cloud) and mobile. | Terminal, IDE extensions (VS Code and JetBrains), desktop app, web and the Claude mobile app, plus GitHub, Slack and CI integrations. |
| Included in plans | Through ChatGPT plans (Free, Go, Plus, Pro, Business, Enterprise and Edu), or with an API key billed at API rates. What each plan gets differs: see the price table. | The pricing page says Claude Code is included in all paid plans and shares usage limits with chat. It also works with an Anthropic Console account. |
| Models the vendor names | The docs recommend Astra (gpt-6-astra), GPT-6.1 Sol and GPT-6 Luna. | The default is Opus 5.5 on Pro, Max, Team, Enterprise and the Anthropic API. Aliases include Sonnet (5.5 on the Anthropic API), Haiku and Fable (5.1). |
| Project instructions | AGENTS.md, plus a global file in the Codex home folder and an AGENTS.override.md option. | CLAUDE.md. If a repository has an AGENTS.md and no CLAUDE.md, Claude Code reads the AGENTS.md. |
| Licence of the CLI | Apache-2.0, read from the repository page and its LICENSE. | Proprietary. The repository LICENSE.md reads: 'All rights reserved. Use is subject to Anthropic's Commercial Terms of Service.' |
| Other model endpoints | A custom provider is set in config.toml. The docs say to use a compatible Responses API endpoint and that current releases do not support Chat Completions-only endpoints. Built-in ollama and lmstudio providers run local models with the --oss flag. | A gateway must expose the Anthropic Messages, Amazon Bedrock or Google Agent Platform format. Anthropic's gateway page says it does not support routing Claude Code to non-Claude models through any gateway. |
What do Codex and Claude Code cost?
Prices are in US dollars as shown on each vendor's pricing page on 2026-10-07. Usage limits, credits, taxes and regional prices are not stated here: use the vendor pages.
| Tier | Codex (via ChatGPT plans or API) | Claude Code (via Claude plans or API) |
|---|---|---|
| Free | ChatGPT Free, $0 a month: Codex for quick tasks. The page lists GPT-6 Luna at standard speed in the desktop app. | Claude Free, $0 a month. The page says Claude Code is included in all paid plans and does not list it for Free. |
| Entry paid | Go, $8 a month: GPT-6 Luna at standard speed in the desktop app, subject to rollout. | Pro, $17 a month billed annually ($200 up front) or $20 billed monthly. |
| Individual, around $20 | Plus, $20 a month: Codex on the web, in the CLI, in the IDE extension and on iOS, with GPT-6.1 Sol and GPT-6 Luna. | Same Pro plan as above, with Claude Code in the terminal, IDE, desktop app and web. |
| Individual, higher usage | Pro, from $100 a month, in $100, $200 and $500 tiers. The page names Astra Ultrafast access on the $500 tier. | Max, from $100 a month, with a choice of 5x or 20x more usage than Pro. |
| Teams | Business, $20 per user per month billed annually or $25 monthly, minimum two users. | Team Standard seat, $20 a month billed annually or $25 monthly. Team Premium seat, $100 billed annually or $125 monthly. |
| Enterprise | Enterprise and Edu: custom pricing, contact sales. | The pricing page shows $20 per seat per month billed annually plus usage at API rates. Confirm the terms with Anthropic sales. |
| Pay as you go | With an API key, Codex usage is charged at standard API rates. The page lists it as without cloud-based features. | An Anthropic Console account is billed per token. While a gateway credential is active, subscription limits do not apply to those requests. |
Sources: the Codex pricing page and claude.com/pricing, both read on 2026-10-07. Neither page shows a monthly message allowance we could quote, so this page states none.
How do permissions, sandboxing and extensions differ?
Both tools separate what the agent may do from when it must ask. The vocabulary differs, and so do the defaults.
| Area | OpenAI Codex | Anthropic Claude Code |
|---|---|---|
| Default posture | In a version-controlled folder, a workspace-write sandbox with on-request approvals. In a folder without version control, read-only. Local network access is off by default. | Manual mode starts read-only and asks before edits, tests and commands. The security page also names Auto mode, where a classifier model reviews actions instead of you, as the starting mode for interactive terminal and VS Code sessions. Organisations can turn Auto mode off. |
| Modes and rules | Sandbox modes: read-only, workspace-write, danger-full-access. Approval policies: on-request, never, granular. | Permission modes: default, acceptEdits, plan, auto, dontAsk, bypassPermissions, with allow, ask and deny rules. |
| OS sandbox | macOS Seatbelt, bubblewrap on Linux and WSL2, and a Windows option as documented. Cloud tasks run in isolated containers with network access off during the agent phase unless enabled. | An opt-in Bash sandbox on macOS (Seatbelt), Linux and WSL2 (bubblewrap). It covers shell commands only: file tools, MCP servers and hooks run outside it. Native Windows runs commands unsandboxed. |
| Hooks | Hooks are generally available. Events include SessionStart, PreToolUse, PostToolUse, PermissionRequest and Stop. A hook can deny a call with permissionDecision deny or exit code 2. | Hooks run shell commands at lifecycle points, with prompt-based and agent-based variants. The docs say to use a PreToolUse hook to block an action regardless of what the model decides. |
| Subagents | Custom agents are TOML files under the Codex home agents folder, each with a name, description and developer instructions. | Subagents, agent teams and background agents are documented. |
| Plugins and skills | Plugins launched in March 2026 as bundles of skills, connectors and MCP servers, per the Codex release notes. | Skills and plugins are documented, and the public repository includes plugins. |
| MCP | STDIO and streamable HTTP servers set in config.toml, with OAuth. The ChatGPT desktop app, CLI and IDE extension share the configuration. | MCP servers at several scopes, including a project .mcp.json, with managed MCP configuration for organisations. Anthropic says it does not security-audit or manage any MCP server. |
What do the vendors say about your code and data?
Anthropic publishes a detailed data usage page. For Free, Pro and Max accounts you can choose whether your data improves future models. Retention is 5 years if you allow it and 30 days if you do not. For Team, Enterprise and API use, Anthropic says it does not train generative models on code or prompts sent to Claude Code under commercial terms unless the customer opts in. Standard commercial retention is 30 days, and zero data retention is available to qualified Enterprise accounts, enabled per organisation. Claude Code also keeps session transcripts locally in plaintext for 30 days by default.
OpenAI's Codex pages are thinner on this. The pricing page states "No training on your business data by default" for Business. The security and sandbox pages we read describe isolation, approvals and admin controls but give no retention periods and no training terms for individual plans. Those two facts are not verified here: read OpenAI's privacy terms for your plan before you decide.
When should you pick Codex, and when Claude Code?
These are decision rules from the documented differences. They are not a ranking and not a quality claim.
| Your situation | Lean towards | Reason from the vendor pages |
|---|---|---|
| You already pay for ChatGPT Plus, Pro or Business | Codex | Codex is included in those plans, so the first month costs nothing extra. |
| You already pay for Claude Pro, Max or Team | Claude Code | Claude Code is included in all paid Claude plans. |
| You want to read, fork or audit the CLI source under an open licence | Codex | The Codex repository is Apache-2.0. Claude Code is proprietary. |
| You want the agent to use a model you host | Codex | Codex has --oss with Ollama and LM Studio, and custom providers that serve a Responses API. Anthropic does not support non-Claude models behind a gateway. |
| You need Claude models inside your own cloud account | Claude Code | The docs cover Amazon Bedrock, Google Agent Platform and Microsoft Foundry as providers. |
| Your repositories already carry AGENTS.md | Either | Codex reads it natively. Claude Code reads it when no CLAUDE.md exists. |
| You must block specific tool calls deterministically | Either, test first | Both document hooks that can deny a call. Prove the rule on your own repository. |
| You need central admin, audit and SSO features | Not compared here | Both vendors list admin controls. We did not verify them to a depth we can compare, so check each plan. |
Where Swfte fits
Swfte Nexus wraps both tools (Built). It puts a policy gate in front of each action with allow, deny and ask outcomes, writes an audit record, learns from approvals and runs completion gates. That gives you one policy and one audit layer across both agents, so a team that uses Codex and Claude Code does not maintain two rule sets. Read Claude Code security for how hook-level enforcement works, and Nexus for the product. We run our own coding agents through Nexus capture.
Swfte Cortex can also hand coding work to Claude Code or Codex through Nexus (Built). If Nexus is not installed, that delegation falls back to an ungoverned run, so install Nexus first.
Swfte Connect is an OpenAI-compatible model gateway, but it is not a drop-in endpoint for either tool. Codex asks for a Responses API endpoint, and Claude Code asks for the Anthropic Messages, Bedrock or Agent Platform format. We have not verified that Connect serves either, so do not plan around it. For an agent that takes a plain OpenAI-compatible base URL, see OpenCode vs Claude Code.
You do not need Swfte if you work alone, if the vendor permission rules and managed settings already cover your policy, or if you do not need an audit trail beyond what the vendor provides. For Cursor in place of either, see Cursor vs Claude Code.
How do you test both on your own repository?
Write the same five tasks
Pick tasks from your backlog: a bug fix, a test, a refactor, a dependency upgrade and a review. Write them once and give both tools the same text.
Give both the same instructions file
Keep one AGENTS.md. Codex reads it natively, and Claude Code reads it when there is no CLAUDE.md. That removes the instruction file as a variable.
Set the strictest permissions you can live with
Use workspace-write with on-request approvals in Codex and Manual mode in Claude Code. Note every prompt that interrupts you.
Record cost and time per task
Read the usage figure from each vendor's own usage screen. Do not compare a plan limit in one tool with a token price in the other.
Review the diff, then add one rule
Have a human review each change. Then add one hook or deny rule in each tool and confirm it blocks what it should. If either fails, you have found a limit before it matters.
Sources and last verified
Every dated or technical fact on this page was read from the pages below on 2026-10-07. Anything that could not be confirmed is left out or marked as not verified.
- OpenAI Codex repository (README). Surfaces, install methods and the Apache-2.0 licence statement.
- OpenAI Codex LICENSE. Confirmed the Apache License, Version 2.0 text.
- Codex documentation home. Surfaces and documentation map. The developers.openai.com/codex address redirects here.
- Codex pricing. Plan names, prices and Codex inclusion, read 2026-10-07.
- Codex models. Recommended models and the custom provider requirement.
- Codex agent approvals and security. Default sandbox, approvals and network posture.
- Codex sandboxing. Sandbox modes, approval policies and OS mechanisms.
- Codex AGENTS.md. How AGENTS.md is discovered and merged.
- Codex MCP. MCP server types and configuration.
- Codex hooks. Hook events and the deny behaviour.
- Codex subagents. Custom agent definitions.
- Codex advanced configuration. Custom providers and the --oss local providers.
- Codex what is new. Dated release notes for plugins and hooks.
- Claude Code repository. Install methods, plugins and data usage statements.
- Claude Code LICENSE.md. The exact licence wording.
- Claude Code overview. Surfaces, plan requirements, hooks, subagents and AGENTS.md note.
- Claude Code memory (CLAUDE.md). CLAUDE.md and AGENTS.md behaviour.
- Claude Code permissions. Permission modes and rules.
- Claude Code sandboxing. What the Bash sandbox covers.
- Claude Code security. Default posture, MCP statement, cloud isolation.
- Claude Code data usage. Training, retention and telemetry statements.
- Claude Code model configuration. Default models and aliases.
- Claude Code LLM gateways. The statement on non-Claude models and gateways.
- Claude Code gateway compatibility. Supported API formats.
- Claude Code hooks guide. What hooks are and that they can block.
- Claude pricing. Plan names, prices and the Claude Code inclusion sentence.
Frequently asked questions
Is Codex or Claude Code better?
This page does not rank them, and Swfte sells neither. The vendor pages differ on licence, plan inclusion, model choice and permission defaults, so the better fit depends on which plan you already pay for, whether you need an open-source CLI and whether you want to point the agent at your own model. Run the same five tasks on your repository and compare the diffs.
Is Codex open source?
The Codex command-line tool is open source: the repository at github.com/openai/codex carries the Apache-2.0 licence, read on 2026-10-07. That licence covers the code in that repository. It does not make the hosted models, the web service or the ChatGPT plans open, and this page does not claim that it does.
Is Claude Code open source?
No. The repository LICENSE.md reads 'All rights reserved. Use is subject to Anthropic's Commercial Terms of Service.' The public repository does carry plugins and documentation links, but the licence is not an open-source licence. If you need to read, modify or redistribute the CLI source, Claude Code does not offer that on these terms, and Codex does.
Can I use a non-OpenAI model in Codex, or a non-Claude model in Claude Code?
In Codex, yes in principle: you can set a custom provider in config.toml, but the docs require a compatible Responses API endpoint, and Chat Completions-only endpoints are not supported by current releases. In Claude Code, Anthropic says it does not support routing Claude Code to non-Claude models through any gateway. Whether a given third-party endpoint works with Codex is not verified here.
Do Codex and Claude Code read the same project instruction file?
Mostly. Codex reads AGENTS.md, from a global file and from each folder between the Git root and your working folder, up to a 32 KiB default limit. Claude Code reads CLAUDE.md, and it reads AGENTS.md when no CLAUDE.md exists in the working folder or above it. If both files exist, Claude Code reads only the CLAUDE.md files, unless the CLAUDE.md imports the AGENTS.md.
Can one policy and audit layer cover both tools?
Yes, with Swfte Nexus, which wraps Claude Code and Codex with an allow, deny or ask gate, an audit record, approval learning and completion gates. It does not cover other agents such as OpenCode or Cursor. Without Nexus, you configure each vendor's own permission rules, hooks and managed settings separately.