Both tools cost $20/mo at the entry tier. They meter usage in completely different units. Claude Code gives you a 5-hour rolling session window plus a weekly cap measured in active model hours. Codex gives you a 5-hour window measured in messages (15 to 80 local messages on Plus) plus separate cloud-task and code-review allowances.
That difference decides which plan you should buy. If you code in long uninterrupted sessions, Claude Code's hour-based caps run out differently than Codex's message-based caps. If you fan out cloud tasks and PR reviews, Codex meters those separately from your local chat.
This page is the plan-decision guide: exact 5-hour windows, weekly limits, credit rates, and which subscription matches your usage. For the head-to-head capability benchmark (SWE-bench, Terminal-Bench, subagent architecture), see the Codex vs Claude Code comparison.
Which Plan Should You Buy?
Skip to the answer. Both tools start at $20/mo. The right plan depends on how heavily you use it and whether your work is interactive sessions or fanned-out cloud tasks.
| Your usage | Best plan | Cost | Why |
|---|---|---|---|
| Light, a few hours/week | Claude Pro or ChatGPT Plus | $20/mo | Both entry tiers cover light daily coding |
| Long continuous coding sessions | Claude Code on Pro/Max | $20-$100/mo | Hour-based caps suit uninterrupted work |
| Many parallel cloud tasks + PR reviews | Codex on Plus/Pro | $20-$100/mo | Cloud tasks and reviews metered separately |
| Heavy daily use, one tool | Claude Max 5x or Codex Pro 5x | $100/mo | 5x token budget over the entry tier |
| Maximum throughput | Claude Max 20x or Codex Pro 20x | $200/mo | Highest limits, 300-1600 Codex msgs/window |
| Pay only for what you run | API key on either | Per-token | No cloud features in API-key mode |
The one-line answer
How Each Tool Meters Usage
The unit of metering is the single most important difference for picking a plan. They are not comparable one to one.
| Dimension | Claude Code | OpenAI Codex |
|---|---|---|
| Short-term window | 5-hour rolling, measured in active model hours | 5-hour rolling, measured in messages |
| Window start | At your first message | At your first message; Plus and Pro share one combined window across local + cloud |
| Long-term cap | Weekly limit over 7 days, all models | No fixed weekly cap; per-window message and credit budget |
| Shared across surfaces | claude.ai, Claude Desktop, and Claude Code on one subscription | Local CLI/IDE + cloud tasks share the 5-hour window |
| Where to check usage | Progress bars under Settings then Usage | Per-window message and credit counters |
The 5-Hour Window, Explained
Both tools use a 5-hour rolling window that starts at your first message of a session, not at a fixed clock time. What fills the window is where they diverge.
Claude Code: active model hours
Claude Code counts "active hours," the time models spend processing, not wall-clock time. A 5-hour window can cover far more than 5 clock hours if you are reading, thinking, and typing between runs. The same window is shared across claude.ai, Claude Desktop, and Claude Code on one subscription. A weekly limit over a rolling 7 days sits on top of the per-window cap and covers all models.
Codex: messages, cloud tasks, code reviews
Codex counts discrete units per 5-hour window. On ChatGPT Plus that is 15 to 80 local messages, 5 cloud tasks, and 5 code reviews. Plus and Pro share one combined 5-hour window across local and cloud usage, so a heavy cloud run eats into your local message budget for that window.
Codex Local Messages per 5-Hour Window
Higher is more headroom before you hit the cap. ChatGPT plan tiers.
Ranges are per 5-hour window. GPT-5.5 usage averages 5-45 credits per message. Source: OpenAI Codex pricing.
Claude Code Weekly Caps by Plan
Claude Code adds a weekly limit on top of the 5-hour window. Anthropic publishes ranges (reported below) measured in active Sonnet hours, with separate, smaller Opus allowances on the top tier.
| Plan | Price | Sonnet hours/week | Opus |
|---|---|---|---|
| Pro | $20/mo ($17/mo annual) | ~40-80 hours | Limited |
| Max 5x | $100/mo | ~140-280 hours | Higher allowance |
| Max 20x | $200/mo | ~240-480 hours | Up to ~40 Opus hours |
"Active hours" means time models are processing, not wall-clock time. Ranges are Anthropic-published guidance as reported; your mileage depends on model choice and task length.
Free plan does not include Claude Code
Codex Messages, Cloud Tasks, and Credit Rates
Codex meters in messages per window, then converts model usage into credits. Plus and Pro users who hit limits can buy additional credits.
| ChatGPT plan | Price | Local messages | Cloud / reviews |
|---|---|---|---|
| Plus | $20/mo | 15-80 | 5 cloud tasks, 5 code reviews |
| Pro 5x | $100/mo | 80-400 | Higher |
| Pro 20x | $200/mo | 300-1600 | Highest |
| Business | Pay-as-you-go | Plus-level limits | Pay-as-you-go |
| Enterprise / Edu | Flexible | No fixed rate limits | Flexible |
Codex credit rates per 1M tokens
| Model | Input | Cached | Output |
|---|---|---|---|
| GPT-5.5 | 125 | 12.5 | 750 |
| GPT-5.4 | 62.5 | 6.25 | 375 |
| GPT-5.4-mini | 18.75 | 1.875 | 113 |
| GPT-5.3-Codex | 43.75 | 4.375 | 350 |
GPT-5.5 usage averages 5-45 credits per message. Codex CLI switches models via the /model command (GPT-5.4, GPT-5.3-Codex, adjustable reasoning levels); Pro plans get the GPT-5.3-Codex-Spark research preview. Source: OpenAI Codex pricing and CLI docs.
Plan-by-Plan Pricing
| Tier | Claude Code (via Claude) | Codex (via ChatGPT) |
|---|---|---|
| Free | Not included on free Claude.ai | ChatGPT Free $0 (limited) |
| Entry paid | Pro $20/mo ($17/mo annual) | Plus $20/mo (Go $8/mo cheaper tier) |
| Heavy | Max from $100/mo | Pro 5x from $100/mo |
| Maximum | Max 20x $200/mo | Pro 20x $200/mo |
| Pay-per-token | Console (API) account | OpenAI API key (no cloud features) |
The ChatGPT Pro $100 tier launched April 9, 2026 as a new middle option, with Pro $200 remaining the ceiling. See the full Morph pricing if you want to run open-source models yourself instead of paying frontier subscription rates.
Install and Sign In
Claude Code
Native install (recommended). macOS, Linux, and WSL:
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell:
irm https://claude.ai/install.ps1 | iexAlso available via brew install --cask claude-code, winget install Anthropic.ClaudeCode, npm install -g @anthropic-ai/claude-code (Node 18+), and signed apt/dnf/apk repos. Native installs auto-update in the background; the stable channel runs about one week behind latest. Requirements: macOS 13.0+, Windows 10 1809+, Ubuntu 20.04+ (Debian 10+, Alpine 3.19+), 4GB+ RAM. A Desktop GUI app exists for macOS and Windows.
OpenAI Codex
Mac and Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"Also npm install -g @openai/codex or brew install --cask codex. Run codex and choose "Sign in with ChatGPT." Codex surfaces include the CLI, an IDE extension (VS Code, Cursor, Windsurf), Codex Web at chatgpt.com/codex, a desktop app (codex app), and iOS. Cloud integrations add automatic code review and Slack.
MCP support
Both support Model Context Protocol servers. Claude Code adds them with:
claude mcp add --transport http notion https://mcp.notion.com/mcpClaude Code supports http, sse (deprecated), and stdio transports, with JSON config via .mcp.json, ~/.claude.json, or claude mcp add-json. Codex configures MCP servers and switches models with its own /model command.
If You Run Models Yourself Instead
Subscription caps exist because frontier models are expensive to serve. If your workflow is API-driven or you want to run open-source models without a 5-hour window or a weekly cap, the variable that matters is per-token cost and output fidelity.
Morph Open Source Models is the best place to run DeepSeek and the best for codegen specifically. Morph serves DeepSeek with 16-bit (bf16) activations and no fp8/int8 quantization. Most serverless providers quantize activations to fp8 to cut cost, which degrades output quality; keeping full 16-bit activations means responses match the reference weights, so it is the best option when output fidelity matters. For coding agents, Morph runs codegen-specific speculative decoding (draft and ngram tuned on code) plus custom low-level inference kernels, which makes it the fastest and highest-quality option for code generation rather than a general-purpose menu.
| Option | Input / 1M | Output / 1M | Notes |
|---|---|---|---|
| morph-dsv4flash (DeepSeek V4 Flash) | $0.139 | $0.278 | 16-bit activations, codegen-tuned |
| Codex GPT-5.5 (credit-based) | 125 credits | 750 credits | Per 5-hour window message budget |
| Claude Opus 4.8 (API) | $5.00 | $25.00 | Fast mode $10/$50 at 2.5x speed |
See Morph models and pricing for the full list. morph-v3-fast serves at roughly 10,500 tok/s.
Decision Framework
| Your situation | Buy this | Reason |
|---|---|---|
| Solo dev, a few hours a day | Claude Pro $20 or ChatGPT Plus $20 | Entry tier covers light daily coding either way |
| Long continuous pairing sessions | Claude Code (Pro then Max) | Caps measured in active model hours fit uninterrupted work |
| Background cloud tasks + automated PR review | Codex (Plus then Pro) | Cloud tasks and reviews are metered separately from local messages |
| Need the cheapest paid Codex tier | ChatGPT Go $8/mo | Lowest Codex entry price below Plus |
| Hit the cap mid-task often | Move up a tier or buy credits | Max 5x / Pro 5x at $100, or buy extra Codex credits |
| No usage window at all | API key, or run open models on Morph | Per-token billing, no 5-hour or weekly cap |
Frequently Asked Questions
What is the 5-hour limit in Claude Code and Codex?
Both use a 5-hour rolling window that starts at your first message. Claude Code measures it in active model hours and shares it across claude.ai, Claude Desktop, and Claude Code on one subscription, then caps you again with a weekly limit over 7 days. Codex measures it in messages: ChatGPT Plus gets 15-80 local messages, 5 cloud tasks, and 5 code reviews per window, and Plus and Pro share one combined window across local and cloud usage.
Which plan should I buy for Claude Code vs Codex?
Both start at $20/mo: Claude Pro includes Claude Code, ChatGPT Plus includes Codex. Claude Pro gives roughly 40-80 Sonnet hours per week. ChatGPT Plus gives 15-80 local Codex messages per 5-hour window. For heavy use, Claude Max 5x ($100/mo, about 140-280 Sonnet hours/week) or Codex Pro 5x ($100/mo, 80-400 local messages/window). Pick Claude Code for long continuous sessions, Codex for fanned-out cloud tasks and reviews.
Does the free Claude.ai plan include Claude Code?
No. Claude Code requires Pro, Max, Team, Enterprise, or a Console (API) account. Claude Pro is $20/mo monthly or $17/mo billed annually ($200 up front) and explicitly includes Claude Code. Codex similarly requires ChatGPT Plus, Pro, Business, Edu, or Enterprise to sign in with ChatGPT.
How many messages do you get with Codex per 5-hour window?
ChatGPT Plus ($20/mo) gives 15-80 local messages, 5 cloud tasks, and 5 code reviews per window. Codex Pro 5x gives 80-400 local messages; Pro 20x gives 300-1600. GPT-5.5 usage averages 5-45 credits per message, and Plus or Pro users who hit limits can buy additional credits.
What does Claude Code cost per month compared to Codex?
Entry tier is $20/mo for both. Claude Max starts from $100/mo; Codex maps to ChatGPT Pro from $100/mo (5x and 20x). Codex also has cheaper ChatGPT tiers (Free $0, Go $8/mo) at lower limits. Both support API-key billing at per-token rates, with no cloud features in API-key mode.
Is Codex or Claude Code better on benchmarks?
On Terminal-Bench 2.1, Codex CLI with GPT-5.5 leads at 83.4%, and Claude Code with Opus 4.8 follows at 78.9%. On SWE-bench Verified (self-reported), Claude Opus 4.8 is at 88.6%. This page is the plan and limits guide; for the full benchmark and subagent-architecture breakdown, read the Codex vs Claude Code comparison.
Run DeepSeek and Open Models Without a Usage Window
Morph serves DeepSeek with full 16-bit activations and codegen-tuned speculative decoding. morph-dsv4flash is $0.139/1M input and $0.278/1M output, billed per token with no 5-hour or weekly cap. WarpGrep, the agentic code search tool, is free to 100k requests and improves any coding agent's context.
