Connect with us

AI

Claude Code vs OpenAI Codex: How to Choose for Your Plan

Claude Code vs OpenAI Codex comes down to the plan you already pay and whether the shell sandbox starts on, which decides more coding days than a leaderboard.

Published

on

Claude Code vs OpenAI Codex is a choice between two coding agents that read a project, edit files, and run commands. Start with the agent already included in a plan you pay for: Codex when that plan is ChatGPT, Claude Code when that plan is a paid Claude subscription. Codex can be tried on the free ChatGPT plan, and Claude Code is absent from Claude Free. The part that still holds after model names change is easy to skip. One shell sandbox starts off, the other starts on, and each agent shares its allowance with ordinary chat on the same account.

This guide covers what each agent runs, what the US list prices include, how a five-hour window behaves on a real morning, where the sandbox starts, how project rules are stored, and which kind of week fits which tool.

What Claude Code and OpenAI Codex Each Run

Claude Code is Anthropic’s agent for the terminal, tied to the same login you use in the Claude apps. On a paid plan it can plan a change, edit across the repo, and run tests, and you steer it with a CLAUDE.md file, skills, hooks, and MCP servers instead of pasting the same rules into every prompt. It can also open a live page in Claude Code’s in-app browser and check the site from the same session.

Codex is OpenAI’s coding agent, included with ChatGPT Free, Go, Plus, Pro, Business, and Enterprise. Plus is the tier that adds the Codex app for macOS and Windows, along with Slack, GitHub, and Figma connections and Codex plugins for non-developer work. The CLI is open source: install it with npm i -g @openai/codex, run codex, and sign in with ChatGPT or an API key. The CLI and the IDE extension share one config file, so a model you set there applies in both.

Codex reads an AGENTS.md file before it starts work, layering a global file in your Codex home with project files and optional overrides. Claude Code loads CLAUDE.md at the start of a session, so project rules are present without being pasted again. Both can call MCP servers, which means a tool you define once is not trapped inside one vendor, even though the settings files are not the same format. How far each agent goes before it asks you is a sandbox question, and that comes after the bill.

Claude Code vs OpenAI Codex on Monthly Price

The figures in this section are US list prices from the vendor pages as of November 2026. Anthropic’s page localizes and can add tax, so a dollar figure here is the US card, not a receipt in every country. Neither company sells the coding agent as its own separate subscription.

Plan US price What the coding agent includes
Claude Free $0 No Claude Code
Claude Pro $20 a month, or $200 billed up front for the year Claude Code included, shared with chat
Claude Max $100 a month 5x Pro usage every five hours and every week, plus $100 a month in API credits
Claude Ultra $200 a month 10x Pro usage each week, no five-hour limit on a verified account, plus $200 a month in API credits
ChatGPT Free $0 Codex with limited access to GPT-5.6
ChatGPT Go $8 a month Codex with more access to GPT-5.6
ChatGPT Plus $20 a month Codex app, plugins, and the published message ranges
ChatGPT Pro From $100 a month Heavier Codex use; GPT-6 Astra is inside the allowance on the $100 and $200 Pro tiers

Work in the Claude apps and work in Claude Code draw from one pool, which Anthropic’s plan and pricing page states directly, and that page does not promise a fixed message count. A long chat before you open the terminal has already spent part of the coding session. How fast the pool empties depends on the model, the length of the conversation, and the size of the files.

Codex local messages and cloud chats share the plan allowance as well. On the $100 and $200 Pro plans, and on the $100 Business plan, GPT-6 Astra sits inside that allowance. Plus, and the $20 Business plan, include a smaller Astra share, with credits if you need more. Credits are the official path past the included Codex allowance.

An API-key login is a different bill from the subscription. These standard list rates, per million tokens, are the ones on OpenAI’s current API token prices, before any cache discount.

API model Input per 1M tokens Output per 1M tokens
gpt-6.1-sol $2 $10
gpt-6-astra $10 $50
gpt-6-luna $0.10 $0.50
gpt-5.3-codex $1.75 $14

gpt-5.3-codex is the specialized Codex row on that API card. The flagship rows above it are the models the Codex pricing table also meters on a ChatGPT plan. Cache discounts cut the input side on a repeat of the same prompt, so a long session that keeps one repo in context costs less than the raw input rate suggests, and the output rate does not get that cut.

How Five-Hour Limits Change a Coding Day

Pro and Max both reset on a rolling five-hour window and also carry a weekly limit. Ultra keeps the weekly limit and, on a verified account, drops the five-hour cap. Because the Claude apps and Claude Code share that pool, the window is not reserved for the terminal. Paid plans can also turn on usage credits and keep working at standard API rates, or you can wait for the reset, or you can move up a plan.

