Skip to content
HUIAHUB

ComparisonCoding & dev tools

Claude Code vs Codex CLI: plans, limits, sandbox and license compared

Compare Claude Code vs Codex CLI on plans, usage limits, install commands, sandboxing and license, from each vendor's docs as of 13 November 2026.

Edited by Published 9 min read21 sources
Two blank developer tool panels flank a balance scale, surrounded by symbols for security, documents, usage limits and installation.

Illustration generated with ChatGPT

For Claude Code vs Codex CLI, the deciding facts are the subscription you already pay for, the sandbox default and the license. Claude Code is Anthropic's terminal agent, included in Claude Pro and the plans above it, with its sandbox off by default and an all-rights-reserved license. Codex CLI is OpenAI's agent, included in ChatGPT plans, sandboxed by default and released under Apache-2.0.

Every plan, price, command and default here comes from Anthropic's and OpenAI's own docs, pricing pages and GitHub repositories, as published on 13 November 2026. Nothing was run or timed for this article, so it has no benchmarks or speed figures.

What are Claude Code and Codex CLI?

Anthropic makes Claude Code. Its docs describe an agentic coding tool that reads your codebase, edits files, runs commands and works with your development tools. It runs in the terminal, in VS Code and JetBrains IDEs, in a desktop app and on the web. HuiaHub keeps a page on Claude Code's plans, price and what it does.

OpenAI makes Codex CLI. Its docs pitch it as a way to inspect code, change it, run commands and automate repeated work from the terminal. The source lives in the openai/codex repository. OpenAI's pricing page lists Codex on the web, in the CLI, in an IDE extension and on iOS for Plus subscribers.

Claude Code vs Codex CLI side by side

Read on 13 November 2026. Each row names the page it comes from. Prices are in US dollars per month.

Claude CodeCodex CLISource
MakerAnthropicOpenAIEach vendor's docs
Cheapest individual plan that includes itPro, $20 billed monthly or $17 a month billed annually ($200 up front)Plus, $20; OpenAI's pricing page also lists Free ($0) and Go ($8), whose cards name only the desktop appclaude.com/pricing; learn.chatgpt.com/docs/pricing
Higher individual plansMax $100, Ultra $200Pro from $100 ($100, $200 or $500)Same pricing pages
Team planTeam Standard seat $20 billed annually, $25 monthlyBusiness $20 per user billed annually (2+ users), $25 monthlySame pricing pages
Five-hour limitPro 1x, Max 5x, Ultra none for verified accountsEstimates for Plus and Standard Business; Pro currently noneSame pricing pages
Weekly limitPro 1x, Max 5x, Ultra 10x"Weekly limits may also apply"Same pricing pages
API key useANTHROPIC_API_KEY or an Anthropic Console accountcodex login --with-api-key, billed at API ratescode.claude.com/docs/en/overview; learn.chatgpt.com/docs/auth
Install on macOS and Linuxcurl -fsSL https://claude.ai/install.sh | bash or Homebrewcurl -fsSL https://chatgpt.com/codex/install.sh | sh, npm or Homebrewcode.claude.com/docs/en/overview; learn.chatgpt.com/docs/codex/cli
Install on WindowsPowerShell or CMD script, or WinGetPowerShell scriptSame install pages
Sandbox defaultOffSandboxing applied by the default permissions modecode.claude.com/docs/en/sandboxing; learn.chatgpt.com/docs/sandboxing
Sandbox on native WindowsNo, commands run unsandboxed (use WSL2)Yes, native Windows sandboxSame sandboxing pages; learn.chatgpt.com/docs/windows/windows-sandbox
Instruction fileCLAUDE.md, reads AGENTS.md when no CLAUDE.md existsAGENTS.mdcode.claude.com/docs/en/memory; learn.chatgpt.com/docs/agent-configuration/agents-md
LicenseLICENSE.md: all rights reserved, Commercial Terms of ServiceApache License 2.0github.com/anthropics/claude-code; github.com/openai/codex

Which plans include each agent, and how do the usage limits work?

Anthropic's pricing page (opens in a new tab) marks Claude Code "No" on Free and "Yes" on Pro, Max and Ultra. The Team plan lists "Claude Code and Claude Cowork". Enterprise costs US$20 a seat per month, billed annually with a 20-seat minimum, plus usage at API rates.

Claude's limits come in two rows: one every five hours and one every week. Pro is the 1x baseline for both. Max gets 5x on each. Ultra has no five-hour limit for verified accounts and 10x the weekly allowance. Anthropic says how fast you reach a limit depends on the model, the length of your chats and the size of your files.

On the Team plan, a Premium seat ($100 billed annually, $125 monthly) gets 5x the usage of a Standard seat.

OpenAI's Codex pricing page (opens in a new tab) says ChatGPT Work and Codex are included in the Free, Go, Plus, Pro, Business, Edu and Enterprise plans. The Free and Go cards name only the desktop app, and the Plus card names the CLI. Enterprise and Edu have no listed price.

