Claude Code vs Codex CLI | Choosing by Price, Model, and Speed

When it comes to "agentic CLIs" that let you delegate coding work to AI from your terminal, Anthropic's Claude Code and OpenAI's Codex CLI are effectively the two dominant players. This article references official documentation as of May 2026 to compare them across 5 axes — pricing, models, CLI experience, IDE integration, and automation features — and shows which to choose based on your use case.

AI Chat Article Summarypowered by Claude
結論powered by Claude

If you want to delegate long-running autonomous tasks or large-scale refactoring, Claude Code is the top pick. With a 1M token context, scheduled execution via Routines on Anthropic-managed infrastructure, and mobile continuity via Remote Control, it has everything you need to run a task all the way to completion.

If you already have a ChatGPT subscription and want to get started lightly, Codex CLI has the advantage. Built in Rust for fast startup, it's included at no additional charge with any ChatGPT Plus / Pro / Business / Edu / Enterprise plan, and its exec command makes it easy to embed in scripts.

The fastest way to make your final decision is hands-on testing with the free tier on your own repo. Pricing and models update rapidly, so always check the latest specs in both providers' official documentation before committing.

目次 (10)

About the Sources in This Article

  • Claude Code (Anthropic) information: Official documentation at code.claude.com, referenced on 2026-05-19.
  • Codex CLI (OpenAI) information: Official documentation at developers.openai.com/codex/cli and GitHub repository openai/codex, referenced on 2026-05-19. Pricing and models change quickly — always verify the current specs on the official site.

Positioning Claude Code and Codex CLI

Claude Code is an agentic coding environment from Anthropic. The terminal CLI, VS Code extension, JetBrains plugin, desktop app, and browser version (claude.ai/code) all share the same engine, and CLAUDE.md, settings, and MCP servers work across all of them. Source

Codex CLI is a terminal-resident coding agent from OpenAI. Built in Rust, it reads and writes files and executes commands within a specified directory on your local PC. It comes with IDE extensions for VS Code, Cursor, and Windsurf, a desktop UI launched via codex app, and a browser version (chatgpt.com/codex). Source

The four things both share: "you can hand off coding work to AI from the terminal," "you can continue the same session across multiple surfaces (CLI / IDE / Desktop / Web)," "you can run tasks in parallel with sub-agents," and "both support MCP." The differences center on pricing, supported models, scheduled execution, and mobile support.

Pricing Plan Comparison — Subscriptions and Account Linking

Claude Code is used with a Claude subscription (Pro / Max) or an Anthropic Console account. The terminal CLI and VS Code also support switching to models via third-party providers. For the latest plans and pricing, check the Claude official pricing page. Source

Codex CLI is included with any ChatGPT Plus / Pro / Business / Edu / Enterprise plan at no additional charge. On first launch, you sign in with your ChatGPT account or authenticate with an API key. Source

If you're already paying for ChatGPT, you can start using Codex CLI right away at zero additional cost. Users without an Anthropic subscription who want to use Claude Code's full feature set will need a Claude Pro subscription or higher.

The table below shows approximate monthly pricing for representative plans (as of 2026-05, in USD). Prices change frequently, so always check the current pricing on each provider's official pricing page before subscribing.

Plan Approx. Monthly (USD) Primary Use
Claude Pro ~$20 Minimum setup for individual Claude Code use
Claude Max (5×) ~$100 Higher-tier plan with significantly expanded usage
Claude Max (20×) ~$200 Maximum usage. For heavy autonomous tasks
ChatGPT Plus ~$20 Standard plan that includes Codex CLI
ChatGPT Pro ~$200 Maximum usage. For heavy Codex users

The table above shows representative estimates as of 2026-05 and may vary due to exchange rates, plan revisions, Business / Edu / Enterprise tiers, and annual discounts. Always confirm final pricing at Claude official pricing and ChatGPT official pricing. Broadly speaking, the structure is the same for both: start with the ~$20/month entry plan to try it out, and move to the $100–$200 tier for serious autonomous task workloads.

Models and Performance — Opus 4.8 vs GPT-5-Codex

Claude Code uses Anthropic's latest model lineup. As of May 2026, the flagship has been updated to Claude Opus 4.8, with a 1M token context window and a maximum output of 128k tokens. It's the latest generation, with further improvements in coding accuracy over the previous Opus 4.7 (GA in April 2026, CursorBench 70%). You can also switch to the balanced Sonnet 4.6 or the fastest Haiku 4.5 from the same CLI. Source

Codex CLI gives access to Codex-dedicated GPT-5-series models through a ChatGPT subscription. The CLI provides a UI for switching models, and supports image input and web search. Source

Direct benchmark comparisons aren't apples-to-apples, so the most practical evaluation method is: submit the same 5 tasks on your own repo and see which one produces more PR-ready results. Claude Opus 4.8 tends to excel at refactoring long, complex dependency chains, while Codex's GPT-5-series tends to shine at fast responses on short tasks and code generation combined with web search.

