Back to Blog

Explainers

Claude Code vs Codex vs Cursor: Enterprise Architecture and Cost

By · Published · Updated · 11 min read

Matrix comparing Claude Code, OpenAI Codex and Cursor on sandbox default, approvals, worktrees, cloud execution, headless CI and billing.
All three tools share the same building blocks, so the choice comes down to defaults, policy controls and billing.

Engineering leaders rarely pick a coding agent once. They pick a runtime boundary, an instruction format, a CI pattern and a billing model, then live with those choices across every repository. This guide compares Claude Code, OpenAI Codex and Cursor on those four layers.

It stays below the editor. For the question of which editor your developers should live in, read our AI IDE architectural comparison of VS Code, Cursor and Google Antigravity. Every price and capability here was checked against the linked vendor page on November 24, 2026; treat it as a dated input, because all three vendors change plans and defaults often.

How Do Claude Code, OpenAI Codex, and Cursor Differ in Execution Architecture?

The three products have converged: each runs a local agent loop behind an operating-system sandbox, offers cloud execution, runs headless and reads shared instruction files. What differs is the defaults, what the sandbox covers and who holds the policy controls.

Execution architecture matrix, compiled from vendor documentation checked November 24, 2026.
DimensionClaude CodeOpenAI CodexCursor
Runtime sandboxBash sandbox is off by default; Seatbelt on macOS, bubblewrap on Linux and WSL2, none on native Windows (sandboxing)workspace-write with on-request approvals by default in version-controlled folders; Seatbelt on macOS, bwrap plus seccomp on Linux (approvals and security)Auto-review is the default run mode; Seatbelt on macOS, Landlock plus seccomp on Linux kernel 6.2 or later (run modes)
Approval modelSix permission modes from default to bypassPermissions; dontAsk is described as suited to locked-down CI (permission modes)on-request, never and a granular policy; untrusted is no longer supportedAuto-review, Allowlist and Run Everything; admins can restrict which modes users see
Context ingestionCLAUDE.md hierarchy; reads AGENTS.md when no CLAUDE.md exists, or imports it with @AGENTS.md (memory)AGENTS.md from ~/.codex and from project root down to the working directory, capped at 32 KiB by default (AGENTS.md).cursor/rules, team rules on Team and Enterprise, and root plus nested AGENTS.md (rules)
Worktree isolation--worktree sessions and isolation: worktree subagents under .claude/worktrees/ (worktrees)Managed worktrees in the ChatGPT desktop app; keeps the 15 most recent by default (worktrees)Agents Window, IDE /worktree and the CLI; keeps up to 25 per machine by default (worktrees)
Cloud executionCloud sessions in an isolated, Anthropic-managed VM, or a self-hosted environment (cloud sessions)Cloud tasks in isolated OpenAI-managed containers; agent phase offline unless internet access is enabledCloud agents in isolated VMs that push a branch for handoff (cloud agents)
Headless CI supportclaude -p with JSON output and the anthropics/claude-code-action@v1 GitHub Action (headless)codex exec, read-only by default, and openai/codex-action@v1 (non-interactive)agent -p print mode with CURSOR_API_KEY, plus a documented GitHub Actions setup (headless)
Enterprise seat modelTeam standard or premium seats; Enterprise is a seat fee plus usage at API ratesBusiness standard or premium seats with credits for extra usage; Enterprise through salesTeams from $30 per user per month; Enterprise is custom pricing

What the sandbox does not cover

The common governance error is assuming the sandbox wraps the whole agent. In Claude Code it covers shell commands only; file tools, MCP servers and hooks run outside it, and reads stay broad by default, so credential files remain readable unless you add deny rules. Administrators can force it on through managed settings with failIfUnavailable and allowUnsandboxedCommands: false (Claude Code sandboxing).

Codex inverts the default posture: version-controlled folders start in workspace write with on-request approvals and network off, and codex exec starts read-only (Codex approvals and security). Cursor print mode rejects actions that need approval unless you pass --force, and Cursor calls its admin switch for disabling headless mode "a usage policy, not a security boundary" (Cursor headless CLI).

None of these replaces server-side controls. Branch protection, required reviews and scoped tokens still do the hard containment, the layering argument in our three-lane agent governance architecture.

How Do Instruction Files and MCP Servers Reach Each Agent?

AGENTS.md is now the common denominator. Codex walks from the project root to the working directory, reads one file per directory (AGENTS.override.md first) and stops at project_doc_max_bytes, 32 KiB by default. Cursor reads root and nested AGENTS.md files, the more specific one winning. Claude Code reads AGENTS.md only when no CLAUDE.md exists in the working directory or above; otherwise a CLAUDE.md starting with @AGENTS.md imports it (Claude Code memory).

MCP is equally universal, but stored differently: a project .mcp.json for Claude Code (MCP), [mcp_servers.<name>] tables in config.toml for Codex (MCP), and .cursor/mcp.json for Cursor (MCP). Three files means three places for an allowlist to drift. Every connected server also adds tool definitions to context on each turn; our MCP versus CLI token-cost hierarchy covers keeping that overhead deferred.