OpenAI publishes limits as estimates of local messages per five-hour period for Plus and Standard Business, varying by model. For Plus, GPT-6.1 Sol shows 15-160 messages per five hours. Pro plans currently have no five-hour limit, and weekly limits may apply on top. The Plus and Business plan cards both say "Flexibly extend usage with ChatGPT credits".

Model names change fast in Codex. The pricing page says GPT-5.5 retired from Codex with ChatGPT sign-in on October 14, 2026, and lists GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna as of 13 November 2026.

How do you install each one on macOS, Linux and Windows?

Install Claude Code

Anthropic's overview lists a native installer as the recommended route:

# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

The alternatives are brew install --cask claude-code and winget install Anthropic.ClaudeCode. Debian, Fedora, RHEL and Alpine users can install with apt, dnf or apk. The claude-code repository README (opens in a new tab) marks npm install -g @anthropic-ai/claude-code as deprecated.

Native installs update themselves in the background. Homebrew and WinGet installs do not, so you run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode. On native Windows, Anthropic recommends Git for Windows so Claude Code can use its Bash tool; without it, PowerShell is the shell. Start a session with claude in a project folder.

Install Codex CLI

OpenAI's CLI page gives four routes:

# macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# npm
npm install -g @openai/codex

# Homebrew
brew install --cask codex
# Windows, in a new PowerShell window
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Run codex in a project folder and choose a sign-in method on first launch. The repository also publishes release binaries for Apple silicon and Intel Macs and for x86_64 and arm64 Linux. Both vendors' script installs pipe a remote script into a shell, so read the script first if your policy requires it.

How do permissions and sandboxing differ?

The two agents split safety into the same two parts: approval rules decide when the agent asks, and an operating-system sandbox limits what a shell command can touch. The defaults differ.

Claude Code: approval modes first, sandbox opt-in

Claude Code has six permission modes: default (labeled Manual), acceptEdits, plan, auto, dontAsk and bypassPermissions. In Manual mode, file reads inside the working directory need no approval, while shell commands and file edits do, apart from a built-in set of read-only commands. You manage allow, ask and deny rules with /permissions, and Claude Code checks them in that order: deny, then ask, then allow.

The Claude Code sandbox (opens in a new tab) is off by default. You turn it on with /sandbox or by setting sandbox.enabled to true. It uses Seatbelt on macOS and bubblewrap on Linux and WSL2, which also need socat. On native Windows, commands run unsandboxed. The sandbox covers shell commands, not Claude's file tools, MCP servers or hooks.

Inside it, writes are limited to the working directory, a temp directory and folders you add. Reads still reach most of the machine, including ~/.ssh. Network traffic goes through a local proxy, and the list of allowed domains starts empty.

Codex CLI: sandbox on from the start

Codex has three sandbox modes: read-only, workspace-write and danger-full-access. Its approval policies are on-request and never, and untrusted is no longer selectable. In a version-controlled folder, Codex recommends the Auto preset, which is workspace-write with on-request approvals. Other folders get read-only.

In workspace-write, the agent can read files, edit inside the workspace and run routine commands within that boundary. Network access is off unless you set network_access = true under [sandbox_workspace_write] in the config. The Codex sandboxing docs (opens in a new tab) name Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native Windows sandbox in PowerShell.

The flag --dangerously-bypass-approvals-and-sandbox, alias --yolo, removes both layers. OpenAI does not recommend it. For container and network patterns that apply to either agent, see the HuiaHub guide to sandboxing AI coding agents with permissions, containers and network limits.

CLAUDE.md vs AGENTS.md: where project instructions go

Claude Code reads CLAUDE.md from ./CLAUDE.md or ./.claude/CLAUDE.md, plus ~/.claude/CLAUDE.md for personal rules and a gitignored CLAUDE.local.md. Files from the root down to your working directory are joined, not overridden. /init drafts a starting file.

From v2.1.277, Claude Code reads AGENTS.md directly when your project has no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md. When both kinds exist, it reads only the CLAUDE.md files by default. The setting value claude-md-and-agents-md loads both.

Codex reads AGENTS.md, or AGENTS.override.md if present, from ~/.codex first. It then walks from the project root to the current directory, taking at most one file per folder and joining them, so closer files come later. It stops at 32 KiB by default (project_doc_max_bytes). /init creates an AGENTS.md.

Rules in these files steer the model, but Anthropic's docs note that permission rules, not CLAUDE.md, decide what Claude Code may do. To enforce a check on every edit, a hook is the tool; see running formatters, tests and guards with Claude Code hooks.

Skills, plugins and MCP servers in each agent

Both agents use SKILL.md folders and cite the open Agent Skills standard. The folders differ:

Claude CodeCodex CLI
Project skills.claude/skills/<skill-name>/SKILL.md.agents/skills, scanned from the working directory up to the repo root
Personal skills~/.claude/skills/<skill-name>/SKILL.md$HOME/.agents/skills
Run a skill/skill-name, or Claude picks it/skills or a $ mention, or Codex picks it
PluginsBundle skills, called as /plugin-name:skill-nameInstallable bundles of skills and MCP servers

For the install steps in each tool, see how to install skills in Codex, Cursor, Gemini CLI, Claude Code and more.

