Skip to content

14 Oct 2026

Claude Code vs Codex: Which Terminal Coding Agent Should You Use?

Claude Code or Codex? A plain comparison of where each runs, pricing, usage limits, safety defaults, and MCP support, from vendor docs.

Neither tool wins outright. Claude Code (Anthropic) and Codex (OpenAI) both read your repository, edit files, run commands, and work from a terminal, an editor, a desktop app, or the cloud. In our view, Claude Code suits Claude subscribers, long hands-off sessions, and teams on Amazon Bedrock, Google Cloud, or Microsoft Foundry. Codex suits people who want a strict sandbox from the first run, an open-source CLI, or an agent bundled with a ChatGPT plan.

  • Pick Claude Code if you already pay for Claude Pro or Max, or need to run through a major cloud provider.
  • Pick Codex if you want a free way to try it, prefer an Apache-2.0 open-source CLI, or want network-off sandboxing by default.
  • Try both if you are not sure. They can share one AGENTS.md file.

New to agent-style coding? Start with what vibe coding is. This guide sticks to what each vendor documents on its own site; prices and limits were checked Oct 14, 2026. Where we could not confirm something, we left it out.

Quick verdict table

Claude CodeCodex
Made byAnthropicOpenAI
SurfacesCLI, VS Code, JetBrains, desktop app, webCLI, IDE extension, ChatGPT desktop app, web
Cheapest paid planClaude Pro, $20/month ($17/month billed annually)ChatGPT Go, $8/month
Free way inNo (Claude Code isn't on the Free plan)Yes, limited
Project instructionsCLAUDE.md (can read AGENTS.md)AGENTS.md
Default local safetyClassifier reviews actions; sandbox offSandbox on, network off
CLI source codeNot open sourceApache-2.0

Where each one runs (command line, editor, app, cloud)

Command line. Both install with a one-line script or through Homebrew; Codex also installs with npm. Both have a non-interactive mode for scripts and CI: claude -p and codex exec.

Editor. Claude Code has a VS Code extension (with a Cursor install link) and a JetBrains plugin. Codex's extension works in VS Code, Cursor, and Windsurf; Xcode and JetBrains offer their own Codex integrations.

App. Claude Code has a desktop app, with Linux in beta. Codex lives inside the ChatGPT desktop app.

Cloud. Claude Code runs in the browser at claude.ai/code and in the Claude mobile apps. Codex cloud tasks each get their own workspace and keep working while your computer is asleep. On OpenAI's pricing page, Codex on the web starts with Plus; Free and Go list the desktop app.

Pricing and usage limits

All figures below are from the vendors' own pages, checked Oct 14, 2026.

Claude Code. Anthropic's pricing page lists Claude Code on Pro ($17/month billed annually, or $20 monthly), Max (from $100/month, with 5x or 20x Pro's usage), Team, and Enterprise. Enterprise is $20 per seat per month plus usage at API rates. The Free plan does not include Claude Code. Limits reset on a rolling five-hour window, paid plans add weekly limits, and Claude Code shares one pool with your Claude chats. You can also pay as you go through a Console account at API rates.

Codex. OpenAI's Codex pricing page lists Free ($0), Go ($8/month), Plus ($20/month), Pro ($100, $200, or $500/month), and Business ($20 per user per month billed annually, or $25 monthly). Free and Go list GPT-6 Luna in the desktop app, "subject to rollout." For Plus, OpenAI estimates 15–160 local messages per five hours on GPT-6.1 Sol and 350–3,000 on GPT-6 Luna. These are estimates, not fixed limits. Pro currently has no five-hour limit. An API key works too, at API rates, without cloud features. OpenAI also notes that GPT-5.5 retires from Codex on all plans today, Oct 14, 2026 (the API isn't affected).

Neither vendor publishes a fixed message count, so watch your usage dashboard in the first week. In our view, the cheapest real test is Codex on Free or Go.

Benchmarks, and why the sources disagree

Benchmarks measure models, not the agent tools. These vendor-published numbers come from launch pages, checked Oct 14, 2026.

  • Anthropic, Claude Opus 5.5 launch (Sept 22, 2026): 66.4% on Terminal-Bench 4.0 (xhigh effort), 54.4% on FrontierCode v1.1, and 57.8% on CursorBench 4.0 (max effort). The same table lists GPT-6 Astra at 57.9% on Terminal-Bench 4.0, "as reported by OpenAI."
  • OpenAI, GPT-6.1 Sol launch: OpenAI says GPT-6.1 Sol matches GPT-6 Astra on DeepSWE v1.1 at about a fifth of the cost. On Terminal-Bench Science 0.1, it puts GPT-6 Astra on top at 68.1%, with GPT-6.1 Sol averaging $5.47 per task versus $23.21 for Opus 5.5.

