Codex vs Claude Code: pricing, safety settings and how to pick

Codex (OpenAI) and Claude Code (Anthropic) are coding agents that read your repo, edit files and run commands. Both start at $20 a month on a paid plan; Codex also has limited Free and $8 Go access.

Gary · Published · Updated · 9 min read

Isometric illustration of two glowing terminal windows on separate platforms joined by a bridge, each with a small shield beside it.
On this page
  1. Quick verdict: Codex vs Claude Code at a glance
  2. What are Codex and Claude Code?
  3. How much do Codex and Claude Code cost?
  4. What are the usage limits?
  5. Which is safer by default: Codex or Claude Code?
  6. Same task, both agents: how to run a fair test
  7. How do they handle context and speed?
  8. Which should you pick?
  9. Keep your keys safe with either agent
  10. FAQ
  11. Whichever agent wrote it, scan it before launch.

Codex vs Claude Code: both are AI coding agents that read your project, edit files and run commands, and both start at $20 a month on a full paid plan. Codex (OpenAI) comes with ChatGPT accounts, including limited access on Free and the $8 Go plan. Claude Code (Anthropic) comes with every paid Claude plan, starting with Pro. The bigger difference is in their safety defaults, which this guide compares side by side.

By Gary, Greenlight My App · Compared on Oct 21, 2026; based on Anthropic's and OpenAI's public sites · Drafted with AI tools and reviewed before publishing. We don't rank vendors and aren't affiliated with either.

If you build with coding agents, you've probably asked: "Codex or Claude Code?" Benchmarks change every few months, so this page sticks to what each vendor publishes (price, limits, where it runs, and what it's allowed to do by default) and gives you a fair way to test both.

Quick verdict: Codex vs Claude Code at a glance

