Claude Code vs OpenAI Codex
Both run locally, read a repo instruction file, remember you and start at $20. What still separates them is the model, the defaults and the cloud extras.
Choosing between Codex and Claude Code?
Lock in the right Claude tier first so budget and throughput remain predictable after migration.
Check Claude tiersTwo agentic coding tools from the two biggest AI labs. Both read your codebase, write code, and run commands on your machine. A year ago the split was local against cloud. That split is gone: OpenAI's own README now says the Codex CLI "runs locally on your computer."
OpenAI Codex (the agent, not the old completion model) launched in 2025. Today it ships as a CLI, an IDE extension, a desktop app, and Codex cloud, and it comes with every ChatGPT plan. Facts on this page were checked against OpenAI's docs on 2026-09-27.
Codex runs the same request (codex "run the test suite") on the same machine with the same result, inside its sandbox by default, so the difference is in the defaults.
Side-by-side
| Claude Code | OpenAI Codex | |
|---|---|---|
| Where it runs | Terminal, IDE, desktop app (local) | CLI, IDE extension, desktop app (local), plus Codex cloud |
| Models | Opus 5.5 (default), Sonnet 5.5, Haiku 5.5 | GPT-6 Astra, Sol, Luna (GPT-5.5 leaves Codex on October 14, 2026) |
| File access | Local filesystem, with permission prompts | Local filesystem inside an OS-level sandbox, with approval to go beyond it |
| Repo instructions | CLAUDE.md (checked into repo) | AGENTS.md (checked into repo) |
| Extensibility | Hooks, skills, MCP, subagents | Hooks, skills, MCP, subagents |
| Memory | Persistent across sessions | Local memories in ~/.codex/memories |
| Pricing | Pro $20/mo, Max from $100/mo, or API | Free and Go ($8/mo) with limits, Plus $20/mo, Pro from $100/mo, or API key |
| Open source | Source-available (not OSS-licensed) | Yes (CLI is Apache-2.0) |
Look at the middle rows. On configuration, extensibility and memory, the two tools have converged. Any comparison that still says Codex "starts fresh every time" or has no repo config file is describing the 2025 launch, not the product you'd install today.
Where Claude Code wins
The models. This is the real reason to pick Claude Code in 2026. If you prefer how Claude reasons, the tool is how you get it into your repo. Our rule for picking inside the family: Opus for decisions, Sonnet for execution, with /effort to set how hard each one thinks.
A setup you already built. If you've invested in CLAUDE.md files, hooks, skills and memory, that investment is Claude-shaped. Codex has the same building blocks under different names, so you'd be porting, not starting over, but porting still costs a week.
This guide. Everything on this site assumes Claude Code. That's a bias worth naming, and it's also practical: the patterns here transfer directly.
Where Codex wins
A cheaper way in. Codex comes with ChatGPT Free and Go ($8/month), limited to GPT-6 Luna in the desktop app. Claude Code needs Pro or a paid API account; the free Claude plan doesn't include it. If you want to try an agent before paying $20, Codex lets you.
Cloud extras on the $20 plan. Plus includes Codex on the web and on iOS, plus automatic code review and a Slack integration. You can hand off tasks to Codex cloud and run several in parallel while your laptop does something else.
Sandbox by default. When Codex runs commands locally, OpenAI's docs say they run "inside a constrained environment instead of running with full access by default." The sandbox covers spawned commands like git and test runners, not only file edits. Claude Code leans on permission prompts instead. If you want the boundary enforced by the OS rather than by your attention, Codex's default is stricter.
One subscription. ChatGPT and Codex share one plan and one usage pool. If your team already pays for ChatGPT, you already have Codex.
Open-source CLI. The Codex CLI is Apache-2.0. You can read it, fork it, and audit it.
The real difference now
It used to be local against cloud. Now both run locally, and the difference is defaults.
Codex draws a sandbox around your machine and asks when it needs to cross it. Claude Code asks you action by action, through its permission modes. Codex bundles cloud tasks, code review and Slack into the ChatGPT plan. Claude Code keeps the focus on the session in front of you. And each one delivers its own lab's models, which is the part neither can copy.
Can you use both?
More easily than a year ago. Both read a checked-in instruction file (CLAUDE.md and AGENTS.md), both support skills, hooks, MCP and subagents, so a team can keep both files in the repo and let each developer choose. If you already pay for ChatGPT Plus, you already have Codex: try it on a real project for a week before buying a second subscription.
Recommendation
Both start at $20 a month, so price won't decide this. Pick on the model you trust for your hardest calls, and on the defaults you prefer.
Choose Claude Code if Claude's models are the ones you want deciding your architecture and debugging, or if you've already built a Claude setup. Choose Codex if you're already on ChatGPT, want a free or $8 way in, or want OS-level sandboxing and cloud tasks out of the box.
Ship your first project with v0
Use Vercel v0 to turn your Claude Code output into a deployed app in minutes. AI-generated UI meets one-click deploy.
Build UI fast with v0Plan sorted? Now deploy what you build
Railway gives you one-click deploys from GitHub with a generous free tier. Ship your first Claude Code project in minutes.
Deploy your first app on RailwayNew guides, when they ship
One email, roughly weekly. CLAUDE.md templates, workflows I actually use, and the cut-for-length stuff that does not make the public guides. One-click unsubscribe.
Or read Product Field Notes, the Substack
