Comparison
Claude Code vs Codex: which coding agent should you use?
Both cost $20 to start, and both run in a terminal, an IDE, a desktop app and the cloud. The differences are in the limits, the free tier and the controls.
Claude Code and Codex are the two leading coding agents in October 2026, and they're closer than their fans suggest: both start at $20 a month, with Claude Pro or ChatGPT Plus; both run in a terminal, an IDE, a desktop app and the cloud; and both have subagents, skills, plugins, hooks and MCP. The differences: Codex comes with ChatGPT's free plan in a limited form and its CLI is open source, while Claude Code needs a paid plan and isn't open source; OpenAI publishes rough Codex message estimates per five hours, while Anthropic publishes none for Claude Code; and each runs its own lab's models, Claude Opus 5.5 by default against GPT-6.1 Sol. Neither lets two people work in one session.
Key takeaways
- The same entry price: Claude Pro is $17 to $20 a month and ChatGPT Plus $20. At the top, Claude Max is $100 or $200 and ChatGPT Pro $100, $200 or $500.
- Codex on Plus gets an estimated 15 to 160 GPT-6.1 Sol messages every five hours; Claude Code's limits are shared with chat and unpublished. Both have weekly caps.
- Codex is on ChatGPT's free plan with GPT-6 Luna; Claude Code isn't on Claude's free plan.
- Moving is one-way: ChatGPT's desktop app and the Codex CLI import from Claude Code, and Claude Code has no import from Codex.
| Claude Code | Codex | |
|---|---|---|
| Made by | Anthropic | OpenAI |
| Default model | Claude Opus 5.5 | GPT-6.1 Sol |
| Cheapest plan with it | Claude Pro, $17 to $20 a month | ChatGPT Free (GPT-6 Luna); Plus $20 for full use |
| Top individual plan | Max, $100 or $200 | Pro, $100, $200 or $500 |
| Published usage limits | None; shared with chat | Estimates per five hours, by model |
| Where it runs | Terminal, VS Code, JetBrains, desktop app, web, Slack | ChatGPT desktop app, CLI, IDE, web, iOS, Codex Cloud |
| Open source | No | The CLI, Apache 2.0 |
| Safety controls | Permission modes; Auto is the terminal default | Sandbox modes; workspace-write is the default |
| Extensions | Subagents, hooks, skills, plugins, MCP | Subagents, hooks, skills, plugins, MCP |
| Team chat | Claude Tag in Slack (Team, Enterprise) | @ChatGPT in Slack and Microsoft Teams |
| Several people in one session | No | No |
How much do Claude Code and Codex cost?
- Individual plans: Claude Pro, $17 a month billed annually or $20 monthly, includes Claude Code; ChatGPT Plus, $20, includes Codex. Claude Max is $100 or $200; ChatGPT Pro is $100, $200 or $500.
- Free: ChatGPT Free and Go include Codex with GPT-6 Luna in the desktop app; Claude's free plan has no Claude Code. Details in Is Codex free? and Is Claude Code free?
- Teams: both labs charge $20 to $25 for a standard seat and $100 to $125 for premium. Claude Code for teams, Codex for teams.
- API keys: both run on pay-per-token keys. Claude Sonnet 5.5 and GPT-6.1 Sol both cost $2 per million input tokens and $10 per million output.
What are the usage limits?
Codex. OpenAI's pricing page estimates local messages every five hours on Plus and standard Business seats: GPT-6 Astra 5 to 45, GPT-6.1 Sol 15 to 160, GPT-6 Sol 15 to 150, GPT-6 Luna 350 to 3,000. Weekly limits may also apply, local and cloud work share the allowance, and ChatGPT Pro currently has no five-hour limit. Fast mode uses the allowance 2.5 times faster.
Claude Code. Anthropic publishes no message counts. Its support page says limits are shared across Claude and Claude Code, Max gives five or 20 times Pro's per-session allowance, sessions reset every five hours, and weekly caps apply (Anthropic). On May 6, 2026, Anthropic doubled Claude Code's five-hour limits on Pro, Max, Team and seat-based Enterprise (Anthropic). Past the limit, you can turn on usage credits billed at API rates.
Where does each run?
- Claude Code: the terminal, VS Code and JetBrains, the Claude desktop app's Code tab, the web (with sessions you can move between cloud and laptop), mobile, Chrome and Slack.
- Codex: the ChatGPT desktop app's Codex mode, the CLI, the IDE extension, the web and iOS, plus Codex Cloud, whose tasks keep running while your computer sleeps.
Both review pull requests on GitHub and have plan modes.
How do their safety controls differ?
Claude Code uses permission modes: Manual asks before each edit and command, Accept edits lets file changes through, Plan only proposes, and Auto lets a classifier approve actions. Auto is the default in the terminal and VS Code, and Anthropic says it doesn't guarantee safety. Codex uses sandbox modes: read-only, workspace-write, the default, which also blocks the network, and full access, plus approval settings for when it asks. The non-technical guide walks through Claude Code's prompts.
Which has the better models?
Close. On LMArena's WebDev votes, Claude Opus 5.5 is first and GPT-6 Astra second; on the Terminal-Bench 4.0 leaderboard, GPT-6 Astra and Claude Fable 5.1 tie; on Vals AI's run, Opus 5.5 scored 65.2% to GPT-6.1 Sol's 55.1%, at $13.20 a task against $1.72. Details in Claude vs ChatGPT for coding.
Can you switch from Claude Code to Codex?
Yes, and OpenAI makes it easy: the ChatGPT desktop app imports from Claude Code, Claude Cowork or Cursor, and the Codex CLI's /import takes Claude Code or Cursor. It brings over instructions, settings, skills, plugins, projects, Claude Code's project memories and recent chats, and can keep them in sync (OpenAI). We found no official import in the other direction.
What about Cursor and Gemini CLI?
- Cursor is an AI code editor, a fork of VS Code, with its own agents and cloud agents: free Hobby, Pro $20, Pro+ $60 and Ultra $200 a month. Claude Code and Codex can run inside it.
- Gemini CLI stopped serving free and Google AI Pro and Ultra accounts on June 18, 2026; Google points those users to its Antigravity CLI, which has a free plan with weekly limits (Google). Gemini CLI still works with a Gemini API key.
More agents are compared in Claude Code alternatives.
Which should you use?
- You want the most-voted model for web builds: Claude Code, with Opus 5.5.
- You want to start free, or read and change the agent's code: Codex.
- You want published limits and cheap tasks: Codex with GPT-6.1 Sol.
- You live in Slack at a company on Claude Team: Claude Code, with Claude Tag.
- You can't decide: try both on the same task; the import makes moving to Codex quick.
Can you use both?
Yes. Poly (usepoly.co) runs both, Claude Code for Claude turns and Codex for GPT turns, in one browser room with one workspace. Each person picks their model, and when the conversation changes labs, the next agent gets a catch-up of what it missed. The free tier includes Claude Sonnet 5.5 and GPT-6 Luna. Multi-model AI coding.
Common questions
Is Claude Code better than Codex?
Not everywhere. Claude Opus 5.5 leads LMArena's WebDev votes, GPT-6 Astra and Claude Fable 5.1 tie on Terminal-Bench 4.0, and Codex is cheaper per task with GPT-6.1 Sol. The agents' features are close.
Which is cheaper, Claude Code or Codex?
Both start at $20 a month. Codex also comes with ChatGPT's free plan using GPT-6 Luna, and on Vals AI's benchmark run GPT-6.1 Sol cost far less per task than Claude Opus 5.5.
Does Codex have usage limits?
Yes. On Plus, OpenAI estimates 15 to 160 GPT-6.1 Sol messages every five hours, with weekly limits that may also apply. ChatGPT Pro has no five-hour limit.
Can I move from Claude Code to Codex?
Yes. The ChatGPT desktop app and the Codex CLI import Claude Code's instructions, settings, skills, plugins, memories and recent chats. There is no official import from Codex to Claude Code.