When Does Per-Seat Pricing Lose to Usage-Based Token Economics?

Seats buy a usage allowance whose ceiling is not published in tokens; API keys buy tokens at a published rate. Claude Team is $20 per standard seat per month billed annually ($25 monthly) and $100 per premium seat ($125 monthly), for teams of 2 to 150; Claude Enterprise is listed at $20 per seat per month billed annually with a 20-seat minimum, plus usage at API rates (Claude pricing). ChatGPT Business mirrors those seat prices, with premium seats removing the five-hour usage limit (ChatGPT Business seats). Cursor Teams is listed at "$30+/user/month", and its pricing page states that third-party model usage is not included in the monthly prices and must be purchased separately (Cursor pricing). On Teams and Enterprise, Cursor's documentation bills eligible third-party models at API list price plus a Cursor Token Rate of $0.25 per million tokens, including bring-your-own-key usage; models whose cache-read price is below $0.10 per million are exempt (Cursor models and pricing).

The model below prices one agent-authored pull request. Its inputs are illustrative assumptions, not measurements; replace them with pilot data before you budget. For the Claude side alone, including Pro, Max, Ultra and API-key billing, the full break-even model is in Claude Code Pricing Architecture.

  • Assumption: a 20-engineer team, billed annually where a vendor offers it.
  • Assumption: each agent-authored PR consumes 1.5 million input tokens across all turns (1.2 million cache reads plus 300,000 fresh tokens) and 60,000 output tokens.
  • Assumption: the 300,000 fresh tokens are written to the shortest cache tier each vendor lists (the 5-minute cache on Claude models, the 30-minute write on OpenAI models), and every request stays under the 272,000-token short-context threshold.
  • Prices used: Claude Sonnet 5.5 at $2 input, $2.50 5-minute cache write, $0.10 cache read and $10 output per million tokens; Claude Opus 5.5 at $4, $5, $0.20 and $20 (Claude API pricing). OpenAI gpt-6.2-sol at $2 input, $2.50 30-minute cache write, $0.10 cached input and $10 output; gpt-6.2-astra at $8, $10, $0.40 and $40 (OpenAI API pricing).
  • Excluded: GitHub Actions minutes, taxes, data-residency multipliers, negotiated discounts and engineer review time.
Monthly cost at 50 and 500 agent-authored PRs, 20 engineers. Arithmetic on the stated assumptions and published prices checked November 24, 2026.
Line itemPer PR50 PRs per month500 PRs per month
Claude Sonnet 5.5 via API key$1.47$73.50$735
Claude Opus 5.5 via API key$2.94$147$1,470
OpenAI gpt-6.2-sol via API key$1.47$73.50$735
OpenAI gpt-6.2-astra via API key$5.88$294$2,940
Claude Team, 20 standard seatsNot metered per PR$400 flat$400 flat, if within plan limits
ChatGPT Business, 20 standard seatsNot metered per PR$400 flat$400 flat, if within plan limits
Cursor Teams, 20 seatsAPI list price plus $0.39 Cursor Token Rate on Sonnet 5.5From $600 plus model usage and $19.50 token rateFrom $600 plus model usage and $195 token rate
Claude Enterprise, 20-seat minimum plus Sonnet 5.5 usage$1.47 usage$473.50$1,135
ChatGPT EnterpriseNot publicContact salesContact sales
Cursor EnterpriseNot publicCustom pricingCustom pricing

At 50 PRs a month, every API route in the table costs less than 20 standard seats. Under these assumptions the break-even against $400 of seats is about 272 PRs on Sonnet 5.5 or gpt-6.2-sol, 136 on Opus 5.5 and 68 on gpt-6.2-astra. Above that volume seats win on paper, but only if the work fits the allowance, which neither Anthropic nor OpenAI states in tokens. OpenAI publishes ranges instead, such as 17 to 180 local GPT-6.2 Sol messages per five hours on standard Business seats, and warns that cloud tasks may use more of the allowance (Codex pricing).

Two cautions keep this table honest. First, per-token prices are not comparable across vendors on their own, because tokenizers differ: Anthropic notes that its newer models produce roughly 30 percent more tokens for the same text than earlier ones (Claude API pricing). Compare cost per merged PR from your own pilot, not price per million tokens. Second, the right model is a routing decision rather than a vendor decision; our Claude 5.5 model routing and prompt caching guide shows how cache reads change the arithmetic.

How Should Headless CI Runs Be Billed and Contained?

CI is where the seat model quietly stops applying. The Claude Code GitHub Action accepts an API key, a subscription OAuth token or workload identity federation, and recommends an API key for secrets shared across repositories, because an OAuth token is tied to the subscription of whoever generated it. It can also route inference through Amazon Bedrock, Google Cloud or Microsoft Foundry (Claude Code GitHub Actions). The Codex action takes an OpenAI API key, runs codex exec and removes sudo by default (Codex GitHub Action). Cursor's guide reads CURSOR_API_KEY from a repository secret and recommends restricted autonomy for production CI (Cursor GitHub Actions).

