A side-by-side of two tools in the same category. Facts come from each vendor's own pages, checked 2026-10-28.
Claude Code is Anthropic's closed-source terminal agent for Claude models. Codex CLI is OpenAI's open-source agent for OpenAI models. Both offer headless runs, MCP, subagents and a sandbox.
Where they differ
Licence. Claude Code is proprietary, and its GitHub repo holds no source. Codex CLI is Apache-2.0.
Sign-in and cost. Claude Code needs a paid Anthropic plan or an API account, and the free claude.ai plan is excluded. Codex CLI signs in with a ChatGPT plan, which has a free tier with usage limits, or uses an OpenAI API key.
Models. Claude Code runs Claude models only, and gateways to other models are unsupported. Codex CLI uses OpenAI models, and OpenAI's pages do not document local models.
Platforms. Claude Code documents git worktrees and phone access through Remote Control, but has no sandbox on native Windows. OpenAI documents a native Windows sandbox for Codex CLI.
Which fits
Pick Claude Code if you pay for Claude and want worktrees, CI integration and phone access.
Pick Codex CLI if you want open-source code, or have a ChatGPT plan and run Windows.