Codex (OpenAI)Claude Code (Anthropic)
Comes withChatGPT Free, Go, Plus, Pro, Business, Edu, EnterpriseClaude Pro, Max, Team, Enterprise
Cheapest full planPlus, $20/monthPro, $20/month ($17/month billed annually)
Free optionLimited Codex on Free ($0) and Go ($8)None (Claude Free doesn't include Claude Code)
Pay per useAPI key, at API pricingClaude Console account, at API rates
Where it runsDesktop app, CLI, IDE extension, web, iOS (on Plus and up)Terminal, IDE extensions, desktop app, browser
Project instructions fileAGENTS.mdCLAUDE.md (can also read AGENTS.md)
Local defaultOS sandbox, workspace writes only, network offAsks before file edits and most shell commands

Prices as of Oct 21, 2026. Check the official page before you rely on them: Codex pricing (external) · Claude pricing (external).

What are Codex and Claude Code?

Both are agentic coding tools: you describe a task, and the agent reads files, proposes or makes edits and runs commands.

  • Codex is OpenAI's coding agent. Per OpenAI's pricing docs (external), Plus and higher plans get Codex on the web, in the CLI, in the IDE extension and on iOS, plus cloud features like automatic code review on GitHub and a Slack integration. With an API key you get the CLI, SDK and IDE extension, but not the cloud features.
  • Claude Code is Anthropic's coding agent. Per the Claude Code docs (external), it runs in the terminal, in VS Code and JetBrains extensions, in a desktop app and in the browser.

How much do Codex and Claude Code cost?

PlanCodex (via ChatGPT)Claude Code (via Claude)
Free$0: limited, GPT-6 Luna in the desktop app (subject to rollout)Not included
Low-costGo, $8/month: limited, lightweight tasksn/a
Main tierPlus, $20/monthPro, $20/month ($17 annual)
Heavy usePro: $100, $200 or $500/monthMax: from $100/month (5x or 20x Pro's usage)
TeamsBusiness: $25/user/month billed monthly (2+ users)Team: see Anthropic's pricing page
Pay per useAPI key at API pricingConsole account at API rates

Prices as of Oct 21, 2026. Check the official page before you rely on them.

For what Claude Code actually costs per day on pay-as-you-go, see our Claude Code pricing breakdown.

What are the usage limits?

  • Codex: OpenAI publishes estimates, not fixed caps. On Plus, it lists roughly 15–160 local messages per five hours with GPT-6.1 Sol, and 350–3,000 with GPT-6 Luna. Pro plans "currently have no five-hour limit." Cloud tasks can use more of the allowance than local messages. Plus and Pro users can buy extra credits.
  • Claude Code: it shares one usage pool with your Claude chats. Limits reset on a rolling five-hour window, and paid plans add weekly limits. Pro gets at least 5x Free's usage per session, and Max gets 5x or 20x Pro's. You can turn on usage credits at API rates.

Which is safer by default: Codex or Claude Code?

They protect you in different ways, and both can be loosened. Here's what each vendor's docs say about the defaults.

Safety settingCodexClaude Code
File editsAllowed inside the workspace in the default Auto preset; outside needs approvalAsk on each edit in the default (Manual) mode
Shell commandsRun inside an OS-enforced sandbox; network commands need approvalAsk, except a built-in set of read-only commands
NetworkOff by default for local commandsWeb fetch asks, except preapproved docs domains
Protected paths.git, .codex, .agents and .aws stay read-only in the workspace sandboxDeny rules such as Read(./.env) block file tools from reading secrets
"Skip everything" mode--yolo / --dangerously-bypass-approvals-and-sandbox ("not recommended")bypassPermissions ("only use this mode in isolated environments")

Sources: Codex approvals and security (external), Claude Code permissions (external), checked Oct 21, 2026.

Two details worth knowing:

  • Claude Code's docs say permission rules "are enforced by Claude Code, not by the model," so writing "don't touch .env" in CLAUDE.md isn't a lock. Add a deny rule. Our Claude Code permissions guide shows how.
  • Codex's docs warn that prompt injection "can cause the agent to fetch and follow untrusted instructions" when you turn on network access or live web search.

Same task, both agents: how to run a fair test

Until you've run your own, here's a 30-minute test that keeps it fair:

  1. Pick one real task from your project, like a login page backed by Supabase.
  2. Give both agents the same prompt and files, each on its main paid plan.
  3. Look at the diff, not just the demo. Did either one put a secret key in frontend code, or turn off a database rule to make an error go away?
  4. Check the database rules. If you use Supabase, make sure row level security is on for every table.
  5. Deploy to a test URL and scan it before you choose.

How do they handle context and speed?

Both vendors' current models list very large context windows (see our Claude vs ChatGPT for coding comparison). In practice, speed and accuracy depend on the model you pick inside each tool. Codex offers Fast and Ultrafast modes that use your allowance faster (2.5x and 8x on included usage, per OpenAI). Claude Code lets you switch models with /model and lower effort with /effort.

Which should you pick?

If you...Try first
Already pay for ChatGPT PlusCodex
Already pay for Claude ProClaude Code
Want to try for $0Codex (limited on ChatGPT Free)
Want cloud tasks and automatic GitHub PR reviewsCodex on Plus or higher
Want fine-grained allow, ask and deny rules in a settings fileClaude Code
Run in CI with an API keyEither: Codex CLI/SDK with an API key, or Claude Code on a Console account

Keep your keys safe with either agent

Coding agents often wire up an API key the quickest way, and the quickest way is sometimes the browser. Keep every secret on the server, never in a VITE_ or NEXT_PUBLIC_ variable. See how to get an OpenAI API key and keep it safe and Claude API key security.

FAQ

Is Codex free? Partly. ChatGPT Free includes limited Codex access in the desktop app, subject to rollout. Full Codex on the web, CLI and IDE starts with Plus at $20/month.

Is Claude Code free? No. It's included with Claude Pro ($20/month, or $17/month billed annually) and higher plans, or you can pay per token through a Console account.

Can I use both? Yes. They're separate tools with separate accounts. Many teams keep both an AGENTS.md and a CLAUDE.md, and Claude Code can read an existing AGENTS.md.

Which is better for beginners? Start with the one that comes with the plan you already pay for. Both explain their changes. Beginners should keep the default approval settings on.

Does Claude Code work in VS Code? Yes. Anthropic offers VS Code and JetBrains extensions. Codex also has an IDE extension.

Which writes safer code? We haven't published a head-to-head test yet, so we won't claim one. Either agent can produce code that runs but leaves something exposed, so review and scan before launch.

Whichever agent wrote it, scan it before launch.

Run a free Greenlight My App scan of your live app. It's automated, read-only and educational, not a security audit: it checks HTTPS, common security headers, exposed .env or .git files, public source maps and common secret key patterns (including OpenAI and Anthropic key formats) in the scripts your homepage loads. "Nothing found" isn't a guarantee that nothing is exposed.

Sources

On this site

Related posts

Greenlight My App is independent and not affiliated with or endorsed by OpenAI, Codex, ChatGPT, Anthropic, Claude or Claude Code. We don't rank vendors. Plans, prices and defaults are from each vendor's public pages as of Oct 21, 2026 and can change. Codex and ChatGPT are trademarks of OpenAI; Claude and Claude Code are trademarks of Anthropic. This page is general information, not professional security advice, legal advice, a security audit or a guarantee. Check your own setup against the vendor's current docs.