Claude Code vs Codex
Claude Code is Anthropic's agentic coding tool: it reads your codebase, edits files and runs commands, in the terminal and beyond, driven by Claude models; Codex is OpenAI's open-source coding agent for the terminal, which inspects code, makes changes and runs commands with OpenAI's models. Side by side, with every command checked.
Updated November 23, 2026 · Checked against Claude Code 2.1.308 and Codex 0.157.1 in EnvHaven v1.9.0
| Claude Code | Codex | |
|---|---|---|
| Made by | Anthropic | OpenAI |
| Kind | Coding agent | Coding agent |
| Open source | No | Yes, Apache-2.0 |
| Models | Anthropic models | OpenAI models |
| Install | curl -fsSL https://claude.ai/install.sh | bash | curl -fsSL https://chatgpt.com/codex/install.sh | sh |
| Full-access switch | claude --dangerously-skip-permissions | codex --dangerously-bypass-approvals-and-sandbox |
| Instructions file | CLAUDE.md, .claude/CLAUDE.md | AGENTS.md, AGENTS.override.md |
| Add an MCP server | claude mcp add | codex mcp add |
| Headless | claude -p | codex exec |
| Version checked | 2.1.308 | 0.157.1 |
How to choose
- Pick Codex if you want to read, audit or modify the agent itself: it is open source under Apache-2.0.
- If you already pay for a plan from Anthropic, Claude Code is the natural start: Claude Pro, Max, Ultra, Team and Enterprise plans sign in through claude.ai; API keys bill per token.
- If you already pay for a plan from OpenAI, Codex is the natural start: ChatGPT Plus and Pro include Codex in the CLI, as do Business and Enterprise workspaces; API-key sessions bill at API rates.
- Not sure? Run both on the same task. An EnvHaven workspace has both built in: sign in to each once from the Launch menu, give them the same prompt in two terminal windows side by side, and compare, so the comparison costs one prompt each.
Claude Code in detail
Anthropic’s agentic coding tool: it reads your codebase, edits files and runs commands, in the terminal and beyond, driven by Claude models. Bypass mode runs every tool without asking, with two exceptions worth knowing. Claude Code refuses it as root or under sudo (“--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons”) unless it detects a recognized sandbox, and it ignores the setting in a project’s .claude/settings.json. rm on critical paths still asks, with a two-minute countdown before it denies.
More: Claude Code setup and commands, its full-access mode.
Codex in detail
OpenAI’s open-source coding agent for the terminal, which inspects code, makes changes and runs commands with OpenAI’s models. The flag turns off approvals and the sandbox together; its help calls it “EXTREMELY DANGEROUS” and meant for environments that are already sandboxed, and OpenAI’s docs recommend full access inside Docker for that reason. Quote the values in config.toml: an unquoted never fails with “Error loading config.toml”. Administrators can forbid both values through requirements.toml.