Both connect to Model Context Protocol (MCP) servers. Codex adds one with codex mcp add <server-name> -- <stdio server-command> and stores it under [mcp_servers.<server-name>] in ~/.codex/config.toml. Codex supports STDIO and streamable HTTP servers. For the Claude Code side, read how to connect Claude Code MCP servers and keep them safe.

Is either one open source?

Codex CLI is open source. The Codex LICENSE file (opens in a new tab) is the Apache License, Version 2.0, with the line "Copyright 2025 OpenAI".

Claude Code is not open source. Its repository's LICENSE.md names Anthropic PBC as the owner, says "All rights reserved." and makes use subject to Anthropic's Commercial Terms of Service. The public repo holds the changelog, examples and plugins, and only collaborators can open pull requests.

Pick Claude Code if, pick Codex CLI if

Pick Claude Code ifPick Codex CLI if
You already pay for Claude Pro, Max, Ultra or a Team seat, all of which list Claude CodeYou already pay for ChatGPT Plus, Pro or Business, which list Codex
Your repo already has CLAUDE.md, .claude/skills or Claude Code hooksYour repo already has AGENTS.md or .agents/skills
You want WinGet, apt, dnf or apk packagesYou want an npm package that is not deprecated
You want six named permission modes with deny, ask and allow rulesYou want a sandbox applied by default
You work on macOS, Linux or WSL2, where the sandbox runsYou want a sandbox on native Windows without WSL2
A proprietary license under commercial terms suits youYou need Apache-2.0 source you can read, fork and modify

Frequently asked questions

Can you use Claude Code and Codex CLI in the same repository?

Yes. Codex reads `AGENTS.md`, and Claude Code reads the same `AGENTS.md` when the repo has no `CLAUDE.md`. If you keep a `CLAUDE.md` too, Anthropic's memory docs describe importing `AGENTS.md` from it so both agents share one set of instructions. Skills still need separate folders: `.claude/skills` for Claude Code and `.agents/skills` for Codex.

Can you use an API key instead of a subscription?

Both allow it. Claude Code skips the login prompt when you set `ANTHROPIC_API_KEY` and approve the key, and Anthropic Console accounts work in place of a Claude plan. Codex takes a key with `printenv OPENAI_API_KEY | codex login --with-api-key`, bills it through your OpenAI Platform account at standard API rates, and drops cloud features such as GitHub code review and Slack.

Does the free Claude or ChatGPT plan include a terminal agent?

Anthropic's pricing table marks Claude Code "No" on the Free plan. OpenAI lists Codex for ChatGPT Free and Go, but those plan cards name only GPT-6 Luna in the desktop app, subject to rollout. The Plus card lists the CLI.

Does either agent work with models from other providers?

Anthropic's overview says the Claude Code terminal CLI, VS Code and JetBrains support third-party providers. OpenAI's pricing page says that with an API key, Codex model availability follows the API models available to that key.

Sources

  1. 1.codex/LICENSE at main · openai/codex · GitHubRepositoryPrimarygithub.com
  2. 2.Codex CLI | ChatGPT LearnWeblearn.chatgpt.com
  3. 3.Sandbox | ChatGPT LearnOfficial docsPrimarylearn.chatgpt.com
  4. 4.Pricing | ChatGPT LearnOfficial docsPrimarylearn.chatgpt.com
  5. 5.learn.chatgpt.com/docs/auth.mdWeb
  6. 6.learn.chatgpt.com/docs/codex/cli.mdWeb
  7. 7.learn.chatgpt.com/docs/agent-approvals-security.mdWeb
  8. 8.learn.chatgpt.com/docs/windows/windows-sandbox.mdWeb
  9. 9.code.claude.com/docs/en/memoryWeb
  10. 10.learn.chatgpt.com/docs/agent-configuration/agents-mdWeb
  11. 11.Extend Claude with skills - Claude Code DocsOfficial docsPrimarycode.claude.com
  12. 12.learn.chatgpt.com/docs/build-skills.mdWeb
  13. 13.Skills & Plugins | ChatGPT LearnWeblearn.chatgpt.com
  14. 14.learn.chatgpt.com/docs/extend/mcp.mdWeb
  15. 15.raw.githubusercontent.com/anthropics/claude-code/main/LICENSE.mdWeb
  16. 16.Overview - Claude Code DocsOfficial docsPrimarycode.claude.com
  17. 17.Configure permissions - Claude Code DocsWebcode.claude.com
  18. 18.Configure the sandboxed Bash tool - Claude Code DocsOfficial docsPrimarycode.claude.com
  19. 19.Plans & pricing | Claude by AnthropicWebclaude.com
  20. 20.GitHub - anthropics/claude-code: Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complexRepositoryPrimarygithub.com
  21. 21.GitHub - openai/codex: Lightweight coding agent that runs in your terminal · GitHubRepositoryPrimarygithub.com

Spotted an error? See our corrections policy.

Enjoyed this? Get the weekly brief.

New guides, Project & Tool of the Week and the AI developments that matter. One email, no spam.

Read next

More on these topics