A Terminal Agent, Done Right
OpenAI’s Codex CLI is the company’s answer to Claude Code — an open-source, terminal-native coding agent that runs in your shell, reads your repo, and edits files with your approval. After six weeks of daily use across three projects, here’s where it lands.
The headline: Codex CLI is the most inspectable agent in this category. Because it’s Apache 2.0 and Rust-based, you can read exactly what it does, and the approval-mode dial (“suggest / auto-edit / full-auto”) is the cleanest safety control I’ve used in a CLI agent.
The Agentic Loop
Codex CLI runs a plan-act-verify loop on top of OpenAI’s reasoning models. It reads the repo map, proposes a plan, executes edits, runs your test command, and iterates. Compared to Claude Code, the loop is more deliberate — Codex tends to plan once and commit, where Claude Code will re-plan mid-task more fluidly. That deliberateness is a feature for predictable tasks and a liability for ambiguous ones.
| Task Type | Codex CLI | Claude Code | Winner |
|---|---|---|---|
| Single-file bug fix | Fast, clean | Fast, clean | Tie |
| Multi-file refactor (5–15 files) | Good, slightly slow | Excellent | Claude Code |
| Greenfield scaffolding | Good | Good | Tie |
| Debugging failing tests | Solid | Excellent | Claude Code |
| Reproducible scripted ops | Excellent | Good | Codex CLI |
Approval Modes & Safety
This is Codex CLI’s strongest card. Three modes:
- Suggest — proposes diffs, you approve each. Default.
- Auto-edit — applies edits, asks before shell commands.
- Full-auto — sandboxed; can run commands but isolated from the network and home directory by default.
The full-auto sandbox is the right default for “let it cook” tasks, and it’s more principled than most competitors’ trust prompts. For teams with compliance requirements, the auditability of an OSS agent you can self-host matters.
Where It Falls Short
Three real gaps. First, the agentic loop on long refactors: Codex will sometimes complete a 12-file change that’s locally correct but misses a cross-cutting convention a more fluid re-planner catches. Second, reasoning-model latency: each planning step is slower than a faster non-reasoning model, and on big tasks the seconds add up to minutes. Third, the MCP and config story is still maturing — configuring tools and project context is more fiddly than it should be.
Pricing
| Path | Cost | Notes |
|---|---|---|
| ChatGPT Plus | $20/mo | Includes Codex CLI usage, rate-limited |
| ChatGPT Pro | $200/mo | Higher limits, priority |
| API (pay-per-token) | Variable | Best for heavy/automated use |
| Self-hosted with own model | Free + model cost | Maximal control |
Against Claude Code (which lives behind a $20–200/mo subscription or API), Codex CLI’s OSS nature is the differentiator if you need to self-host, audit, or extend the agent itself.
Verdict
Codex CLI is the best terminal agent for engineers who want transparency and control, and it’s the right call for scripted, reproducible work where the sandbox shines. For raw agentic fluency on messy multi-file work, Claude Code still edges it. If you live in the terminal and value open source, Codex CLI belongs in your toolchain — just know which tasks to hand it and which to keep in your editor.