OpenAI publishes ranges, not a single message promise, for Plus and standard Business. Check Codex usage ranges OpenAI publishes before you treat any row as a guaranteed count. Local messages and cloud chats share the window, and weekly limits can sit on top. The spread inside one row is the part worth planning around: GPT-6.1 Sol is listed at 15 to 160 local messages in five hours, so a morning of long refactors belongs near the bottom of that range.

Model on Plus and standard Business Local messages in five hours
GPT-6.1 Sol 15 to 160
GPT-6 Astra 5 to 45
GPT-6 Sol 15 to 150
GPT-6 Luna 350 to 3,000
GPT-5.6 Sol 10 to 100
GPT-5.6 Luna 250 to 2,000
GPT-5.5 15 to 80

A MORNING ON PLUS

  • Hard step: Start GPT-6.1 Sol on the refactor, and expect long turns to sit near the low end of its published range.
  • Light step: Move routine edits to GPT-6 Luna so the five-hour window is not spent on work a cheaper model can finish.
  • Check: Run /status in the CLI before you open another long task in the same window.

That pattern fits a few focused sessions a week, which is the workload Plus is described for. When the window is already gone, both products offer the same three exits, and the right one depends on whether this was a spike or a habit.

THREE WAYS PAST A LIMIT

  1. Wait: The five-hour window rolls forward, and a weekly cap can still block you after that reset.
  2. Move up: Claude Max or Ultra, or ChatGPT Pro, are the heavier tiers on the price table.
  3. Pay the overage: Usage credits on a paid Claude plan, and Codex credits or an API key, bill the extra work outside the included allowance.

One bad afternoon is a wait. A second week of the same wall is a higher plan. Credits suit a spike, because they do not change the plan you return to next month. Keeping a second subscription as a spare engine makes sense only when one window keeps dying in the middle of a task you still have to finish that day.

Where the Sandbox Starts on Each Agent

Codex treats workspace-write as the default low-friction mode. In that mode it can read files, edit inside the workspace, and run routine local commands inside the boundary. With an on-request approval policy, it asks before it steps outside. The other common modes are read-only and danger-full-access. Full access, in the docs, means danger-full-access together with an approval policy of never. The boundary is spelled out under Codex sandbox modes in the docs.

Claude Code’s Bash sandbox is off by default. You turn it on with /sandbox in a session, or by setting sandbox.enabled to true in a settings file such as ~/.claude/settings.json. The platform limits are in Claude Code’s sandbox documentation: macOS, Linux, and WSL2, with native Windows left unsandboxed. On a Windows PC, the sandbox path is a WSL2 session, not the native app.

The sandbox wraps shell commands only. Read, Edit, Write, WebFetch, WebSearch, hooks, local MCP servers, and language-server processes run outside it. A sandboxed command can still read most of the machine by default, including credential files such as ~/.ssh and ~/.aws/credentials, until you deny those paths. Network access has no direct route out. Traffic goes through a proxy whose allowed-domain list starts empty, and the first new host needs a decision from you.

THE FOLDER YOU OPEN

  • The file: Codex reads AGENTS.md before it works, and Claude Code loads CLAUDE.md for the session, so a markdown file in the working directory is treated as your instructions.
  • The folder: Open the agent in the project you mean to change, not in Downloads, where a browser can save a text file you did not write.
  • The check: Read any instruction file you do not recognize before you approve a command, and decline a request to rerun a blocked command outside the sandbox unless you know why it failed.

Turning the sandbox on does not replace file permissions. If you need one boundary around the file tools as well as the shell, run the whole Claude Code process in a container or a virtual machine. Codex is arranged the other way around: the default is already a workspace boundary, and widening it to full access is a setting you choose, not the starting point.

How Project Rules Differ for Each Agent

CLAUDE.md is the file Claude Code sees every session. Put the rules you are tired of repeating there: the package manager, the test command, and a demand that it ask before adding a dependency. Files under.claude/rules/ can split that guidance by topic, and a gitignored CLAUDE.local.md can hold notes that should not be committed. Skills are separate. They are folders with a SKILL.md the agent can pull in when the request matches, rather than text that loads every time.

Skills turned on in your Claude account also show up in Claude Code from version 2.1.273 when you sign in with that account. An API-key login does not sync them, and a login through a cloud provider such as Amazon Bedrock does not either. The sync is one way: Claude Code reads the account and does not write skills back to it. Run /skills in a session and look for the ones listed under the account sync if you expected a skill and it is missing.