CLI Experience and Commands — From Installation to First Run

Claude Code's quickest setup on macOS / Linux / WSL is a single line:

curl -fsSL https://claude.ai/install.sh | bash
cd your-project
claude

It also supports Homebrew (brew install --cask claude-code), WinGet (winget install Anthropic.ClaudeCode), apt, dnf, and apk. Native installations update automatically in the background. Source

Codex CLI is also a single line:

npm install -g @openai/codex
codex

It also supports Homebrew (brew install --cask codex) and direct binary downloads from GitHub Releases. Being Rust-based, it starts up quickly and runs lean. Source

Both can be embedded in scripts via exec-style subcommands from the CLI. Claude Code emphasizes Unix pipe philosophy, allowing claude -p "..." to receive stdin for batch processing. Codex CLI offers similar script execution via codex exec.

IDE Integration — VS Code, Cursor, and JetBrains Support

Claude Code provides official extensions for VS Code, Cursor, and JetBrains IDEs (IntelliJ / PyCharm / WebStorm). The VS Code extension lets you view inline diffs, use @-mentions, review Plans, and access conversation history — all within the editor. The JetBrains plugin supports interactive diff views and sharing selected context. Source

Codex CLI supports IDE integration for VS Code, Cursor, and Windsurf. Official JetBrains support is not explicitly mentioned as of this writing, so if JetBrains is your primary environment, Claude Code has the advantage. Source

Agent Features — MCP, Sub-Agents, and Hooks

Both support Model Context Protocol (MCP), allowing AI to call Google Drive, Jira, Slack, and custom tools.

In addition to MCP, Claude Code provides a full stack: Skills (reusable workflows), Hooks (insert shell commands before/after tool execution), sub-agents (parallel execution of multiple agents), and Agent SDK (build custom agents). The ability to persist project-specific instructions via CLAUDE.md and auto memory is another unique strength. Source

Codex CLI also supports parallel execution via sub-agents and lets you control permissions for edits and command execution at a granular level via Approval modes. MCP, image input, web search, and code review are all built in. Source

If your needs include "embedding custom skills/hooks for team distribution" or "keeping cross-session learning with auto memory," Claude Code is the better fit. If you just want to run parallel tasks with minimal setup, Codex CLI gets the job done with fewer steps.

Scheduled Execution and Automation — Routines vs exec Scripts

Claude Code offers Routines, enabling cron-style scheduled execution on Anthropic-managed infrastructure. It keeps running even when your local PC is off, and can be triggered by API calls or GitHub events. You can create them from the Web, desktop app, or /schedule within the CLI. If you want to run locally, Desktop scheduled tasks and /loop are also options. Source

Codex CLI does not explicitly offer an equivalent to cloud-resident Routines as of this writing. The typical setup is to embed codex exec in a shell script and call it from cron, launchd, or GitHub Actions.

If you want automation like "run a morning PR review even when my PC is asleep" or "automatically analyze CI failure logs overnight," Claude Code is far easier for fully cloud-resident automation.

Mobile and Remote Access — Remote Control and iOS App

Claude Code supports Remote Control to operate sessions from your smartphone while on the go. With Dispatch, you can submit tasks from your iPhone and have a session start on your desktop. The claude --teleport command lets you hand off tasks started in a browser or iOS app to the terminal, and there's even Slack @Claude mention integration that returns PRs. Source

You can build similar flows with Codex CLI's browser version (chatgpt.com/codex) or the ChatGPT mobile app, but an equivalent dedicated feature for "real-time control of a local CLI session from your smartphone" — like Remote Control — is not explicitly documented.

Which Should You Choose? — Best Pick by Use Case

Here's a summary table of the key decision criteria.

Priority Recommendation
Already have ChatGPT Plus/Pro, want to start at no extra cost Codex CLI
Already have Claude Pro/Max, want full feature access Claude Code
Want to pass a massive context with 1M tokens at once Claude Code
Want official IDE integration for JetBrains Claude Code
Want cloud-resident Routines for scheduled execution Claude Code
Want mobile continuity via smartphone Remote Control Claude Code
Prioritize fast startup and lightweight Rust implementation Codex CLI
Want to combine GPT-5-series models with web search Codex CLI
Want full automation through Slack / GitHub Actions / GitLab CI Claude Code

If you're unsure, the fastest way to decide is to run the same 3 tasks on your own repo using both free tiers. Pricing and models update rapidly, and the figures in this article will become outdated over time. Always check the latest specs in the official documentation (Claude Code: code.claude.com, Codex CLI: developers.openai.com/codex/cli) before subscribing.

参考になったら ♡
Clauder Navi 編集部
@clauder_navi

Anthropic の Claude / Claude Code を中心に、日本のエンジニア向けに最新動向と実務 を毎日発信。 運営方針 は メディアについて をご覧ください。