Claude Code vs OpenAI Codex CLI: Which Terminal Agent Is Right for You?
Claude Code and OpenAI's Codex are the closest rivals on this list: both are coding agents that run in your terminal, read your project, edit files and run commands. Both also extend beyond the terminal — Codex to the web, an IDE extension and iOS; Claude Code to IDE extensions, a desktop app and the web.
The differences come down to models, pricing, openness and how far you can customise each one. Here is an honest side-by-side.
Quick verdict
Choose Codex if you already pay for ChatGPT, want an open-source CLI, or prefer OpenAI's models. Choose Claude Code if you prefer Claude's models and want the richest customisation through subagents, skills, slash commands and hooks.
Choose Codex if…
- You already have a ChatGPT plan — even Free or Go includes Codex
- You want an open-source CLI (Apache-2.0)
- You prefer OpenAI's models
- You want cloud tasks you can start from your phone
Choose Claude Code if…
- You prefer Claude's models for coding
- You want subagents with their own context and tools
- You want skills, slash commands and hooks for workflows
- You already use Claude Pro, Max or Team
Side-by-side comparison
| OpenAI Codex | Claude Code | |
|---|---|---|
| What it is | Coding agent for the terminal, IDE, web and iOS | Coding agent for the terminal, IDEs, desktop and web |
| Models | OpenAI models | Anthropic's Claude models |
| Open source | CLI is open source (Apache-2.0) | No |
| Project instructions | AGENTS.md | CLAUDE.md (or AGENTS.md when there's no CLAUDE.md) |
| Customisation | AGENTS.md, configuration, MCP | CLAUDE.md, subagents, skills, slash commands, hooks, MCP |
| Included with | ChatGPT Free, Go ($8), Plus ($20), Pro (from $100), Business | Claude Pro ($20, or $17 annually), Max ($100), Ultra ($200), Team |
| Pay per use | Yes, with an API key (CLI, SDK, IDE extension) | Yes, with an API key |
How similar are they?
Very. Both start from a terminal, take a task in plain English, explore your codebase, propose and apply edits, and run commands with your approval. Both read a markdown file of project instructions — AGENTS.md for Codex, CLAUDE.md for Claude Code — and both can connect to external tools through MCP.
In day-to-day use the biggest differences are the models behind them and the extra layers each one offers on top.
Pricing and access
Codex has the lower barrier to entry: according to OpenAI's pricing page it is included in every ChatGPT plan, from Free and Go ($8/month) to Plus ($20), Pro (from $100) and Business. You can also use the CLI with an API key and pay per use.
Claude Code needs a paid Claude plan — Pro at $20/month ($17 billed annually), Max at $100, Ultra at $200, or Team — or an API key. If you already pay for one of these assistants, that usually decides which agent is cheapest for you.
Open source vs closed
The Codex CLI is open source under the Apache-2.0 licence, so you can read the code, file issues and contribute. Claude Code is not open source, though its configuration files — CLAUDE.md, subagents, skills and commands — are plain markdown you fully control.
Customisation: where Claude Code goes further
Codex relies mainly on AGENTS.md and configuration. Claude Code adds several layers designed to be combined:
- Subagents that run in their own context window with their own tool limits
- Skills that load step-by-step procedures only when needed
- Custom slash commands for workflows you trigger on demand
- Hooks that run scripts automatically around tool use
Switching between them
Moving a project between the two is easy. Recent versions of Claude Code read AGENTS.md directly when a project has no CLAUDE.md, and if you do want a CLAUDE.md, an @AGENTS.md line inside it pulls in the shared instructions. Claude Code's /import codex command can also bring your Codex configuration on the same machine into Claude Code.
Getting the most from Claude Code
Claude Code's subagent and skill system is its biggest advantage, but only if you have good agents. claudeagents gives you 120+ of them, plus 54 skills and 54 slash commands for coding, SEO and marketing, all reading from one CLAUDE.md.
Frequently asked questions
Is Codex CLI free?
The CLI is open source, and OpenAI's pricing page says Codex is included in ChatGPT plans including Free and Go, with usage limits by plan. You can also pay per use with an API key.
What is the difference between AGENTS.md and CLAUDE.md?
Both are markdown files of project instructions with nearly identical content. Codex reads AGENTS.md. Claude Code reads CLAUDE.md, and in recent versions also reads AGENTS.md when a project has no CLAUDE.md.
Is Claude Code open source?
No. Claude Code itself isn't open source, but everything you customise it with — CLAUDE.md, subagents, skills and commands — is plain markdown in your project.
Which is better for coding, Claude Code or Codex?
It depends on which models you prefer and how much customisation you want. Try both on a real task from your own codebase before deciding.
Get 120+ agents for Claude Code
Coding, SEO and marketing kits, 54 skills and 54 slash commands. $49 one-time, lifetime updates.
See what's included →