Codex builds an instruction chain when a session starts. A global AGENTS.md in the Codex home, by default ~/.codex, is the base. A project AGENTS.md adds repo rules, and AGENTS.override.md replaces the file at that level when you need a hard exception. It is the same job as CLAUDE.md, stored on a different path, which matters the day you keep both tools in one repo and want them to run the same test command.

Command gates differ in shape. Claude Code hooks fire your script, an HTTP call, or a prompt when a lifecycle event happens, which is where a formatter or a block on a dangerous command belongs. Codex rules, under the Codex home, match a command prefix and then allow it, prompt, or forbid it, with the strictest matching rule winning. A hook fits a check that should run before a class of steps, and a Codex rule fits a specific command that must not leave the sandbox.

Picking Claude Code or Codex for Your Week

Match the week you actually have, not the model that led a chart the last time a lab published one. The price table and the sandbox default do that sorting without a second subscription unless your week keeps breaking the window.

Your week Start here Why
You already pay for ChatGPT Plus or Pro Codex The agent is already in the plan
You already pay for Claude Pro, Max, or Ultra Claude Code The terminal shares that same pool
You want a free look first Codex on Free or Go Claude Free has no Claude Code
You code most of the day and hate five-hour stops Compare Claude Ultra with Codex Pro Ultra drops the five-hour cap for a verified account; Pro is the heavy Codex plan, from $100
You want the shell contained before the first command Codex, and turn Claude’s sandbox on if you add it Codex defaults to workspace-write; Claude’s Bash sandbox starts off
You work on native Windows without WSL Read the sandbox note before you trust it Claude Code’s shell sandbox needs WSL2
You want repeatable checks around the agent Claude Code Hooks and CLAUDE.md are built for that loop

A few sessions a week fit inside Plus or Claude Pro without a second subscription. Paying for both is the backup for a week where one window keeps dying mid-task. Move up to Claude Max or Ultra, or to Codex Pro, only after a normal week on the cheaper paid plan actually runs out. If you do keep both, give them the same test command in CLAUDE.md and AGENTS.md so a task that switches tools does not switch rules.

Frequently Asked Questions

Which Models Can You Pick in Claude Code and Codex?

Paid Claude plans include Opus, Sonnet, and Haiku, and Fable is available with usage credits on Pro or for up to half the weekly limit on Max and Ultra. The Codex pricing table lists ranges for 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 on Plus and standard Business. Free and Go describe access to GPT-5.6 rather than that full range table.

Does the Sandbox Block Network Calls From Claude Code?

A sandboxed shell has no direct route to the network, and the allowed-domain list starts empty, so a new host needs approval. WebFetch and WebSearch sit outside that sandbox, which means an allowed-domain rule does not limit them. File tools follow permission rules instead, so a network deny aimed at the shell leaves those tools on their own settings.

Do Team and Enterprise Seats Include the Agent?

Claude Code comes with paid Claude plans, and Enterprise is $20 per seat per month plus API-rate usage, billed yearly. Codex on Enterprise and Edu without flexible pricing uses Plus-style per-seat limits for most features, while flexible pricing scales with credits and drops the fixed rate limit. On Claude Team plans, a Standard seat gives more than Pro, and a Premium seat gives five times a Standard seat.

Should You Trust an Older Benchmark to Pick?

Treat a score tied to an older model name as expired. Both pricing pages, as of November 2026, list model families beyond the flagships those older charts compared, and each lab runs its own tests. Use a chart as a reason to try one model on your repo, then judge the week by the plan, the window, and the sandbox.

Before the next repo, open the usage screen for the plan you already pay, confirm the agent is actually on that plan, and set the sandbox before the first command: /sandbox in Claude Code, or sandbox_mode in Codex.

Harry is the editor of Oton Technology, an independent site he owns and edits, covering the part of technology that people actually have to act on. After ten years in journalism, first reporting and then editing, he works from primary material by habit: the advisory rather than the write up of it, the filing rather than the press release, the changelog rather than the launch video. Every figure in an article carries its source and its date, and where a number comes from a vendor or an analyst model rather than a count, he says so plainly instead of letting it stand as established fact. What he leaves out is anything he could not verify himself, which on a beat full of unnamed supply chain claims removes a great deal. That standard applies across all the sections the site publishes for an international audience, from artificial intelligence and security to phones, computers, gaming, crypto and the software businesses depend on. He corrects errors in the open and labels them, because a site that hides its mistakes is asking readers to trust the rest on nothing.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending