Skip to content

Comparison

Claude Code vs Codex CLI (May 2026): Multi-CLI Orchestration

Claude Code wins on subagents, hooks, and the skills ecosystem. Codex CLI wins on AGENTS.md native support, OpenAI model access, and the override file mechanism. Many senior teams use both. Honest comparison.

Who wins at what

Native AGENTS.md support
Codex CLI
Subagent parallelization and hooks
Claude Code
Skills ecosystem breadth
Claude Code
OpenAI model access (o3, GPT-5.4)
Codex CLI
AGENTS.override.md global override
Codex CLI
Plugin marketplace maturity
Claude Code
Long-horizon autonomous runs
Claude Code
Terminal-native UX polish
Tied

Both are terminal-native agentic coding tools from the two leading AI labs. Both ship as open-source CLIs (with paid model API access behind them). Both read configuration files at session start and dispatch tool calls in an agent loop. And — increasingly — senior teams run both, on the same project, for different jobs.

This page picks winners by dimension and frames the multi-CLI pattern that's becoming common.

Who wins at what

Claude Code wins on subagents and hooks, skills ecosystem breadth, plugin marketplace maturity, and long-horizon autonomous runs. Codex CLI wins on native AGENTS.md support, OpenAI model access (o3, o3-pro, GPT-5.4), and the AGENTS.override.md global override mechanism. Terminal UX polish is roughly tied. The "which is better overall" question doesn't have a clean answer — both ship clean CLIs.

Where Claude Code wins

Subagent parallelization. Claude Code's Task tool dispatches subagents with isolated context. This is the primitive that enables parallel research, multi-flow audits, and the kind of "branch-out, synthesize-back" work Codex CLI doesn't have a direct equivalent for. Subagents are documented at code.claude.com/docs/en/sub-agents. The hooks lifecycle. PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification — Claude Code has a real hook system that lets you bolt deterministic checks onto a probabilistic agent. The Stop hook can refuse session end until verification passes. This is how the "verification-first workflow" pattern (HN 46934254) is implemented. Codex CLI has no equivalent. Skills ecosystem breadth. anthropics/skills (official source-available reference skills), obra/superpowers (120k+ stars, the methodology framework), wshobson/agents, VoltAgent/awesome-claude-code-subagents, and aggregators like claudemarketplaces.com (~4,000 skills) — the breadth is real. Codex's skills ecosystem (agensi.io is the main directory) is currently smaller. Plugin marketplace maturity. Claude Code plugins ship with plugin.json manifests bundling skills, agents, hooks, MCP servers, and slash commands. The Anthropic-shipped official marketplace plus community marketplaces (claude-plugins.dev, claudemarketplaces.com) are real distribution channels. Codex CLI's plugin equivalent is younger. Long-horizon autonomous runs. Claude Code's 1M-context Opus 4.7 plus the hook lifecycle plus subagents plus persistent CLAUDE.md context — this is the right shape for "run unattended for 4-8 hours." Codex can do long runs but the supervision primitives are thinner.

Where Codex CLI wins