Plan for CI runs to bill as usage, with their own key, budget and alert, and contain each runner with the strictest documented posture. A complete Claude Code review pipeline, with managed settings and a fail-closed verdict gate, is laid out in Claude Code Enterprise Security:

  • Claude Code: run claude -p with --bare, which the docs recommend for scripted calls, plus --permission-mode dontAsk or explicit --allowedTools lists (headless).
  • Codex: keep codex exec read-only for review jobs, and grant --sandbox workspace-write only to jobs that must edit.
  • Cursor: avoid --force in jobs that run untrusted pull request code, and enforce allow and deny rules through permission configuration.
  • All three: set a turn or budget cap, a workflow timeout and a concurrency limit, so a runaway loop fails closed.

How Should Engineering Teams Run Hybrid Workflows Without Policy Drift?

Many organizations will run Cursor in the editor and a terminal agent in CI. Drift comes from instruction files that diverge, approval settings each developer tunes locally, and MCP allowlists stored in three formats. Keep one source of truth per layer and enforce it where users cannot override it.

  1. Keep shared engineering rules in one root AGENTS.md. All three tools read it, and Codex enforces a 32 KiB default ceiling, so treat that as your budget.
  2. Add a thin CLAUDE.md that imports @AGENTS.md and holds only Claude-specific rules, and put Cursor-only rules in .cursor/rules. Never copy the shared rules into either file.
  3. Enforce approvals centrally: Claude Code managed settings can block bypassPermissions and auto mode (permission modes); Codex requirements.toml or cloud policy guardrails can block never approvals and danger-full-access (managed configuration); Cursor admins can restrict run modes and sandbox networking.
  4. Generate the three MCP configuration files from one reviewed manifest, and fail CI when a committed file differs from the generated output.
  5. Gate merges server-side. Branch protection and required human review apply equally to every agent, whatever its local settings say.

A minimal CLAUDE.md for a repository that standardizes on AGENTS.md looks like this:

@AGENTS.md

## Claude Code only

Use plan mode for changes under src/billing/.
Run the test suite with the sandbox enabled before proposing a commit.

The drift check can be a script that regenerates .mcp.json, .codex/config.toml and .cursor/mcp.json from the manifest and runs git diff --exit-code: deterministic and model-independent. For where it sits beside OS sandboxes and signed approvals, see our Agentsitter governance architecture and architecting for agentic risk.

Which Tool Should Be the Default for Your Organization?

Choose the default on identity, billing and policy fit, then let developers add a second tool where it earns its place. This is a design recommendation, not a benchmark result.

  • Default to Claude Code when you already buy Claude seats or API capacity, want one runtime from laptop to CI, or must route inference through Bedrock, Google Cloud or Foundry. Plan the sandbox rollout, because it is off until enabled.
  • Default to Codex when ChatGPT Business or Enterprise is already your identity and compliance boundary. Its conservative defaults reduce configuration work for a first rollout.
  • Default to Cursor when the editor is the center of the developer day. Budget third-party model usage as a separate line, and read our IDE architectural comparison before standardizing the editor itself.
  • Whatever the default, pilot the candidates on the same backlog for two weeks and record cost per merged PR, review rework and policy exceptions.

What This Comparison Does Not Settle

This page compares architecture and published prices, not code quality; we ran no controlled benchmark for it. ChatGPT Enterprise and Cursor Enterprise pricing is not public, so those totals must come from your own quote. The Codex agent approvals and security page also labels its cloud section as legacy, so confirm the current cloud surface with OpenAI before standardizing on it.

Primary sources checked November 24, 2026

Frequently Asked Questions

Is Claude Code cheaper than Codex or Cursor?

It depends on volume and billing route. Claude Team and ChatGPT Business standard seats both cost $20 per user per month billed annually; Cursor Teams starts at $30 and bills third-party models separately. Our illustrative API model costs $1.47 per PR on both Sonnet 5.5 and gpt-6.2-sol once cache writes are counted, but tokenizers differ, so measure cost per merged PR.

Do Claude Code, Codex and Cursor all support AGENTS.md?

Yes, with different precedence. Codex merges AGENTS.md files from the project root down to the working directory up to 32 KiB by default. Cursor reads root and nested AGENTS.md files. Claude Code reads AGENTS.md only when no CLAUDE.md exists, so teams with both should start CLAUDE.md with an @AGENTS.md import and keep shared rules in one file.

Which coding agent has the safest default sandbox?

On defaults alone, Codex is the most conservative: workspace-write with on-request approvals in version-controlled folders, network off, and codex exec read-only. Claude Code ships its sandbox off until enabled, and it covers shell commands only. Cursor defaults to classifier-backed Auto-review. In every case, server-side branch protection remains the control that actually contains damage.

Can these agents run in CI without a per-seat license?

Yes. Claude Code runs headless with claude -p and the anthropics/claude-code-action, authenticated by API key, OAuth token or identity federation. Codex uses codex exec and openai/codex-action with an OpenAI API key. Cursor documents agent -p with CURSOR_API_KEY in GitHub Actions. Budget CI runs as metered usage with their own key, cap and alert.

Add ClaudeSkillsGuide as a preferred source on Google