Claude Code vs Codex is the question most developers ask once they move past chat and want an agent that does real work in a codebase. Both read your project, edit several files, run commands and work with git. Claude Code is Anthropic's agent and runs in the terminal, in VS Code, Cursor and JetBrains, in a desktop app and in the browser. Codex is OpenAI's agent and runs in the terminal, in VS Code, Cursor and Windsurf, in a desktop app and as a cloud agent. (Claude Code Docs: Overview (opens in a new tab); OpenAI Codex README (GitHub) (opens in a new tab))

This guide compares the two from their own documentation plus three independent breakdowns of prices and limits checked in October and November 2026. It does not crown one model as smarter. Prices and limits change often, so check the final numbers on each plan page before you pay.

How Claude Code works

Anthropic describes Claude Code as an agent that reads your codebase, edits files, runs commands and plugs into your tools. It stages changes, writes commit messages, creates branches and opens pull requests. It reads a CLAUDE.md file in your project at the start of every session, and it can read an AGENTS.md file instead if your repository already has one for other agents. (Claude Code Docs: Overview (opens in a new tab))

The extras are where Claude Code goes deepest. Skills package repeatable workflows as commands, hooks run your own shell commands before or after its actions, subagents split a task across several agents at once, and MCP connects outside tools like Jira, Slack or Google Drive. It can also run on a schedule in the cloud, review pull requests in GitHub Actions and take tasks from Slack. (Claude Code Docs: Overview (opens in a new tab))

1. Install Claude Code

On macOS, Linux or WSL, run the command below in a terminal. On Windows PowerShell, run irm https://claude.ai/install.ps1 | iex instead. Homebrew and WinGet work too. Open a new terminal and run claude --version to check it worked.

Install and start Claude Code (official docs)

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

cd your-project
claude

2. Log in

Claude Code asks you to log in on first use. Most surfaces need a Claude subscription or an Anthropic Console account, and the desktop app needs a paid plan. If you prefer to skip the terminal, the browser version lives at claude.ai/code and also works in the Claude app for iOS and Android.

How Codex works

OpenAI's README calls the Codex CLI a coding agent that runs locally on your computer. The recommended way in is Sign in with ChatGPT, which the README says is included with Plus, Pro, Business, Edu and Enterprise plans. An API key also works but needs extra setup. Besides the CLI, there is an IDE extension for VS Code, Cursor and Windsurf, a desktop app you can open with codex app, and Codex Web at chatgpt.com/codex, a cloud agent that works separately from the CLI. (OpenAI Codex README (GitHub) (opens in a new tab))

The Codex CLI is open source under the Apache 2.0 license. ContextBolt notes that the Claude Code repository is public but not open source, since its license reserves all rights. ContextBolt also calls the Codex cloud flow the more direct of the two for handing off tasks on GitHub repositories that run while your computer is off. (OpenAI Codex README (GitHub) (opens in a new tab); ContextBolt: Claude Code vs Codex (opens in a new tab))

3. Install Codex

On a Mac or Linux, paste the first command into a terminal, then type codex and choose Sign in with ChatGPT. On Windows, the README gives a PowerShell command. npm and Homebrew also work.

Install commands from the Codex README

# Mac or Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# npm
npm install -g @openai/codex

# Homebrew
brew install --cask codex

Claude Code vs Codex: what each one costs

Claude Code is included in paid Claude plans. Morph and ContextBolt both list Pro at $20 a month, or $17 a month billed yearly, Max at $100 with five times the Pro usage, and Ultra at $200 with ten times the Pro weekly usage. Morph says Ultra drops the five hour limit for verified accounts and that the free Claude plan does not include Claude Code. Both say Claude Code now defaults to Claude Opus 5.5. (Morph: Claude Code vs Codex pricing and limits (opens in a new tab); ContextBolt: Claude Code vs Codex (opens in a new tab))

Codex comes with ChatGPT plans. Morph and ContextBolt list Go at $8 a month, Plus at $20, Pro in three tiers at $100, $200 and $500, and Business at $25 per user a month or $20 billed yearly. ContextBolt reports that Free and Go users get only a smaller model in the desktop app, still rolling out, so Plus is the real starting point for most people. (Morph: Claude Code vs Codex pricing and limits (opens in a new tab); ContextBolt: Claude Code vs Codex (opens in a new tab))

How the limits work

Both companies meter usage in windows rather than by message. Claude has a session limit that resets every five hours plus a weekly limit across all models, according to SessionWatcher and Morph. On the Codex side, Plus has a five hour limit, while Pro currently has none, though OpenAI says weekly limits may still apply. OpenAI publishes estimates of how many messages fit in a window but says they depend on the model and the size of the task. (Morph: Claude Code vs Codex pricing and limits (opens in a new tab); SessionWatcher: Claude Code vs Codex (opens in a new tab))

Tip: SessionWatcher's advice for heavy users is to run both, because the two limits reset on separate clocks. Two $20 plans can stretch further than one plan at $100.

Which one to pick

Pick Codex if you already pay for ChatGPT Plus, want an open source CLI you can inspect, or like the idea of handing a task to the cloud and coming back to a finished pull request. The IDE extension also covers Windsurf, which the Claude Code overview does not list.

Pick Claude Code if you want to shape the agent around your project with CLAUDE.md, hooks, skills and subagents, or if you work in JetBrains IDEs. It also suits long, multi step work in one repository, which is the use ContextBolt recommends it for.

What neither one does well: both will change more than you asked if the request is vague. Ask for a plan first, keep each task small, read every diff before you accept it, and keep the project in git so a bad edit is one command away from undone.