Issue 00 · Autumn 2026日本語 · RSS
AgentKoji

Claude Code vs Cursor vs Codex: What Differs in Practice

Claude Code vs Cursor vs Codex: instruction files, hooks, sandboxes and prices side by side, checked 2026-10-25. Codex Go and Cursor Plus start at $8 a month.

TL;DR

  • Claude Code reads CLAUDE.md (and AGENTS.md when no CLAUDE.md exists), Codex reads AGENTS.md, and Cursor uses .mdc rules in .cursor/rules/ or AGENTS.md.
  • All three have hooks and a sandbox for shell commands; Claude Code's sandbox is off by default, while Codex's default permissions mode applies its sandbox automatically.
  • Paid individual plans start at $20 for Claude Pro and $8 for Codex Go and Cursor Plus, but Cursor Plus runs Grok models only (prices checked 2026-10-25).

Searching “Claude Code vs Cursor vs Codex” mostly turns up feature lists. This comparison starts with a short table of the differences that change daily work, then looks at operations: where the instruction file lives, whether rules can be enforced, and how things break when you run agents in parallel. Specs and prices were rechecked on the official pages on October 25, 2026.

Types and the incidents every tool shares are covered in Choosing a Coding Agent.

The differences at a glance

Claude CodeCursorCodex
Entry price (individual, paid)Pro $20/mo ($17/mo billed annually); Max $100/mo; Ultra $200/mo at the topPlus $8/mo (Grok models only); Ultra $200/mo at the topGo $8/mo; Plus $20/mo; Pro $100, $200 or $500/mo
Instruction fileCLAUDE.md; reads AGENTS.md when no CLAUDE.md exists (v2.1.277+).mdc files in .cursor/rules/, or AGENTS.md in the root and subdirectoriesAGENTS.md (or AGENTS.override.md), global in ~/.codex and per directory from the project root down
HooksYes, in ~/.claude/settings.json, .claude/settings.json or .claude/settings.local.jsonYes, in .cursor/hooks.json or ~/.cursor/hooks.json; exit 2 blocks, other exit codes let the action proceedYes, in hooks.json or [hooks] in config.toml under ~/.codex/ or <repo>/.codex/; project hooks load only when that layer is trusted
SandboxOff by default; /sandbox turns it on. Limits files and network for shell commands only, on macOS, Linux and WSL2 (not native Windows)Runs terminal commands in a restricted environment that blocks unauthorized file access and network activity; Run Mode decides when commands enter it (default: unverified)On by default: the default permissions mode applies it. Modes are read-only, workspace-write (the default for local work) and danger-full-access; covers spawned commands

Sources (all checked 2026-10-25, except claude.com/pricing, rechecked 2026-11-02):

Claude’s pricing page lists Max at $100/mo (5x Pro’s usage every five hours and every week) and Ultra at $200/mo (10x Pro’s usage per week, no five-hour limit for verified accounts); Ultra is the renamed Max 20x. Codex Go is described as “for lightweight coding tasks”; whether Go includes the CLI is (unverified), while Plus lists the web, the CLI, the IDE extension and iOS.

Versions we installed

On our test box (Linux, Node.js v20.19.2), using the official npm packages, checked 2026-10-16. Watch the package names: the bare npm packages claude (self-described as “not the official Claude Code package”) and codex (an unrelated docs generator) are different software, so npx claude runs the wrong thing. How to install the right package is in Getting Started with Claude Code.

$ npx @anthropic-ai/claude-code --version
2.1.301 (Claude Code)
$ npx @openai/codex --version
codex-cli 0.163.0

The npm latest as of 2026-10-25 is 2.1.310 for @anthropic-ai/claude-code and 0.164.0 for @openai/codex. We did not rerun the commands above on those versions.

We did not install the Cursor CLI. Cursor details come from its official pages only.

Instruction files

The table above shows which file each tool reads. If you use more than one tool, keep shared rules in AGENTS.md and import it from CLAUDE.md with @AGENTS.md, as the Claude Code docs suggest (https://code.claude.com/docs/en/memory, checked 2026-10-25). Codex stops adding instruction files once the combined size reaches project_doc_max_bytes, 32 KiB by default, so split long instructions across nested directories (https://learn.chatgpt.com/docs/agent-configuration/agents-md, checked 2026-10-25). Claude Code’s /init reads Cursor rules in .cursor/rules/ or .cursorrules when it generates a CLAUDE.md (same Claude Code source).

How far we cut ours: trimming CLAUDE.md.

Enforcement: hooks

Claude Code’s docs say CLAUDE.md is context, not enforced configuration; to block an action, use a PreToolUse hook (https://code.claude.com/docs/en/memory, checked 2026-10-25). Cursor and Codex both have hooks too, as the table shows.

We check commit format with a hook. The hook itself misfired: heredoc commit messages reached it truncated at 200 bytes. We now write the message to a file and pass it with git commit -F.

printf '%s\n' "fix: validate input" "" "details..." > /tmp/msg.txt
git commit -F /tmp/msg.txt

Exit codes and the commands that slipped through: Claude Code hooks in practice.

Parallel runs: the API sets the ceiling

We started 16 subagents and all of them died on a 429 at nearly the same moment. Restarting all 16 repeats the failure. Now we resume only the missing ones and launch in two waves of 8–10.

Claude Code’s docs list recommended TPM/RPM per user by team size (1–5 users: 200k–300k TPM, 5–7 RPM) (https://code.claude.com/docs/en/costs, checked 2026-10-25). Codex publishes estimated local messages per five hours for Plus and Standard Business; Pro currently has no five-hour limit (https://learn.chatgpt.com/docs/pricing, checked 2026-10-25).

How we recover the ones that died: subagent failures.

Review: fix the output format

When a second model reviews code, make it label each earlier finding as keep, downgrade or withdraw. Without that, old findings come back every round dressed as new ones. Grep any facts in the brief before you send it. Codex ships a review subcommand (seen in codex --help, v0.163.0).

How many rounds to run: when to stop review.

For using a second model to rebut a design before any code exists, see Have Another AI Rebut Your Design.

Entry prices: what the headline hides

The plan prices are in the table at the top. Cursor is sold as part of X’s “X Subscription”, and the pricing page also lists Grok and X features. Two caveats: Plus ($8) includes Grok models only, and on Premium and above, third-party models (Claude, GPT and others) are not included in the flat price; they are billed at API list price. The former Pro ($20) and Pro+ ($60) plans continue only as legacy plans for existing customers (https://cursor.com/pricing and https://cursor.com/help/account-and-billing/pricing, checked 2026-10-25). If you mainly want Claude models, don’t compare on the headline price alone.

All prices are USD and exclude tax. Prices change every few months; check before you subscribe. More on costs in What Claude Code Really Costs and Cursor Pricing and How to Choose.

Summary

FAQ

What is the difference between Claude Code, Cursor and Codex?
They differ in the instruction file each reads, where hooks live, and how the sandbox starts. Claude Code reads CLAUDE.md, Codex reads AGENTS.md, and Cursor uses .cursor/rules/ or AGENTS.md. Claude Code's sandbox is off until you turn it on; Codex's default permissions mode applies its sandbox automatically.
Which is cheaper, Claude Code, Cursor or Codex?
The cheapest paid individual plans are Codex Go and Cursor Plus at $8 a month, and Claude Pro at $20 ($17 a month billed annually). Cursor Plus includes Grok models only, and on Premium and above third-party models such as Claude and GPT are billed at API list price. Compare on the models you plan to use, not the headline price.
Does Cursor read CLAUDE.md or AGENTS.md?
Cursor's rules docs list AGENTS.md in the project root and in subdirectories as a simple alternative to .cursor/rules. The same page doesn't mention CLAUDE.md. Keeping shared rules in AGENTS.md and importing it from CLAUDE.md with @AGENTS.md covers all three tools.
Do Cursor and Codex have hooks like Claude Code?
Yes. Cursor reads hooks.json from .cursor/ in the project or ~/.cursor/, and exit code 2 blocks the action. Codex reads hooks.json or [hooks] tables in config.toml under ~/.codex/ or the repo's .codex/, and non-managed hooks must be reviewed and trusted before they run.