Even the vendors disagree. Anthropic's table lists GPT-6 Astra at 64.6% on Terminal-Bench Science 0.1, while OpenAI's own page says 68.1%. Neither page explains the gap. Scores shift with reasoning effort, the agent harness, trial counts, and safety fallbacks. Anthropic notes some Opus 5.5 tasks were handed to other models when safeguards stepped in; OpenAI notes its research environment can differ from production. Third-party leaderboards use their own harnesses, settings, and cost assumptions, so their numbers rarely match launch tables. Anthropic itself writes that benchmark margins "have become a less reliable guide to real-world differences." In our view, a week on your own repo tells you more.

Customization and MCP integrations

Both read project instructions at the start of a session. Codex uses AGENTS.md, layered from global to project to subfolder, capped at 32 KiB by default. Claude Code uses CLAUDE.md and can read an existing AGENTS.md instead, so one file can serve both.

Both support skills, subagents, hooks, plugins, and an SDK for building your own workflows.

Both connect to MCP servers over stdio (local) and HTTP (remote). Claude Code can keep project servers in a checked-in .mcp.json. Codex stores servers in config.toml, shared across the ChatGPT desktop app, CLI, and IDE extension. See our MCP and agent tools category.

Safety defaults and sandboxing

Codex runs local commands in an OS-enforced sandbox by default: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows. Network access is off, and writes are limited to the active workspace. It asks before going outside those limits, and /permissions switches to read-only.

Claude Code (v2.1.283 or later) starts terminal and VS Code sessions in auto mode, where a classifier model reviews actions and blocks ones it judges unsafe. In Manual mode it stops and asks before most edits, commands, and network access. Its sandbox, built on an open-source runtime, is off by default. Turn it on with /sandbox on macOS, Linux, or WSL2. On native Windows, commands run unsandboxed.

In our view, Codex's defaults are stricter. Claude Code gets close once you enable /sandbox.

Who should pick which

  • Beginners on a budget: Codex, because there's a free way in. Read what vibe coding is first if the terms are new.
  • Claude subscribers: Claude Code. It's already in your plan.
  • Bedrock, Google Cloud, or Foundry shops: Claude Code.
  • People who want auditable source: Codex.

Also worth a look: Aider, Gemini CLI, and OpenCode. See also Cursor vs Claude Code and Claude Code vs Aider.

Using both together

Keep shared rules in AGENTS.md, which both tools can read. In our view, the useful split is one agent writes and the other reviews: Codex's /review checks uncommitted changes without modifying your working tree. Give each its own Git worktree, and commit before every task.

FAQ

Is Codex free?

Partly. OpenAI's Free plan includes limited Codex access, and its Codex pricing page lists GPT-6 Luna in the desktop app, subject to rollout. Codex on the web is listed from Plus up. For more usage, Go is $8 a month and Plus is $20 (checked Oct 14, 2026).

Does Claude Code have a free tier?

No. Anthropic's pricing table marks Claude Code as unavailable on the Free plan. It's included with Pro ($20 a month, or $17 a month billed annually), Max, Team, and Enterprise. You can also pay per use with an Anthropic Console account at API rates (checked Oct 14, 2026).

Which is better for beginners?

Codex, in our view, because you can try it free and its sandbox keeps the network off by default. Claude Code is a fine start if you already pay for Claude, and its install docs explain how to open a terminal for the first time.

Can I use either inside Cursor?

Yes, both. Claude Code's docs link a dedicated Cursor install for its VS Code extension. Codex's IDE extension lists Cursor alongside VS Code and Windsurf. You can also run either CLI in Cursor's built-in terminal, which suits people who like Cursor's editor but want a separate agent.

Is Codex open source?

The Codex CLI is. Its GitHub repository, openai/codex, is licensed under Apache-2.0, so you can read, modify, and build it yourself. Codex cloud and the ChatGPT desktop app are separate hosted products. Claude Code's GitHub repository is not open source: its licence reserves all rights and points to Anthropic's Commercial Terms. Its sandbox runtime package is open source.

Sources

Vendor pages (fetched Oct 14, 2026):

Pricing and features checked Oct 14, 2026. These products change often. Check each vendor's site for the latest details.