Codex and Claude Code meter usage the same way: a short rolling window plus a weekly cap on a plan, or per-token billing on an API key. Neither lasts longer by default. Both re-send the whole conversation every turn, so session length, tool output and model choice decide which one runs out first.
Codex vs Claude Code at a glance
On billing and limits the two agents are closer than most comparisons suggest. Plans and allowances change often, so check each vendor's pricing page for current figures.
| Codex | Claude Code | |
|---|---|---|
| Vendor | OpenAI | Anthropic |
| Subscription | ChatGPT plans | Claude Pro and Max |
| Pay as you go | OpenAI API key | Anthropic API key |
| Limit shape | Short window plus weekly | 5-hour window plus weekly |
| Main cost knob | Model and reasoning effort | Model (Opus, Sonnet, Haiku) |
| Project instructions | AGENTS.md | CLAUDE.md |
| Check usage | /status | /status, /context, /cost |
| Shrink context | /compact, /new | /compact, /clear |
| Works with condense | Yes | Yes |
How the limits work
Both count compute, not messages. A late-session turn can carry a hundred thousand tokens of input for a reply of a few hundred.
On an API key there is no weekly cap, only per-token billing. See Claude subscription vs API key.
Compare cost per task, not per token
The top and entry tiers sit at similar prices. What matters is how many tasks each finishes, as covered in cost per task vs cost per token.
- 1Pick ten real tasks
Bugs and small features from your backlog, not toy prompts.
- 2Match the settings
Comparable model and effort, same instruction file, same MCP servers.
- 3Record usage before and after
Run
/statusat start and end, or read the API bill. - 4Count finished tasks
A cheap run that needs a human to finish it is not cheap.
Which lasts longer?
It depends on habits more than vendor. These move usage on both, in rough order of impact.
- 1Session length
A fresh session per task with
/clearor/newis the biggest saving. - 2Tool output
Test suites and broad searches ride along every turn. See how to compress tool output.
- 3Model and effort
Heavy settings for planning and hard bugs, lighter ones for routine edits.
- 4Fixed overhead
Trim AGENTS.md, CLAUDE.md and MCP servers.
Running both side by side
Switching agents buys a fresh allowance, not better habits. Two plans only double capacity if both stay lean.
- 1One source of project rules
Keep content in AGENTS.md and point CLAUDE.md at it.
- 2Hand off with a summary
Goal, files touched, what is left. Never paste the whole transcript.
- 3Match MCP servers to the job
Connect browser or database tools only where they are needed.
- 4Measure each one separately
Track
/statusper agent for a week before upgrading or dropping a plan.
Make either agent last longer
condense compresses re-sent history before each request. For Claude Code, install with curl -fsSL https://cli.condense.chat/unix | sh (Windows: irm https://cli.condense.chat/nt | iex) and run dense claude. For Codex, add a provider in ~/.codex/config.toml; the coding agents docs have the config.
dense usage shows Claude plan usage next to what it would have been uncompressed. For Codex, dense info shows tokens before and after.
Frequently asked questions
Is Codex cheaper than Claude Code?
Not by default. The cheaper one is the one that finishes your tasks in fewer tokens, which you only learn by running the same work through both.
Does Codex have a weekly limit like Claude Code?
Yes. Both have a short rolling window and a weekly limit on a plan. Run /status in either agent to see where you stand.
Claude Max vs ChatGPT Pro: which gives more coding?
Neither vendor publishes limits you can compare directly, and both change them. Run the same tasks for a week on each and note when you hit the caps.
Can I use both Codex and Claude Code?
Yes. Put shared rules in AGENTS.md and point CLAUDE.md at it so both agents read the same conventions.
Does condense work with both Codex and Claude Code?
Yes. Claude Code runs through dense claude. Codex uses a provider entry in ~/.codex/config.toml, and ChatGPT-login requests go to the ChatGPT Codex backend.