Home / Guides / Claude Code vs Codex
Claude Code vs Codex in 2026: limits, pricing and workflow compared
Quick answer: both start at $20 a month and both meter you with a 5-hour window and a weekly limit, so price alone will not decide it. Claude Code is closed source, needs a paid Claude plan or API account, and has a large hook system plus a scriptable status line. Codex CLI is open source (Apache-2.0), has limited trial access even on ChatGPT Free and Go, and uses AGENTS.md for project instructions. Pick by the models you prefer and the workflow you want; many people run both.
What are Claude Code and Codex?
Both are coding agents that read your project, edit files and run commands for you. Anthropic describes Claude Code as "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools", available in the terminal, IDE, desktop app and browser. OpenAI's README describes Codex CLI as "a coding agent from OpenAI that runs locally on your computer", with an IDE extension, a desktop app and a cloud agent called Codex Web.
When people search "codex cli vs claude code" they usually mean the terminal tools. Both companies now ship the same agent across several surfaces, and your subscription covers all of them, so this guide compares the whole product and calls out the CLI where it matters.
How do they compare side by side?
Everything in this table comes from Anthropic and OpenAI pages fetched on 23 Sep 2026. Prices and limits change often, so check the linked pages before you buy.
| Claude Code | Codex | |
|---|---|---|
| Plans and prices | Not on Free. Pro $20 a month ($17 a month billed annually), Max from $100 a month (5x or 20x Pro usage), Team standard seat $25 ($20 annual), premium seat $125 ($100 annual), Enterprise $20 a seat plus usage at API rates | Limited trial on Free ($0) and Go ($8). Plus $20 a month, Pro from $100 a month (5x Plus usage), Business and Enterprise plans. Or an API key, billed by usage |
| How limits work | A five-hour session limit and weekly limits, shared with claude.ai and Claude Desktop | 5-hour and weekly usage windows; local messages and cloud chats share the allowance. Whether the 5-hour window is on depends on your plan |
| Published allowance | Relative only (Max is 5x or 20x Pro) | Ranges of local messages per model and plan on the pricing page |
| Where to check usage | /usage in Claude Code, Settings > Usage on claude.ai, rate_limits in status line data (Pro and Max) | /status in the CLI, the Codex usage dashboard, Settings in the Codex clients |
| Models | Opus 5.5 by default on Pro, Max, Team and Enterprise; Sonnet 5, Haiku and Fable 5.1 by alias | GPT-6 Astra, GPT-6 Sol and GPT-6 Luna recommended; GPT-5.6, GPT-5.5 and GPT-5.4 also listed |
| Surfaces | Terminal (macOS, Linux, WSL, Windows), VS Code and Cursor, JetBrains, desktop app, web, iOS and Android | CLI (macOS, Linux, Windows installer), IDE extension for VS Code, Cursor and Windsurf, desktop app, Codex Web |
| Hooks | Yes, over 30 events such as PreToolUse, PermissionRequest and Stop, set in settings.json | Yes, 12 events such as PreToolUse, PermissionRequest and Stop, set in hooks.json or config.toml; on by default |
| Status line | Runs your own script and passes it session JSON, including plan limits | Built-in footer items chosen with tui.status_line; a notify command receives a JSON payload |
| Project instructions | CLAUDE.md, and it can read AGENTS.md | AGENTS.md (created with /init) |
| Open source | No. The public repo's license reads "All rights reserved" under Anthropic's Commercial Terms | Yes, Apache-2.0 |
What do they cost?
At the entry level they match. Claude Pro is $20 a month, or $17 a month when you pay $200 for the year. ChatGPT Plus is $20 a month, and OpenAI's Codex pricing page describes it as enough to "power a few focused coding sessions each week".
The top individual tiers also start in the same place. Anthropic lists Max "from $100" with "5x or 20x more usage than Pro". OpenAI lists Pro "from $100" with "5x more usage than Plus", and its usage table has separate Pro 5x and Pro 20x columns. On 23 Sep 2026 the OpenAI Help Center also showed a banner that new sign-ups and upgrades to the Pro $200 plan are temporarily paused.
The difference is at the bottom. Codex is included on ChatGPT Free and Go as limited trial access, so you can try it without paying. Anthropic's pricing page does not include Claude Code on the Free plan. Both tools also accept pay-as-you-go API billing instead of a subscription: an Anthropic Console account for Claude Code, an OpenAI API key for Codex.
How do the usage limits work?
The shape is the same: a short window that caps a burst of work, and a weekly limit that caps the total. You can be stopped by either one.
Claude Code. On Pro, Max, Team and seat-based Enterprise plans, Anthropic meters a five-hour session limit and weekly limits, and the allowance is shared: claude.ai, Claude Code and Claude Desktop all count towards the same limit. Anthropic does not publish a message count; it describes Max relative to Pro. When you hit a limit you can wait, upgrade, or buy usage credits, billed at standard API rates.
Codex. OpenAI refers to "5-hour and weekly Codex usage windows", says local messages and cloud chats share your allowance, and notes that "weekly limits may also apply". Its pricing page gives ranges rather than one number; on Plus, for example, 15 to 150 local messages for GPT-6 Sol and 350 to 3,000 for GPT-6 Luna, with Pro 20x at roughly 20 times those figures. The 5-hour window has changed during 2026: it returned for Plus on 25 August, while OpenAI's Codex lead said it would stay off "for the upcoming months" on Pro $100 and Pro $200.
Because Claude publishes only relative sizes and Codex publishes wide ranges, there is no fair way to say which gives more work per dollar. The full detail on checking both is in how to check your Claude Code and Codex usage limits.
How do they differ day to day?
- Models. Claude Code defaults to Opus 5.5 on paid plans and lets you switch with
/modelto Sonnet, Haiku or Fable, or useopusplanto plan with Opus and build with Sonnet. Codex recommends GPT-6 Astra for complex work, GPT-6 Sol for coding and agentic workflows, and GPT-6 Luna for high-volume tasks. - Approvals. Codex sets what it may do without asking through
/permissions. Claude Code has permission settings and aPermissionRequesthook, so a script can react when it stops for approval. - Hooks and scripting. Both now run your scripts at points in the agent loop. Claude Code's list is longer, covering events like file changes, worktrees and compaction; Codex covers the core session, tool, prompt, subagent and stop events.
- Status line. Claude Code runs a script you write and hands it JSON that includes
rate_limits.five_hourandrate_limits.seven_dayfor Pro and Max. Codex lets you pick and order built-in footer items. - Source. You can read, fork and build Codex CLI under Apache-2.0. Claude Code's GitHub repo holds plugins, examples and issues, but the tool itself is proprietary.
Which one suits whom?
- You already pay for ChatGPT. Codex is included, so start there before adding a second subscription.
- You already pay for Claude. Claude Code comes with Pro and above, and the same allowance covers your chats.
- You want to try before paying. Codex has limited trial access on Free and Go; Claude Code needs Pro or API credit.
- You need to audit or modify the agent itself. Codex CLI is open source; Claude Code is not.
- You automate heavily around the agent. Both have hooks. Claude Code has more events and a status line that gets your plan limits as data, which suits custom tooling.
- You work mostly in JetBrains IDEs. Claude Code has a JetBrains plugin. OpenAI's help center suggests running the Codex CLI in the IDE's terminal for editors other than VS Code forks.
- You care most about the model. This is the real decision for most people, and it is personal. Run the same task through both for a week and keep the one whose output you edit least.
Can you use both?
Yes, and a lot of people do: one for its model, the other when the first runs out for the day. The catch is two sets of meters and more terminal tabs. Vibepanions, a macOS 14+ app, shows the 5-hour and weekly limits for both side by side with reset times (Claude's reported through the status line when available, otherwise estimated and labelled; Codex's read from its session files), and shows which terminal session is waiting for approval. It reads only local files, costs SGD 7.99 once, with a 14-day refund.
FAQ
Is Codex CLI free?
The Codex CLI code is free and open source under Apache-2.0, and OpenAI says Codex is included across ChatGPT plans, including Free and Go. On Free and Go it is limited trial access; Plus at $20 a month is the first plan the pricing page describes as expanded Codex usage. You can also use it with an API key, billed by usage.
Can I use Claude Code on the free Claude plan?
No. Anthropic's pricing page lists Claude Code on Pro and above, not on Free. You can also sign in with an Anthropic Console account and pay API rates instead of a subscription.
Do Claude Code and Codex share limits with the chat apps?
Yes, both do in some way. Anthropic says claude.ai, Claude Code and Claude Desktop count towards the same usage limit. OpenAI says local Codex messages and cloud chats share your plan's allowance, and on plans with shared allowances Codex shares a pool with ChatGPT Work.
Can Claude Code and Codex use the same project instructions?
Mostly. Codex uses AGENTS.md, and Claude Code's docs say it can read an existing AGENTS.md on its own or alongside CLAUDE.md. Hooks and settings live in separate places: ~/.claude for Claude Code and ~/.codex for Codex.
Which one has more usage for the money?
Neither company publishes a number you can compare directly. Anthropic describes Max as 5x or 20x more usage than Pro, and OpenAI gives ranges of local messages per model and plan. The honest test is a week of your own work on each, watching the 5-hour and weekly meters.
Running both? Get Vibepanions to see both sets of limits on one screen.
Sources
Fetched 23 Sep 2026. Prices as shown on that date.
- Anthropic, Claude pricing
- Claude Code docs, Overview (surfaces, install, CLAUDE.md and AGENTS.md, hooks)
- Claude Code docs, Model configuration
- Claude Code docs, Hooks reference
- Claude Code docs, Status line (
rate_limitsfields) - Claude Code docs, Commands (
/usage) - Claude Help Center, How do usage and length limits work?
- Claude Help Center, Models, usage, and limits in Claude Code
- Claude Help Center, Manage usage credits for paid Claude plans
- GitHub, anthropics/claude-code LICENSE.md
- OpenAI, Codex pricing
- OpenAI Help Center, Using Codex with your ChatGPT plan
- OpenAI docs, Codex models
- OpenAI docs, Codex hooks
- OpenAI docs, Codex configuration reference (
tui.status_line,notify) - OpenAI docs, Codex CLI (
/permissions) - GitHub, openai/codex README and license
- 9to5Mac, OpenAI restores 5-hour Codex and Work limits for ChatGPT Plus users (24 Aug 2026)