Claude Code vs Codex
Anthropic’s Claude Code CLI and OpenAI’s Codex CLI are both terminal coding agents. The useful split is model family, surfaces, and automation, not a fake winner.
Claude Code vs Codex
Anthropic CLI. OpenAI CLI.
critique.sh
Pick Claude Code when you want Anthropic’s agentic coding tool in the terminal (claude): read the repo, edit files, run commands, manage git, and (if you use them) the IDE, desktop, and web surfaces Anthropic documents. Pick OpenAI Codex CLI when you want OpenAI’s local coding agent (codex): inspect, edit, run tools already on the machine, optional /review, codex exec for scripts, and the CLI/cloud loop OpenAI documents. Neither CLI is an independent reviewer of its own work. If you already like one of them, keep it.
Claude Code vs Codex is a shopping query with a trap. People treat it like a model shootout. The products are both terminal coding agents. They both read a repository, write files, run commands, and help you ship a patch. The decision is which lab’s loop you already pay for, which extra surfaces you actually use, and whether you need headless automation that OpenAI documents as codex exec.
This post stays on the CLIs first. Claude Code also ships IDE extensions, a desktop app, and a browser surface. Codex also ships an IDE extension, codex app, and Codex web/cloud. Those extras matter after you pick a terminal author, not before. Related maps: best terminal coding agents 2026, best CLI tools for coding 2026, and the comparisons hub.
What Claude Code is, from Anthropic’s docs
Anthropic’s overview describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. The terminal CLI is the full-featured path: edit files, run commands, and manage the project from the command line. Most surfaces need a Claude subscription or an Anthropic Console account. The terminal CLI and VS Code also support third-party providers, per Anthropic’s overview.
Install on macOS, Linux, or WSL with curl -fsSL https://claude.ai/install.sh | bash. Windows PowerShell uses irm https://claude.ai/install.ps1 | iex. Homebrew cask claude-code, WinGet Anthropic.ClaudeCode, and Linux packages (apt, dnf, apk) are documented. npm install is deprecated. Then cd into a project and run claude. First use prompts you to log in unless ANTHROPIC_API_KEY is set.
Daily shell commands Anthropic documents: claude for interactive mode, claude "task" for a one-time task, claude -p "query" for a one-off then exit, claude -c to continue the most recent conversation in the current directory, and claude -r to resume a previous conversation. Claude Code works with git (stage, commit, branch, open PRs). You can put project instructions in CLAUDE.md. Skills, hooks, MCP, sub-agents, GitHub Actions, and GitLab CI/CD are documented product surfaces. Pipe logs into claude -p if you want Unix-style composition.
What Codex CLI is, from OpenAI’s docs
OpenAI’s Codex CLI docs describe a local coding agent that inspects files, makes edits, runs the tools already installed on your machine, and automates repeatable work without leaving the terminal. You stay in control of model, reasoning effort, permissions, and commands. Running codex with no subcommand launches the interactive TUI.
Install on macOS or Linux with curl -fsSL https://chatgpt.com/codex/install.sh | sh. OpenAI also documents a Windows PowerShell installer, npm install -g @openai/codex, Homebrew cask codex, and GitHub release binaries. Open a project directory and run codex. First run: Sign in with ChatGPT or another method OpenAI documents. Config defaults live in ~/.codex/config.toml. Choose model and reasoning effort with /model. Permissions live on /permissions.
The CLI is not only a chat box. Official docs cover /init for AGENTS.md, /status, /review against uncommitted changes, a commit, or a base branch without writing the tree, codex exec for non-interactive scripts and CI, skills and plugins, MCP (codex mcp), live web search (--search), images (--image), session resume (codex resume), subagents, shell completions, and codex cloud to submit work to a configured environment and apply the result locally. That is a strong, documented product. This post does not invent extra capabilities.
Claude Code vs Codex at a glance
| Dimension | Claude Code | OpenAI Codex CLI |
|---|---|---|
| Job | Anthropic’s agentic coding tool: read the repo, edit files, run commands, manage git workflows. | OpenAI’s local coding agent: inspect, edit, run installed tools, automate repeatable terminal work. |
| Primary CLI | claude in a project directory. Also claude "task", claude -p, claude -c, claude -r. | codex launches the TUI. codex exec is the non-interactive path for scripts and pipelines. |
| Other surfaces | IDE extensions (VS Code, Cursor, JetBrains), desktop app, web (claude.ai/code), Slack, GitHub Actions, GitLab CI/CD, as Anthropic documents them. | IDE extension, desktop (codex app), Codex web/cloud, plus codex cloud from the CLI, as OpenAI documents them. |
| Review in-product | You can ask it to review, add hooks, skills, or CI jobs. Review is not a separate product that the author cannot skip. | /review inspects uncommitted work, a commit, or a base branch without writing the tree. Still the same product family. |
| Project memory | CLAUDE.md at the project root, plus auto memory Anthropic documents. | /init can create AGENTS.md. Config defaults in ~/.codex/config.toml. |
| Install | Native installer (curl -fsSL https://claude.ai/install.sh | bash on macOS/Linux/WSL), Homebrew cask, WinGet, or Linux packages. npm is deprecated. | Standalone installer (curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS/Linux), Windows script, npm install -g @openai/codex, Homebrew cask, or a GitHub release binary. |
| Auth and models | Claude subscription or Anthropic Console. Login on first claude, or ANTHROPIC_API_KEY. Terminal CLI and VS Code also support third-party providers. | Sign in with ChatGPT (Plus, Pro, Business, Edu, or Enterprise as OpenAI documents) or another documented method, including API-key setup. /model picks model and reasoning effort. |
| Best fit | You already live in Anthropic’s stack, want CLAUDE.md plus git-native workflows, or you use Claude Code’s extra surfaces. | You already live in OpenAI’s stack, want codex exec and /review, or you use the CLI/cloud loop. |
When Claude Code is the better CLI
Stay on Claude Code if the team already has Claude seats and the agent already matches how you write software. Anthropic’s git workflows, CLAUDE.md, hooks, and Unix-style claude -p composition are the practical reasons, not a vibe about “smarter code.” If you also want the same engine in VS Code, JetBrains, the desktop app, or the browser, Claude Code is one product across those surfaces.
Claude Code is also the default when your constraint is Anthropic-shaped work: you want Claude models as the author, you already maintain CLAUDE.md, or you use Anthropic’s documented CI and chat integrations. Do not switch to Codex because a blog post ranked a benchmark. Switch if you need OpenAI’s loop, not because Claude Code “lost.”
When Codex CLI is the better CLI
Stay on Codex if the team already has ChatGPT or OpenAI API access and you want the local TUI plus codex exec. OpenAI documents /review as a dedicated pass that does not modify the working tree. That is useful. It is still Codex reviewing Codex-shaped work. Treat it as a first-pass lint of the session, not as independent evidence.
Codex is the default when you need scripted, non-interactive runs (codex exec), git checkpoints around a task, plugins and skills in OpenAI’s marketplace shape, or codex cloud handoff from the same CLI. If those are the jobs, keep Codex. Do not install Claude Code as a “reviewer” of Codex. That is a second author, not a second opinion.
What neither CLI solves
Both products can look like they reviewed the change. Claude Code can run tests, hooks, and CI jobs you wire up. Codex can run /review. The writer and the narrator are still the same product family. If your failure mode is “the agent said the tests were green,” adding a second vendor CLI does not fix that. You still need a finish pass that is not the author.
/review on a Codex diff, is useful hygiene. It is not an independent controller. Quiet output is not a correctness proof. Human merge judgment still sits above both tools.If you keep either CLI, add a sidecar
This is the mix-up that wastes a Saturday. If Claude Code or Codex already authors well, do not replace the author. Put an independent finish pass next to it. Critique ships that as the Critique CLI: package @critiquedotsh/cli, binary critique. It is a sidecar reviewer for agents you already run. Docs: Critique CLI.
| You already have | Keep | Add | Binary |
|---|---|---|---|
| Claude Code | claude as the author | @critiquedotsh/cli | critique |
| Codex CLI | codex as the author | @critiquedotsh/cli | critique |
Run the author in the repo on disk. After the session, run critique for an independent finish pass. That is the combine path. Head-to-heads if you later want Critique to author instead: CritiqueCode vs Claude Code and CritiqueCode vs Codex.
CritiqueCode is optional, later
Switch the author only if you want Critique to implement. CritiqueCode is @critiquedotsh/harness, binary critique-code. It is an interactive author session in the repo, then the Author Coordinator forces local review before “done” means anything. Author transcripts are not Evidence. Promotion stays on /review and /ship. Product intro: Introducing CritiqueCode. Install: CritiqueCode docs.
Most teams comparing Claude Code vs Codex should not start there. Pick Anthropic or OpenAI. Keep that CLI. Add the sidecar if you need an independent finish pass. Reach for critique-code later if you want the author loop itself to include a controller the writer cannot skip.
- 1Do you already pay for Claude and like
claudein the repo?Keep Claude Code. Do not switch to Codex for the sake of a comparison table. Add@critiquedotsh/cli(critique) if you want an independent finish pass. - 2Do you already pay for ChatGPT or OpenAI and like
codex?Keep Codex CLI. Usecodex execand/reviewas OpenAI documents them. Addcritiqueas the sidecar if you want a finish pass that is not Codex. - 3Do you need scripted, non-interactive agent runs in CI-shaped workflows?Codex CLI documents
codex execfor that job. Claude Code documentsclaude -pand CI integrations. Match the vendor you already authenticate with. - 4Do you want Critique to author the change, not just review it?That is a later decision. Install
@critiquedotsh/harnessand runcritique-code. Do not install that package as a plugin on Claude Code or Codex.
FAQ
critique as the sidecar if you want an independent finish pass. Switch authors only when you mean to.