Codex vs Claude Code
OpenAI's Codex and Anthropic's Claude Code are the two coding agents most people end up weighing against each other. Both run in your terminal, read the repo, edit files and run commands; they differ in what you pay for, how they keep you safe and which files they read. Every row below was checked against both vendors' docs and the CLIs themselves on 27 October 2026.
The short answer
- Pick Codex if you already pay for ChatGPT, want commands boxed in by the operating system without configuring anything, or want an open-source CLI you can read and build.
- Pick Claude Code if you already pay for Claude, want the most places to plug in (hooks, plugins, marketplaces, Claude Code as an MCP server), or prefer permission rules and auto mode to a sandbox.
- Use both if you can: they keep separate homes and logins, both can read one
AGENTS.md, and a second agent reviewing the first one's diff catches what the first one missed.
At a glance
| Codex | Claude Code | |
|---|---|---|
| Made by | OpenAI | Anthropic |
| Runs in | The terminal, VS Code, Cursor and Windsurf, the ChatGPT desktop app, the web, iOS and GitHub | The terminal, VS Code and JetBrains, the Claude desktop app, the web, mobile and GitHub |
| Source | The CLI is open source (Apache-2.0, written in Rust); the IDE extension and the cloud are not | Closed source |
| Comes with | ChatGPT Plus at $20 a month and up | Claude Pro at $20 a month and up |
| Pay per token instead | An OpenAI API key, without the cloud features | A Claude Console account or API key |
| Default model | GPT-6.1 Sol, the recommended model since CLI 0.161.0 | Opus 5.5 |
| Safety by default | An OS sandbox: writes stay in the workspace, the network is off, and it asks before going further | Auto mode: a classifier runs routine actions and blocks destructive ones; a sandbox is optional |
| Project instructions | AGENTS.md | CLAUDE.md, or AGENTS.md when there is none |
| Settings | ~/.codex/config.toml | ~/.claude/settings.json |
| One-shot runs | codex exec | claude -p |
| Bring over the other | /import reads a Claude Code setup | claude import codex |
Plans, prices and limits
Both come with a chat subscription you may already have, and both can bill an API key instead. US prices as listed on 27 October 2026:
| Codex, on ChatGPT plans | Claude Code, on Claude plans | |
|---|---|---|
| Free plans | Free, and Go at $8 a month, offer Codex in the desktop app with GPT-6 Luna | Not included |
| Entry plan | Plus, $20 a month: the CLI, the IDE extension, the web and iOS | Pro, $20 a month or $17 billed yearly |
| Heavy use | Pro at $100, $200 or $500 a month | Max 5x at $100 a month, Max 20x at $200 |
| Teams | Business, $25 per user a month or $20 billed yearly | Team, $25 or $125 per seat a month, less billed yearly |
| How limits work | Per five hours on Plus and Business, and weekly limits may also apply; Pro has no five-hour limit | A five-hour session limit and a weekly limit on every plan, shared with the Claude app |
| What is published | Ranges per model, such as 15 to 160 local messages per five hours with GPT-6.1 Sol on Plus | Multiples of Pro per session: 5 and 20 times on Max |
| Past the limit | Plus and Pro can buy ChatGPT credits | Usage credits at API prices, or wait for the reset |
Neither vendor turns its limits into a token count you can plan against. OpenAI at least publishes message ranges per model; Anthropic publishes multiples of Pro. The Claude side in full, with API prices and a calculator for subscription or API, is in Claude Code pricing.
Sandbox, approvals and permissions
This is the deepest difference between the two, and the one that decides how much you can leave them alone.
Codex: a sandbox first
Codex runs commands inside a sandbox the operating system enforces, Seatbelt on macOS. By default writes stay in the workspace and the network is off, and an approval policy decides when Codex stops to ask. You set the reach with --sandbox read-only, workspace-write or danger-full-access, and the asking with --ask-for-approval on-request or never. codex exec starts read-only. --dangerously-bypass-approvals-and-sandbox removes both, and its own help calls it extremely dangerous. The skip-permissions guide lines it up with Claude Code's flag.
Claude Code: rules and a classifier first
Claude Code decides per tool call. Allow, ask and deny rules such as Bash(git push *) are checked deny first, then ask, then allow. Since version 2.1.283 interactive sessions start in auto mode: a classifier lets routine actions run and blocks anything irreversible, destructive or aimed outside your environment, and your deny and ask rules still come first. The other modes are default, which asks, acceptEdits, plan, dontAsk and bypassPermissions; print mode starts in default. A sandbox for shell commands, Seatbelt on macOS as well, stays off until you run /sandbox.
Put simply, Codex limits what a command can reach and Claude Code judges whether to run it. With defaults, Codex is the stricter of the two for an agent you leave alone; /sandbox gives Claude Code's shell commands a similar boundary.
Instructions and config files
| Codex | Claude Code | |
|---|---|---|
| Instructions | AGENTS.md | CLAUDE.md or .claude/CLAUDE.md, plus CLAUDE.local.md for private notes |
| Where it looks | ~/.codex/AGENTS.md (or AGENTS.override.md), then each folder from the repo root down to where you started, up to 32 KiB | ~/.claude/CLAUDE.md, then the project and the folders above it |
| Reads the other's file | Only if you list CLAUDE.md in project_doc_fallback_filenames | Reads AGENTS.md when there is no CLAUDE.md, since version 2.1.277 |
| Settings | ~/.codex/config.toml, and .codex/config.toml in trusted projects | ~/.claude/settings.json, .claude/settings.json and .claude/settings.local.json |
| Home folder | ~/.codex, moved with CODEX_HOME | ~/.claude, moved with CLAUDE_CONFIG_DIR |
One file for both. Keep what both agents should know in AGENTS.md. Codex reads it natively and Claude Code reads it as long as the repo has no CLAUDE.md. When you also need Claude-only instructions, add a CLAUDE.md whose first line is @AGENTS.md, which imports the shared file, and write the rest below it.
Extending them
| Codex | Claude Code | |
|---|---|---|
| MCP | A client over stdio and streamable HTTP, set up with codex mcp add. The codex mcp-server command was removed in September. | A client over stdio, SSE, HTTP and WebSocket, with project servers in .mcp.json. claude mcp serve runs Claude Code as an MCP server. |
| Hooks | 12 events, and a hook has to be trusted before it runs | 33 events |
| Subagents | On by default; custom agents in ~/.codex/agents/ | In .claude/agents/ or --agents, plus experimental agent teams |
| Skills | SKILL.md files in .agents/skills; custom prompts are deprecated in their favor | .claude/skills/; custom commands were merged into skills |
| Plugins | codex plugin, not available in the IDE extension | Plugins and marketplaces with claude plugin |
Scripts, CI and sessions
| Codex | Claude Code | |
|---|---|---|
| One-shot run | codex exec "task", or codex e, prints the final message | claude -p "task" prints the answer |
| For programs | --json for newline-delimited events, --output-schema for an answer that matches a JSON Schema, -o to write the last message to a file | --output-format json or stream-json, --json-schema for structured output, --max-budget-usd to cap spend |
| Resume | codex resume with a picker or --last, codex fork, and codex exec resume --last | claude -c for the latest in this folder, -r by name or ID, --fork-session |
| Worktrees | --worktree on new and forked runs | -w creates one under .claude/worktrees/ |
| Cloud | Codex Cloud, from the CLI with codex cloud exec and apply; needs ChatGPT sign-in | Cloud sessions on claude.ai/code, or from the CLI with --cloud, counted against your plan's usage |
| GitHub | Automatic pull request review and the openai/codex-action@v1 action | The anthropics/claude-code-action@v1 action, and Code Review on Team and Enterprise |
Which one for which job
- You live in ChatGPT already. Codex is in the plan you pay for, across the desktop app, the CLI and the IDE.
- You want guardrails without setup. Codex's default sandbox keeps commands in the workspace and off the network.
- You want fewer prompts on a repo you trust. Claude Code's auto mode runs routine actions without asking and still stops the destructive ones.
- You want to wire the agent into everything. Claude Code has more hook events, plugin marketplaces and an MCP server mode.
- You want to read or patch the agent itself. The Codex CLI is open source; Claude Code is not.
For code quality, run both on the same task and compare the diffs. Default models change every few weeks (Codex moved to GPT-6.1 Sol on 7 October, Claude Code to Opus 5.5 on 22 September), and your own repo is the benchmark that matters.
Run both on one Mac
The two never collide outside the working tree: separate homes, separate logins, separate sessions. Give each its own git worktree, or let one write while the other reviews its diff. Running Claude Code, Codex and Gemini CLI side by side walks through the setup.
Symvibe, which we make, is a board for exactly this. Codex and Claude Code each get a console that is the real CLI in a real terminal, signed in with your account. With live agent status on, both report working, ready or needs you through their own hooks. Saying "pass this to codex" summarizes the Claude Code session and hands the brief to the Codex console, and when you reopen the app each console offers its CLI's own resume.
Questions people ask
Is Codex better than Claude Code?
Neither wins everywhere. Codex is ahead on default sandboxing and has an open-source CLI; Claude Code is ahead on extensibility and permission controls. Model quality moves too fast for a ranking to last, so test both on your own repo.
Do Codex and Claude Code cost the same?
The entry plans do: $20 a month for ChatGPT Plus or Claude Pro. The heavy plans differ: ChatGPT Pro at $100, $200 or $500 a month against Claude Max at $100 or $200.
Can Codex read CLAUDE.md?
Not by default. List it in project_doc_fallback_filenames in ~/.codex/config.toml, or keep shared instructions in AGENTS.md, which Claude Code also reads when a repo has no CLAUDE.md.
Can I move my setup from one to the other?
Yes, in both directions. claude import codex brings a Codex setup into Claude Code; add --dry-run to preview it. In Codex, /import brings in a Claude Code setup: instructions, settings, skills, MCP servers, hooks and up to 50 chats from the last 30 days.
Which one is safer to leave running?
With defaults, Codex: its sandbox keeps commands in the workspace and off the network. Claude Code's auto mode blocks destructive actions by judgment rather than by a boundary; turn on /sandbox to add one.
Can I use both in the same repo?
Yes. Give each its own git worktree so they never write the same files, or let one write and the other review. A shared AGENTS.md keeps their instructions in step.
Codex and Claude Code on one board
Symvibe runs both CLIs as real terminals on one canvas, with live status for each, handoffs between them and resume on reopen. Your logins, your plans, your Mac.
macOS 14 or later · Apple Silicon · USD 19 a month or USD 190 a year