Claude Code vs Codex: which coding agent to pick
Codex vs Claude Code in brief: Codex comes with every ChatGPT plan, including Free, and its CLI is open source. Claude Code starts at Claude Pro and runs Anthropic's Claude models. Both read your repo, edit files, run commands and plug into GitHub and Slack.
Codex vs Claude Code is a choice between the two agents the big chat vendors ship for developers. Each one reads a repository, plans a change, edits files, runs commands and can open pull requests. The main differences are which subscription you need, which models run underneath, and where each one can live outside the terminal. This page compares them on facts from Anthropic's and OpenAI's own pages, checked in October 2026.
Short verdict: who should pick which
- You want to try an agent for free: Codex. OpenAI includes Codex, with limited usage, on ChatGPT Free and Go. Claude's free plan does not include Claude Code.
- You want the lowest monthly cost: Codex on ChatGPT Go at $8. Claude Code starts with Claude Pro at $17 a month billed annually or $20 monthly.
- You want to read or change the agent's source: Codex. Its CLI repository is licensed Apache-2.0. Claude Code's repository license reserves all rights to Anthropic.
- You use JetBrains IDEs or Xcode: both work there. Claude Code has its own JetBrains plugin. OpenAI's IDE docs say JetBrains IDEs and Xcode offer Codex through their own integrations, while the Codex extension covers VS Code, Cursor and Windsurf.
- You want the agent in team tools: both reach GitHub and Slack. Claude Code has cloud routines, Slack mentions that return a pull request, GitHub Actions and GitLab CI/CD. Codex has a GitHub Action, GitLab merge request review in beta, and automatic code review and Slack in the cloud from Plus.
- You already pay for one chat plan: use the agent that comes with it. Both plans include a chat app as well.
Feature table, from the vendors' own pages
| Feature (Oct 2026) | Claude Code | Codex |
|---|---|---|
| On the free plan | No | Yes, limited: GPT-6 Luna in the desktop app, subject to rollout |
| Cheapest plan that includes it | Claude Pro, $17/month annual or $20 monthly | ChatGPT Free ($0); Go, $8/month |
| Cloud tasks | Claude Code on the web, cloud routines | Codex Cloud, on Plus, Pro, Business, Enterprise and Edu |
| Models | Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 4.5 | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol, GPT-6 Luna |
| Terminal | Yes, macOS, Linux, WSL, Windows | Yes, macOS, Linux, Windows |
| IDE | VS Code, Cursor, JetBrains | VS Code, Cursor, Windsurf; JetBrains and Xcode through their own integrations |
| Desktop and mobile | Claude desktop app; Claude app on iOS and Android | ChatGPT desktop app; iOS on Plus |
| Team tools | Slack, GitHub Actions, GitLab CI/CD, GitHub Code Review | Automatic code review and Slack on Plus; GitHub Action; GitLab review (beta) |
| Project instructions | CLAUDE.md, and it can read AGENTS.md | AGENTS.md |
| Extensions | MCP, skills, hooks, subagents, Agent SDK | MCP, skills and plugins, Codex SDK |
| Open-source CLI | No, all rights reserved | Yes, Apache-2.0 |
| Use with an API key | Yes, Anthropic Console account | Yes, CLI, SDK and IDE only, no cloud features |
Which is better for writing, coding, research and images
Coding
Both agents do the same core loop: read, plan, edit, run, fix. Which one writes better code for you depends more on the model and your repo than on the tool, and neither vendor publishes a head-to-head we could quote. What we can compare is limits. OpenAI publishes estimates for local Codex messages per five-hour window on Plus: 5 to 45 with GPT-6 Astra, 15 to 160 with GPT-6.1 Sol and 350 to 3,000 with GPT-6 Luna. Pro plans currently have no five-hour limit. Anthropic describes usage in multiples instead: Max gives 5x or 20x the usage of Pro. On the Claude side, our Opus vs Sonnet comparison helps you pick the model inside Claude Code.
Writing and docs
Both write commit messages, pull request text and docs from your diff. Claude Code works with git directly: it stages changes, writes commit messages, creates branches and opens pull requests. Outside code, each subscription also includes its chat app for longer writing. For a broader view, see ChatGPT vs Claude.
Research in a codebase
Both can pull outside context over MCP. Claude Code's docs give examples such as design docs in Google Drive, tickets in Jira and data from Slack. On context size, Claude Fable 5.1, Opus 5.5 and Sonnet 5.5 list 1M tokens; OpenAI lists 1.05M tokens for GPT-6 models in the API.
Images
Neither is an image tool, but both models read images, so you can paste a screenshot of a broken layout. OpenAI's pricing page also mentions image generations inside ChatGPT and Codex usage, which use included limits faster than text.
Setting up each one
Both install in one line and sign in with the chat account you already have.
- Claude Code: on macOS, Linux or WSL, Anthropic's docs give
curl -fsSL https://claude.ai/install.sh | bash; Homebrew users can runbrew install --cask claude-code, and Windows has PowerShell and WinGet options. Then open a project folder and runclaude. You are asked to log in on first use. - Codex: OpenAI's README lists
npm install -g @openai/codex, Homebrew, a shell installer and direct downloads. Runcodexin a project and sign in with your ChatGPT account or an API key. - Project rules: put your build and test commands in an AGENTS.md file at the repo root. Codex reads it before any work, and Claude Code can read it too, so you can switch agents without rewriting instructions.
- Effort: Anthropic says Claude Code defaults to medium effort; raise it for hard refactors and lower it for routine edits.
If you also want an editor with its own agent and a choice of models, compare Claude Code vs Cursor, and browse our AI coding tools list for the rest.
Same prompt in both: run it and compare
Run each prompt on a fresh branch of the same repo, once in each agent. We do not print outputs, because they depend on your code. Compare the plan each agent proposes, the size of the diff and how many corrections you had to make.
Find the cause of this bug: [describe the symptom or paste the error]. Reproduce it first with a failing test. Then fix the smallest amount of code that makes the test pass, run the full test suite, and summarize what changed and why in three bullet points.
Review the changes on this branch against [main branch name]. List problems in order of severity: bugs, security issues, missing tests, then style. For each one give the file, the line, and a one-sentence fix. Do not edit any files.
The second prompt is a quick way to see which agent stays inside the scope you set. For more Claude Code tasks, see our Claude Code prompts and the Claude Code cheat sheet.
Pricing, plan by plan
| Tier | Claude Code (via Claude plans) | Codex (via ChatGPT plans) |
|---|---|---|
| Free | Not included | Free, $0 |
| Entry | None | Go, $8/month |
| Standard | Pro, $20 monthly or $17/month annual | Plus, $20/month |
| Heavy use | Max, from $100/month (5x or 20x Pro) | Pro, $100, $200 or $500/month |
| Teams | Team Standard, $20/seat annual or $25 monthly; Premium, $100 or $125 | Business, $20/user annual or $25 monthly |
US prices before tax. Both can also run on pay-as-you-go API keys. Anthropic lists Sonnet 5.5 at $2 input and $10 output per million tokens and Opus 5.5 at $4 and $20. OpenAI lists GPT-6.1 Sol at $2 and $10 and GPT-6 Astra at $10 and $50. On ChatGPT Pro, OpenAI paused new sign-ups for the $200 tier on September 10, 2026.
FAQ
Is Codex free?
Codex is included on ChatGPT Free and Go with limited usage; OpenAI lists GPT-6 Luna in the desktop app for those plans, subject to rollout. Its pricing page lists Codex on the web, in the CLI, in the IDE extension and on iOS from Plus.
Is Claude Code better than Codex?
Neither vendor publishes a direct comparison we could quote. Both reach the terminal, the main IDEs, GitHub and Slack. Codex is cheaper to start and its CLI is open source; Claude Code runs Claude models and comes with a Claude plan. Run the prompts above on your own repo to decide.
Can Claude Code and Codex share project rules?
Yes. Codex reads AGENTS.md, and Anthropic's docs say Claude Code can read AGENTS.md on its own or alongside CLAUDE.md.
Is Codex open source?
The Codex CLI repository on GitHub is licensed Apache-2.0. Claude Code's repository license reserves all rights to Anthropic.
Which models do Codex and Claude Code use?
Codex runs OpenAI's GPT-6 family: GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol and GPT-6 Luna, and OpenAI lists GPT-6 Luna at standard speed in the desktop app for Free and Go. Claude Code runs Claude models, with Opus 5.5 and Sonnet 5.5 as the current mainstream pair and Fable 5.1 above them.
Sources
- Claude Code overview — Claude Code Docs, accessed October 2026
- Claude Code license — Anthropic on GitHub, accessed October 2026
- Plans and pricing — Claude, accessed October 2026
- Models overview — Claude Docs, accessed October 2026
- Introducing Claude Sonnet 5.5 — Anthropic, accessed October 2026
- ChatGPT and Codex pricing — OpenAI, accessed October 2026
- Using Codex with your ChatGPT plan — OpenAI Help Center, accessed October 2026
- What is ChatGPT Plus? — OpenAI Help Center, accessed October 2026
- Codex IDE extension — OpenAI, accessed October 2026
- Codex GitHub Action — OpenAI, accessed October 2026
- Review GitLab merge requests with Codex — OpenAI, accessed October 2026
- Custom instructions with AGENTS.md — OpenAI Codex docs, accessed October 2026
- Codex CLI repository — OpenAI on GitHub, accessed October 2026
- Models — OpenAI API documentation, accessed October 2026
- API pricing — OpenAI, accessed October 2026