Comparison

Agent Harness

Claude Code vs Codex

Anthropic's and OpenAI's coding agents side by side, for teams deciding which one to hand real work to, and whether they have to pick only one.

The Leanest Stack Editors · Facts checked against Anthropic's and OpenAI's docs on

The short answer

Claude Code and Codex are now close on shape: both are agentic coding tools with a terminal CLI, an IDE extension, a desktop app and a cloud mode that keeps working after you close your laptop. Both read a project instructions file, speak MCP, and can be triggered from GitHub, Slack and CI. Neither is a clear winner on features alone.

What actually separates them for a lean team is the model family each one is built around (Anthropic's Claude models or OpenAI's), the account your team already pays for, and a few concrete differences: the Codex CLI is open source, Codex ships a native Linear integration, and Claude Code lets Team and Enterprise customers run cloud sessions on their own infrastructure. Test both on tasks from your own backlog before you standardise, and keep the choice reversible.

At a glance

Claude CodeCodex
Made byAnthropicOpenAI
ModelsAnthropic's Claude models, through a Claude plan, the Claude Console, or a supported cloud providerOpenAI's models, through a ChatGPT plan or an API key; docs also cover Amazon Bedrock and Google Cloud
Local surfacesCLI, desktop app, VS Code and JetBrains extensionsCLI, ChatGPT desktop app, IDE extension
Cloud modeCloud sessions from claude.ai/code, the mobile app, Desktop or claude --cloud; Anthropic-managed by default, or your own infrastructure on Team and EnterpriseCodex Cloud on OpenAI-managed computers, each task in its own workspace; start from web, desktop, mobile or codex cloud
Project instructionsCLAUDE.md, and it can read a repo's AGENTS.mdAGENTS.md
Team triggersGitHub Actions, GitLab CI/CD, automatic PR Code Review, Slack; Linear and others through MCPGitHub (@codex review), GitLab review (beta), Slack, Linear, a GitHub Action
ScriptingNon-interactive CLI and the Agent SDKcodex exec and the Codex SDK
Extending itMCP servers, skills, hooks, subagentsMCP servers, skills and plugins, hooks, subagents
Open sourceCheck Anthropic's terms for Claude CodeCLI and SDK open source (Apache-2.0, openai/codex); IDE extension and Codex Cloud are not
PricingIncluded in Claude plans; Console use is pay-as-you-go. Check claude.com/pricingIncluded in ChatGPT plans; API-key use is billed at API rates. Check Codex's pricing page

Where each one runs

Both tools started in the terminal, and the CLI is still where each is most complete. Anthropic's docs say scripting and the Agent SDK are CLI-only for Claude Code; OpenAI positions the Codex CLI for interactive work, scripts and CI through codex exec.

The cloud modes are where the difference matters for a team. A Claude Code cloud session runs on infrastructure Anthropic manages, or on your organisation's self-hosted environment on Team and Enterprise plans, and Anthropic says it counts toward your plan's usage with no separate charge for the VM. Codex Cloud runs tasks on OpenAI-managed computers; you publish a reusable environment (repositories, install script, network access, secrets) and each task gets its own workspace. If your code may not leave your network, that self-hosted option is the first thing to check. Our piece on local vs cloud coding agents covers why the environment matters more than which laptop the agent runs on.

How work reaches the agent

A lean team wants agents to pick up work where it is already written down. Codex has first-party integrations for GitHub pull request review, GitLab merge request review (in beta), Slack and Linear, where you can assign an issue to Codex or mention @Codex and it starts a cloud chat. Claude Code covers GitHub Actions and GitLab CI/CD, automatic pull request Code Review and Slack, and connects to Linear, Notion and internal APIs through MCP servers.

Read the plan requirements on each integration before rolling it out: several are limited to paid or team plans. For the pattern of triggering either agent from an issue tracker without someone watching it, see triggering Cursor and Claude Code from Linear or GitHub.

Instructions and repository context

Codex reads AGENTS.md, the tool-neutral instructions file. Claude Code reads CLAUDE.md, and its docs describe reading a repository's AGENTS.md as well. If both agents will work in the same repo, keep the shared rules (build and test commands, conventions, what not to touch) in AGENTS.md, and check Anthropic's memory docs for how Claude Code treats AGENTS.md when a CLAUDE.md is also present.

Both also support skills, hooks, subagents and MCP, so most team setup carries across. What doesn't carry is anything tied to one vendor's cloud: published environments in Codex, cloud environments in Claude Code. That is the part worth owning yourself; see giving cloud coding agents institutional codebase knowledge.

What to check on cost

Neither has one price. Claude Code is included in Claude's Pro, Max, Ultra, Team and Enterprise plans, and also runs on pay-as-you-go Claude Console credits or a cloud provider's billing. Codex is included in ChatGPT plans, with credits or usage-based billing to extend them, and API-key sessions are billed separately at API rates. Plan names, usage limits and prices change often: check claude.com/pricing and Codex pricing on the day you decide.

The bigger number for a small team is rarely the seat. It is the engineer time spent setting up, watching and cleaning up after agents, which we break down in what lean teams actually pay for in a managed agent runner.

You don't have to pick only one

Models keep leapfrogging each other, and the harness that wins on your codebase this quarter may not next quarter. The lean move is to keep the agent swappable: one instructions file, one place work starts, one environment your agents run in, and the harness chosen per task. Platforms such as Replicas run Claude Code, Codex and other harnesses each in an isolated Linux VM behind the same Slack, Linear and GitHub entry points, so switching is a setting rather than a migration. More on that in staying harness-agnostic as AI coding models improve.

Which to choose

Choose Claude Code if

  • Your team already pays for Claude, or prefers how Claude models handle your codebase in your own trials.
  • Code must stay inside your network: Team and Enterprise plans can run cloud sessions on self-hosted environments.
  • You want JetBrains support alongside VS Code, or automatic Code Review on every pull request.
  • You build on the Agent SDK to script agents into your own tools.

Choose Codex if

  • Your team already has ChatGPT Business or Enterprise seats, or prefers OpenAI's models in your own trials.
  • You want to read, audit or patch the CLI: it is open source under Apache-2.0.
  • Work starts in Linear and you want issues assigned straight to the agent without wiring up MCP.
  • You standardise on AGENTS.md and want the agent that reads it natively.

Questions teams ask

Is Claude Code better than Codex?

Not in general. Both cover the same ground (CLI, IDE, desktop, cloud, MCP, CI), and which one does better work depends on your codebase, your tasks and the models current at the time. Run the same tickets from your own backlog through both and compare the pull requests you would actually merge.

Is Codex open source?

Partly. The Codex CLI, the Codex SDK and the app server live in the openai/codex repository under the Apache-2.0 licence. The IDE extension and Codex Cloud are not open source.

Can Claude Code and Codex share one instructions file?

Yes. Codex reads AGENTS.md, and Claude Code's docs describe reading a repository's AGENTS.md as well as CLAUDE.md. Keep shared rules in AGENTS.md and check Claude Code's memory docs for which file it loads when both exist.

Do both run in the cloud?

Yes. Claude Code cloud sessions run on Anthropic-managed infrastructure or, on Team and Enterprise plans, on your own. Codex Cloud runs tasks on OpenAI-managed computers, each in its own workspace. Both keep working after you disconnect.

How much do Claude Code and Codex cost?

Both are included in their makers' subscription plans and can also be paid for by usage. Prices and limits change often, so check claude.com/pricing and OpenAI's Codex pricing page before you budget.

Sources