What is the difference between Codex and Claude Code?
Codex and Claude Code are both AI coding agents that read your repo, edit files and run commands. The main differences are the company and models behind them, and how each one keeps the agent in check. Codex is OpenAI's agent, runs on OpenAI's GPT models, and puts every command inside an OS sandbox by default. Claude Code is Anthropic's agent, runs on Claude models, and controls risk mainly through permission modes, with an optional sandbox.
Day to day, they feel alike. You open a terminal in your project, type codex or claude, describe a task, and review the diff. Both read a project instructions file, both support Agent Skills and MCP servers, and both have IDE extensions, desktop apps and cloud versions. So most people end up choosing on models, pricing and the details below, not on a big difference in workflow.
How Codex works
Codex CLI is an open source agent from OpenAI that runs on your machine; the openai/codex repo is Apache-2.0 licensed. You install it with a standalone script, npm or Homebrew, run codex in a project, and sign in with your ChatGPT account or an API key.
The same agent shows up in several places:
- CLI, the terminal app, with
codex execfor scripts and CI. - IDE extension for VS Code, Cursor and Windsurf, plus a Codex integration in JetBrains IDEs.
- Desktop app, the ChatGPT desktop app, which you can open from the CLI with
codex app. - Codex Cloud, which runs tasks in OpenAI-managed environments that you start from ChatGPT on the web or in the desktop app.
On ChatGPT plans, Codex uses OpenAI models such as GPT-6.1 Sol and GPT-6 Luna, according to OpenAI's models page. The CLI can also run local open source models through LM Studio or Ollama with the --oss flag.
How Claude Code works
Claude Code is Anthropic's "agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools." It runs in the terminal, in VS Code and JetBrains, in a desktop app and in the browser. claude -p "query" runs one task and exits, which is how you script it.
Claude Code uses Anthropic's Claude models. On Pro, Max, Team, Enterprise and the Anthropic API, the default model is Opus 5.5, per the model configuration docs. You can switch to Sonnet or Haiku with /model, or opt in to Fable 5.1 for long, hard tasks. It also runs through Amazon Bedrock, Google Cloud and Microsoft Foundry for teams that buy models through a cloud provider.
Codex vs Claude Code side by side
| Codex | Claude Code | |
|---|---|---|
| Made by | OpenAI | Anthropic |
| Models | OpenAI GPT models; local models with --oss |
Claude models (Opus, Sonnet, Haiku, Fable) |
| Where it runs | CLI, IDE extension, ChatGPT desktop app, Codex Cloud | Terminal, VS Code, JetBrains, desktop app, web |
| Project instructions | AGENTS.md, plus ~/.codex/AGENTS.md |
CLAUDE.md, or AGENTS.md when there is no CLAUDE.md |
| Skills folder | .agents/skills/, ~/.agents/skills/ |
.claude/skills/, ~/.claude/skills/ |
| Run a skill by name | $skill-name or /skills |
/skill-name |
| MCP | codex mcp add, stored in ~/.codex/config.toml |
claude mcp add, stored in .mcp.json or ~/.claude.json |
| Other extension points | Hooks, subagents, plugins | Hooks, subagents, plugins |
| Safety default | OS sandbox on: workspace writes, no network | Auto mode (v2.1.283 or later), where a classifier reviews actions; OS sandbox off until you turn it on |
| Scripting | codex exec |
claude -p |
| Config file | ~/.codex/config.toml (TOML) |
settings.json files (JSON) |
| Paid access | ChatGPT plans or an OpenAI API key | Claude paid plans or a Claude Console account |
Instructions files: AGENTS.md vs CLAUDE.md
Codex reads AGENTS.md. OpenAI's AGENTS.md guide explains the order: a global file in ~/.codex/AGENTS.md, then one file per folder from the repo root down to where you are, with closer files taking priority. An AGENTS.override.md in a folder replaces the regular file there. Run /init in the CLI to scaffold one.
Claude Code reads CLAUDE.md. Its memory docs say Claude Code "can read AGENTS.md as your project instructions" when you have no CLAUDE.md or CLAUDE.local.md in your working directory or above it. If you have both, it reads only CLAUDE.md. The simple fix is to import the shared file at the top of CLAUDE.md:
@AGENTS.md
## Claude Code only
- Use plan mode before changes that touch more than three files.
That gives you one shared file for both agents and a small place for anything specific to Claude Code. Reading AGENTS.md directly needs Claude Code v2.1.277 or later.
Skills in Codex and Claude Code
Both agents support Agent Skills: a folder with a SKILL.md file that has a name, a description and instructions. The agent sees each skill's name and description up front and loads the full file only when a task matches. Codex's skills docs say skills "build on the open agent skills standard", and Claude Code's skills follow the same standard.
The format is shared; the folders are not:
- Codex scans
.agents/skillsin every folder from where you started up to the repo root, plus$HOME/.agents/skillsand/etc/codex/skills. You call a skill with$nameor pick one with/skills. See the Codex skills guide. - Claude Code reads
.claude/skills/in the project and~/.claude/skills/for personal skills. Each skill becomes a slash command, like/release-notes. See the Claude Code skills guide.
To share one skill, keep the frontmatter to the standard fields and install it into both folders. The open source skills command can do it in one go:
npx skills add https://github.com/<owner>/<repo>.git -a codex -a claude-code -g
MCP, permissions and sandboxing
MCP. Both connect to Model Context Protocol servers. In Codex, codex mcp add context7 -- npx -y @upstash/context7-mcp writes a [mcp_servers.context7] table to ~/.codex/config.toml, and /mcp lists what is active. In Claude Code, claude mcp add --transport http <name> <url> adds a remote server; the Claude Code MCP guide covers scopes and .mcp.json.
Codex: sandbox first. Codex combines a sandbox mode with an approval policy. Sandbox modes are read-only, workspace-write and danger-full-access; approval is on-request or never. OpenAI's approvals and security page says that by default "the agent runs with network access turned off," and in a version-controlled folder Codex recommends the Auto preset: it can edit and run commands in the workspace, and asks before it touches files outside it or the network. --yolo removes both the sandbox and approvals, and OpenAI marks it not recommended.
Claude Code: permission modes first. Claude Code has six permission modes: default (shown as Manual, asks before edits and commands), acceptEdits, plan, auto (runs with background safety checks), dontAsk for locked-down CI, and bypassPermissions for isolated containers only. On top of that you add allow and deny rules. Its OS-level sandbox for shell commands is off by default; turn it on with /sandbox. It runs on macOS, Linux and WSL2.
In practice: Codex starts locked down and you loosen it. Claude Code starts interactive sessions in auto mode (v2.1.283 or later), where a classifier reviews actions, and you switch to Manual when you want to approve each step yourself.
Pricing: how Codex and Claude Code are paid for
Both come with a chat subscription, and both can bill per token through an API account instead. Prices below are as of October 2026.
- Codex is part of ChatGPT plans. OpenAI's Codex pricing page lists the CLI and IDE extension on Plus ($20 a month), Pro (from $100 a month) and Business ($20 per user per month billed annually, $25 monthly), with Enterprise and Edu through sales. Free and Go list Codex in the desktop app only, subject to rollout. With an API key you pay standard API rates.
- Claude Code is part of every paid Claude plan. On claude.com/pricing, Pro is $20 a month ($17 a month billed annually), Max starts at $100 a month, and Team seats start at $20 per seat per month billed annually. The free plan does not include it. A Claude Console account bills per token instead.
On both, the subscription comes with usage limits that reset over time rather than a fixed message count. The Claude Code pricing guide covers Claude's limits and how to watch your usage.
Which should you pick?
Codex tends to fit when:
- You already pay for ChatGPT and want the agent included.
- You want a sandbox on from the first run, with network off unless you allow it.
- You want an open source CLI you can read, or want to try local models with
--oss. - You like structured output in CI, such as
codex exec --output-schemafor JSON results.
Claude Code tends to fit when:
- You prefer Claude models for coding.
- You want skills that double as slash commands, like
/release-notes. - You want a range of permission modes, from asking about every action to auto mode with background safety checks.
- You want Opus as the default model and the option to opt in to Fable on harder work.
- Your team already pays for Claude Team or Enterprise.
Neither list is a verdict. Both ship changes every week, so run a real task from your backlog through each before you decide.
Can you use Codex and Claude Code together?
Yes, and plenty of developers do, for example using one agent to review the other's work. A setup that avoids duplication:
- Put shared project rules in
AGENTS.md. Codex reads it directly. - In
CLAUDE.md, add@AGENTS.mdat the top so Claude Code reads the same rules, then add anything Claude-only below. - Install each skill into both
.agents/skills/and.claude/skills/, or let the skills command link one copy into both. - Add your MCP servers to each tool. They use different config files, so this is the one step you repeat.
If you are switching rather than mixing, both tools can import the other's setup: run /import in the Codex CLI to bring in Claude Code setup, projects and chats, or /import codex in Claude Code to bring in Codex instruction files, MCP servers and skills.
Keep your skills in one place
The skills and prompts you build up matter more than which agent runs them. Kipt keeps them as Markdown in a private GitHub repo you own and installs the whole library into Codex and Claude Code with one npx skills add command. If you have a prompt that works, the free SKILL.md generator turns it into a skill folder both agents can read.