Codex vs Claude Code: pricing, permission models, config files and when to use which

Codex Published:

OpenAI's Codex and Anthropic's Claude Code compared on what changes slowly: pricing, permission and sandbox design, AGENTS.md versus CLAUDE.md, cloud execution and CI.

Verified on Sep 7, 2026 These tools change quickly. Please also check the latest official documentation.
Contents
  1. At a glance
  2. Pricing
  3. Permission models
  4. Configuration and customization
  5. Cloud execution and CI
  6. Rules of thumb
  7. Summary

Codex (OpenAI) and Claude Code (Anthropic) are both coding agents you can drive from the terminal and from VS Code. "Which is smarter" flips with every model release, so this article compares the parts that stay put: pricing structure, permission model, configuration files and surrounding features.

KEY POINT

What you will learn

  • How pricing and subscriptions differ
  • The permission models: OS sandbox versus per-tool rules
  • Configuration files, extensions, cloud execution, CI, and rules of thumb for choosing

At a glance

AspectCodexClaude Code
VendorOpenAIAnthropic
SubscriptionChatGPT paid plans, or API keyClaude paid plans, or API key
CLIcodexclaude
VS Code extensionYes (local and cloud tasks)Yes
Context fileAGENTS.md (shared standard)CLAUDE.md (product-specific)
Config file~/.codex/config.toml (TOML)settings.json (JSON, three scopes)
Permission modelApproval policy + OS-level sandboxPer-tool allow / deny / ask + permission modes
Extension pointsMCP, AGENTS.mdMCP, hooks, skills, subagents
Cloud executionCodex cloud (GitHub integration, PRs)Claude Code on the web, GitHub Actions
Non-interactivecodex execclaude -p
CIGitHub Action, codex execclaude-code-action, claude -p

Pricing

Both offer usage included in a subscription, or pay-as-you-go through an API key. If you already subscribe to one of the chat products, starting there is cheapest.

  • Codex: ChatGPT Plus / Pro / Team / Enterprise allowances, or the OpenAI API
  • Claude Code: Claude Pro / Max / Team / Enterprise allowances, or the Anthropic API

Allowance sizes and reset windows differ by plan.

Permission models

This is the biggest design difference.

Codex layers an approval policy (do we ask) on top of an OS-level sandbox (what is physically possible). The sandbox uses Seatbelt on macOS and Landlock on Linux to block writes outside the workspace and network access. You can reduce prompts and still limit the blast radius. Details: Codex CLI approval modes versus sandbox modes.

Claude Code uses per-tool rules such as allowing Bash(npm run test:*) and denying Read(./.env). There is no OS isolation, but the rules give fine control over what runs unattended. Details: Claude Code permissions in settings.json.

用語解説

Which is safer? Codex's sandbox physically stops unexpected actions. Claude Code's rules precisely shape expected actions. Codex's style suits CI and autonomous runs; Claude Code's suits flexible daily work.

Configuration and customization

ItemCodexClaude Code
RulesAGENTS.md (hierarchical)CLAUDE.md (user / project / local + subdirectories)
Config formatOne TOML file with profilesJSON in three scopes; deny always wins
Deterministic automationNone (relies on AGENTS.md instructions)Hooks (for example, always lint after edits)
Reusable promptsWritten into AGENTS.mdSkills / slash commands
Role separation-Subagents

Claude Code has the thicker customization layer (hooks, skills, subagents), which suits teams that want their workflow built into the tool. Codex keeps everything in config.toml and AGENTS.md, which is simpler.

Cloud execution and CI

  • Codex cloud runs tasks against a GitHub repository in OpenAI's containers and returns pull requests; it is convenient for parallel, independent tasks.
  • Claude Code integrates with GitHub through claude-code-action (mention @claude in issues and PRs) and offers Claude Code on the web.

Rules of thumb

SituationLeans toward
Already paying for ChatGPTCodex
Already paying for ClaudeClaude Code
Want team workflow (lint, review checklist) built into the toolClaude Code (hooks, skills)
Want OS-level limits on what autonomous runs can breakCodex (sandbox)
Want many independent tasks running in parallel in the cloudCodex cloud
Want fixes triggered from GitHub issue commentsEither, with different setups

If you use both, run the same task through each for a while and compare the diffs and rework; that tells you more than benchmark headlines.

Summary

  • Both bill either through a subscription allowance or an API key; start with what you already pay for
  • Codex enforces limits with an OS sandbox; Claude Code with per-tool rules
  • Claude Code's hooks, skills and subagents make it easier to embed a team process; Codex is simpler to configure
  • Codex cloud for parallel cloud tasks; both can be driven from GitHub comments

FAQ

Which is better, Codex or Claude Code?
There is no stable answer; model strengths swap with each release. This article compares the design and operational differences that do not change every month.
Can I use both on the same project?
Yes. Keep an AGENTS.md and a CLAUDE.md, and share the common content from one file to avoid maintaining two copies.
If I can only subscribe to one, ChatGPT Plus or Claude Pro?
Start with whichever you already pay for. If neither, decide by the editor you use most and how you want CI integration to work.

Primary sources

This article was drafted by AI from official documentation and reviewed by the site operator before publishing. Found a mistake? Let us know via the contact page.