Claude Code and OpenAI Codex are the agentic coding tools from the two leading AI labs, and they are remarkably similar in shape. Both read your codebase, edit files, run commands and work across many surfaces: Claude Code in the terminal, VS Code and Cursor, JetBrains IDEs, the Claude desktop app, web and mobile; Codex as an open-source CLI, an IDE extension, a desktop app, Codex Cloud and inside ChatGPT. Both take project instructions from a file in the repository, CLAUDE.md or AGENTS.md, and both support MCP, skills and plugins.
The differences are in the details: Codex's CLI is open source under Apache 2.0 and makes its sandbox and approval rules explicit, while Claude Code leans on hooks and deep customisation. They are also bundled with different subscriptions, so the one you already pay for often decides it.
In practice, Codex's defaults are cautious: in a git repository it can edit files and run commands inside the workspace but must ask before going outside it or using the network. Claude Code can be piped logs and run non-interactively with claude -p, which makes it easy to drop into scripts and CI.
How they compare
| Aspect | Claude Code | OpenAI Codex |
|---|---|---|
| Maker and models | Anthropic, using Claude models. | OpenAI, using GPT models. |
| Surfaces | Terminal, VS Code and Cursor, JetBrains, desktop, web and mobile. | Open-source CLI, IDE extension, desktop app, Codex Cloud and ChatGPT. |
| Open source | Not open source. | Codex CLI is Apache 2.0 with well over 100,000 GitHub stars. |
| Safety controls | Permission settings and sandboxing you configure. | Explicit sandbox modes and approval policies; network off by default. |
| Project instructions | CLAUDE.md, skills, hooks and plugins. | AGENTS.md, rules, subagents, skills and plugins. |
| Pricing | Included with Claude Pro ($20), Max ($100) and Ultra ($200); not on the free plan. | Included in every ChatGPT plan, from Free and Go ($8) to Plus ($20) and Pro (from $100). |
| API use | Pay-as-you-go through an Anthropic Console account. | Use with an API key at standard API rates. |
Price at a glance
| Plan detail | Claude Code | OpenAI Codex |
|---|---|---|
| Free option | Paid only | Ongoing free plan |
| How paid plans charge | Flat subscription | Flat subscription |
| Cheapest paid plan | $20 a month per account | $8 a month per account |
- Claude Code$20
- OpenAI Codex$8
Entry plans differ in what they include, so read the full pricing in the Claude Code and OpenAI Codex reviews. From the same data as our AI tool pricing overview, checked November 2026.
Choose Claude Code if…
- You prefer Claude models for coding
- You want hooks and deep workflow customisation
- You want JetBrains support and mobile access
- You already pay for a Claude plan
Choose OpenAI Codex if…
- You want an open-source CLI you can inspect
- You want clear, built-in sandbox and approval controls
- You already pay for ChatGPT, including the free or Go plans
- You want to try an agent without a paid subscription
Researched November 2026 from each product's official documentation and pricing pages. Prices and features change often, so check the vendors' sites before you decide.
Sources
- code.claude.com /docs/en/overview
- claude.com /pricing
- github.com /openai/codex
- learn.chatgpt.com /codex/pricing
- learn.chatgpt.com /codex/agent-approvals-security