Claude Code vs Codex: terminal coding agents compared
Updated By Agent Radar7 min read
Short answer
Claude Code vs Codex CLI compared from docs and repos: license, install, plans and API keys, instruction files, CI use and where each one runs.
Top pick: Claude Code. Anthropic's agentic coding tool. It runs in the terminal, IDE extensions, a desktop app and the browser, and reads a CLAUDE.md file (or an existing AGENTS.md) at the start of each session.
Claude Code and Codex CLI do the same job: an agent in your terminal that reads a repository, edits files and runs commands. The practical differences are licensing, which model family you are tied to, how you pay, and how far each reaches beyond the terminal. Checked on 2026-10-30 against Claude Code 2.1.314 (released October 30) and Codex CLI 0.166.0 (October 29).
Quick comparison
| Claude Code | Codex CLI | |
|---|---|---|
| Maker | Anthropic | OpenAI |
| Source | No recognized license per GitHub API | Apache-2.0, mostly Rust |
| Latest release (checked 2026-10-30) | 2.1.314, Oct 30 | 0.166.0, Oct 29 |
| GitHub stars | ~154k | ~132k |
| Install | Native script, Homebrew cask, WinGet (npm deprecated) | Install script, npm @openai/codex, Homebrew cask |
| Instruction file | CLAUDE.md, or an existing AGENTS.md | AGENTS.md |
| Non-interactive | claude -p | codex exec |
| Other surfaces | VS Code, JetBrains, desktop app, web, iOS and Android | IDE extension, desktop app (codex app), Codex Web |
| Cheapest plan that includes it | Claude Pro, $17/month billed annually or $20 monthly | ChatGPT Plus, $20/month |
| Pay per token instead | Anthropic Console account | OpenAI API key |
Ranks in the item list are alphabetical, not a verdict.
Verdict
Pick Codex CLI if you want open source code you can audit or patch, or if your team already pays for ChatGPT. Pick Claude Code if you want one agent across terminal, JetBrains, desktop and browser, or if you need scheduled cloud runs and coordinated parallel agents. If you already have a strong preference for Claude or GPT models, that settles it: each tool is built around its maker's models.
Where each one runs
Claude Code's docs describe four surfaces: the terminal CLI, IDE extensions for VS Code and JetBrains, a desktop app and the web. The web version needs no local setup, runs long tasks and parallel sessions, and is also in the Claude mobile apps. The desktop app includes Claude Code, so you do not need the CLI separately, but it needs a paid plan.
The Codex README centres on the CLI and points elsewhere for the rest: an IDE extension for VS Code, Cursor and Windsurf, a desktop app started with codex app, and the cloud agent Codex Web at chatgpt.com/codex. All of them draw on the same ChatGPT plan allowance when you sign in with ChatGPT.
Plans, API keys and limits
Claude Code. The free Claude plan does not include Claude Code; Pro does, at $17 per month billed annually or $20 billed monthly. Max starts from $100 per month with 5x or 20x Pro usage. Team standard seats are $20 per seat per month billed annually, $25 monthly. Without a plan, you can use an Anthropic Console account, and the docs say the CLI, VS Code and JetBrains also accept third-party providers.
Codex. ChatGPT Plus at $20 per month includes Codex on the web, in the CLI, the IDE extension and on iOS. Pro plans are $100, $200 or $500 per month. The Free and Go plans get GPT-6 Luna in the desktop app only, subject to rollout. With an API key, the CLI, SDK and IDE extension bill at API rates, but cloud features such as GitHub code review and Slack are not available.
On limits, OpenAI publishes estimated local messages per five-hour window per model for Plus and Business, adds that weekly limits may apply, and says Pro currently has no five-hour limit. Anthropic describes plan usage only relative to Pro. Neither publishes a fixed task count, so compare on your own workload before committing to a higher tier.
Project instructions and extensions
Codex reads AGENTS.md for project guidance. Claude Code reads CLAUDE.md at the start of each session and can read an existing AGENTS.md instead, which lets a repository serve both tools from one file. Both connect to MCP servers. Claude Code adds skills, hooks and plugins; the Codex docs list skills, hooks and subagents.
Automation and CI
Claude Code runs headless with claude -p, for example piping a log into it, and the docs list GitHub Actions and GitLab CI/CD for code review and issue triage. Cloud scheduled tasks run on Anthropic's side even when your computer is off and can trigger on API calls or GitHub events.
Codex has codex exec for non-interactive runs, a Codex GitHub Action and a Codex SDK for controlling local agents from code. OpenAI's pricing page recommends API key sign-in for shared environments such as CI.
Release pace
Both ship often. Claude Code had releases on October 26, 27 and 30. Codex shipped stable 0.165.0 on October 27 and 0.166.0 on October 29, with alpha builds on npm in between; see Codex CLI 0.166.0 for what the latest one changed. Pin versions in CI for either tool.
Who should not use either
If you need an agent that runs on any model, including local ones, neither is the best fit: look at OpenCode or Aider. If you want a fully managed agent that works in its own cloud machines, see Devin vs Claude Code.
How we compared
We read the anthropics/claude-code and openai/codex READMEs and GitHub metadata, the Claude Code docs overview, the Claude pricing page and the Codex pricing page on 2026-10-30. Stars are rounded GitHub API counts. We did not benchmark the two agents on the same tasks, so nothing here ranks their code quality.
Limitations
Prices are as listed on the vendors' pages on 2026-10-30 in US dollars and change often. Model names and limits per plan were not compared in depth, because both vendors change them faster than this page can track.
Related: Claude Code hub, Codex CLI hub, coding agents category, Aider vs Claude Code, Qwen Code vs Cline and OpenCode vs Cline vs Aider.
The tools
- Rank 1
Claude Code
Anthropic's agentic coding tool. It runs in the terminal, IDE extensions, a desktop app and the browser, and reads a CLAUDE.md file (or an existing AGENTS.md) at the start of each session.
Pros
- Same agent across terminal, VS Code, JetBrains, desktop and web
- Subagents and background agents for parallel work
- Cloud scheduled tasks keep running with your computer off
Cons
- GitHub API reports no recognized license; the source is not open
- Not included in the free Claude plan
OpenAI's local coding agent, Apache-2.0 and written mostly in Rust. It reads AGENTS.md for project guidance and shares a usage allowance with the Codex desktop app, IDE extension and cloud tasks.
Pros
- Apache-2.0 source you can read, fork and build
- Included from the ChatGPT Plus plan up, or usable with an API key
- Stable builds every few days (0.165.0 and 0.166.0 two days apart)
Cons
- API key sign-in has no cloud features such as GitHub code review or Slack
- Fast release pace means frequent behaviour changes to track
Questions
What is the main difference between Claude Code and Codex?
Both are coding agents that run in your terminal and edit a local repository. Codex CLI is open source under Apache-2.0 and runs on OpenAI models through a ChatGPT plan or an API key. Claude Code is closed source, runs on Claude models through a Claude plan or Anthropic Console account, and its CLI and IDE plugins also support third-party providers.
Which is cheaper, Claude Code or Codex?
Entry prices are close. Claude Pro, the first Claude plan that includes Claude Code, is $17 per month billed annually or $20 billed monthly. ChatGPT Plus, which includes Codex in the CLI, is $20 per month. Both have higher tiers from $100 per month, and both can bill per token through an API key instead.
How do Claude Code and Codex usage limits work?
Codex shares one allowance across local messages and cloud chats. Its pricing page gives estimated local messages per five-hour period by model for Plus and Business, says weekly limits may also apply, and says Pro plans currently have no five-hour limit. Claude's pricing page describes usage per plan as relative amounts (Max 5x and 20x of Pro) rather than message counts.
Can both read the same AGENTS.md file?
Yes. Codex takes custom instructions from AGENTS.md. Claude Code reads CLAUDE.md, and its docs say it can read an existing AGENTS.md in place of a CLAUDE.md, so one file can serve both.
Can I run Claude Code or Codex in CI?
Yes. Claude Code docs show non-interactive use with claude -p and list GitHub Actions and GitLab CI/CD for review and triage. Codex has codex exec for non-interactive runs and a Codex GitHub Action, and its pricing page suggests API key sign-in for CI.