Codex CLI is OpenAI's terminal-based coding agent, similar to Claude Code but powered by GPT models.
Sandboxing is on by default. Expect restricted filesystem + network access until you explicitly lift restrictions per task.
# npm
npm install -g @openai/codex
# Homebrew
brew install --cask codex
export OPENAI_API_KEY=sk-...
codexCodex CLI reads your project structure, understands your codebase, and can:
| Feature | Codex CLI | Claude Code |
|---|---|---|
| Model | OpenAI current flagship | Claude Sonnet/Opus |
| Provider | OpenAI | Anthropic |
| MCP support | No (as of 2026-04-17) * | Yes (native) |
| Background agents | No | Yes |
| Config file | None (use AGENTS.md) | CLAUDE.md |
| Sandboxing | Sandboxed by default | Configurable |
* Verified 2026-04-17 against the github.com/openai/codex README, which does not mention MCP support. Re-check OpenAI's platform docs for updates.
Codex CLI offers three modes:
Search for a command to run...