Native AGENTS.md support. Codex was the first major CLI to ship AGENTS.md as a first-class config in August 2025 (OpenAI Codex docs). The format was effectively invented by Codex and is now an open standard stewarded by the Linux Foundation. Codex reads AGENTS.md without configuration. Claude Code requires the symlink workaround (GitHub issue #34235). OpenAI model access. Codex CLI gives you the OpenAI model lineup — o3, o3-pro, GPT-5.4, the Codex-tuned models. As of May 2026, o3-pro is the leader on the aider polyglot benchmark at 85%. If your work benefits from these models specifically (some tasks do), Codex is the access path. Claude Code is Anthropic-only. AGENTS.override.md global override. Codex supports a global override file at ~/.codex/AGENTS.override.md that wins over every project's AGENTS.md. This is a clean primitive for "I always want commits in this style, regardless of project." Claude Code's user-global ~/.claude/CLAUDE.md merges with project; Codex's override replaces. Different semantics, both useful. Plain AGENTS.md fallback chain. Codex CLI's loading order is documented: AGENTS.override.md → AGENTS.md (root → cwd, layered) → fallback to CLAUDE.md, GEMINI.md, .cursorrules if configured via project_doc_fallback_filenames. This means Codex can read another tool's config as a fallback — handy in multi-tool repos. Codex skills system. ~/.codex/skills//SKILL.md mirrors Claude Code's skill format but lives in Codex's namespace. The format is portable between the two — a SKILL.md authored for Claude Code works in Codex with a directory move. The ecosystem is smaller but the format compatibility is real.

Where the comparison gets uncomfortable

Both depend on their model lineage. Claude Code's quality is bound to Opus/Sonnet/Haiku availability and pricing. Codex CLI is bound to o3/o3-pro/GPT-5.4. If OpenAI raises Codex API pricing or Anthropic deprecates an Opus tier, the cost calculus changes overnight. This is risk inherent to any CLI built on a single model vendor. Skills format compatibility is partial. A SKILL.md authored for Claude Code mostly works in Codex CLI — but Claude-specific frontmatter fields (disable-model-invocation, allowed-tools) may be ignored. Cross-tool skill authoring requires staying inside the lowest common denominator of frontmatter fields. RuleSell's catalog flags skills tagged "Claude+Codex compatible" vs "Claude-only." AGENTS.md in Claude Code is unsupported officially. The symlink workaround works today but isn't sanctioned. If Anthropic ships a feature that conflicts with AGENTS.md interpretation, the workaround breaks. The right hedge is: keep CLAUDE.md as a 5-line pointer to AGENTS.md, not as a full duplicate, so when native support lands, the migration is trivial. Neither has solved the long-context drift problem. A 4-hour autonomous run on either CLI starts losing coherence around hour 2-3. Claude Code's 1M-context window pushes this out further than Codex's typical context, but neither is solved. The supervision primitives (hooks for Claude Code) help but aren't a substitute for picking the right task shape.

When to use both together

The multi-CLI pattern that's becoming common in senior teams:

  • Claude Code for the long autonomous tasks — multi-file refactors, audits, overnight research runs, hook-supervised work.
  • Codex CLI for the OpenAI-model-specific work — when o3-pro's quality matters, when the task fits Codex's strengths.
  • AGENTS.md as the shared source of truth — both CLIs read it (Codex natively, Claude via symlink).
  • AGENTS.override.md for personal overrides — Codex-only, but useful even if Claude Code is your primary.
  • CLAUDE.md as a 5-line pointer to AGENTS.md.
The HN thread "I let Claude Code run autonomously for 8 hours" and Uber's 2026 AI-budget burn are both signals that long-horizon work is real. The "use both CLIs" pattern is what serious users converge on — pick the right tool for the task shape, with shared config making the switch low-friction.

RuleSell's catalog tags every entry by which CLI it works in: Claude Code skill, Codex skill, AGENTS.md section, CLAUDE.md section. Buy once; deploy where your team's CLI reads it.

Where this comparison fails / what we don't know

We didn't run a head-to-head benchmark of "same task, both CLIs, scored output." The aider polyglot benchmark scores the underlying models (o3-pro vs Opus), not the CLI wrappers around them. A controlled benchmark of "implement this feature end-to-end" hasn't been published at fair settings for either tool.

We also don't know how Claude Code's native AGENTS.md support plays out. If/when it lands, the multi-CLI story simplifies — both tools read the same file, no symlink, no pointer. The bet on AGENTS.md as the source of truth gets stronger.

What to read next

Sources

Frequently asked

Can I run Claude Code and Codex CLI in the same project?
Yes, and senior teams commonly do. Codex reads AGENTS.md natively; Claude Code reads CLAUDE.md (with the symlink workaround for AGENTS.md). The two CLIs can run in parallel terminals against the same repo without conflicting — they edit files via different processes. The shared config layer is AGENTS.md (with CLAUDE.md as a pointer or symlink).
Does Codex CLI support skills like Claude Code?
Yes — Codex CLI has its own skills system separate from AGENTS.md, installed in ~/.codex/skills/<skill>/SKILL.md. The format is similar to Claude Code's SKILL.md but the install path differs. Per [developers.openai.com/codex/skills](https://developers.openai.com/codex/skills), Codex's skills system is real but ecosystem coverage is currently smaller — [agensi.io/skills](https://www.agensi.io/learn/how-to-install-skills-in-codex-cli) is the main third-party directory.
What's AGENTS.override.md?
Codex's global override file. Lives at ~/.codex/AGENTS.override.md and applies to every project, overriding repo-level AGENTS.md. Per [developers.openai.com/codex/guides/agents-md](https://developers.openai.com/codex/guides/agents-md), this is how you set personal preferences (commit style, comment density, anti-patterns) that should apply everywhere. Claude Code's equivalent is ~/.claude/CLAUDE.md (user-global), but the override semantics differ — Codex's override wins; Claude's user-global merges with project.
Which model is better for code?
It depends on the task and changes monthly. Claude Code uses Anthropic's Opus 4.7 (the 1M-context model) and Sonnet. Codex CLI uses OpenAI's o3, o3-pro, GPT-5.4, and the Codex-tuned models. Paul Gauthier's [aider polyglot leaderboard](https://aider.chat/docs/leaderboards/) is the closest neutral benchmark: as of May 2026 o3-pro hits 85%, Sonnet hits 64% in architect-editor with R1. Different tasks favor different models; neither is universally better.
Is Codex CLI the same as ChatGPT Codex?
No. Codex CLI is the open-source terminal CLI from OpenAI ([github.com/openai/codex](https://github.com/openai/codex)). ChatGPT Codex is the hosted product inside ChatGPT. They share a brand but are different artifacts. The CLI is what we're comparing here.
Are AGENTS.md and CLAUDE.md interchangeable?
Mostly. The content is portable — both files describe project conventions, anchor files, and rules. The differences: CLAUDE.md walks UP the tree (parent dirs aggregate); AGENTS.md walks DOWN (root → cwd). CLAUDE.md can include Claude-Code-specific directives (skill triggers, sub-agent delegation hints); AGENTS.md is tool-neutral. The clean pattern: AGENTS.md as canonical, tiny CLAUDE.md pointing to it. See [/vs/agents-md-vs-claude-md](/vs/agents-md-vs-claude-md).

Related topics