GuidesEngineering

Codex CLI: What It Is and How Teams Actually Use It

Shiplight AI Team

Shiplight AI Team

Updated on July 31, 2026

View as Markdown
Illustrated Shiplight blog cover: a glossy terminal window dispatching a coding task to a cloud sandbox and receiving a finished diff back.

Terminal coding agents converged on a similar shape in 2026: read the repository, edit files, run commands, iterate until the task is done. What separates them is where the work runs, what it costs, and how far you can extend them.

This guide covers OpenAI's entry, what it is good at, the async dispatch model that distinguishes it, and the step that matters after it hands you a diff.

What it is

Codex CLI is OpenAI's terminal-based coding agent. It runs locally, reads and edits your codebase, executes commands, and works through multi-step tasks from a natural-language instruction.

Two properties set it apart from most alternatives:

It is open source, released under Apache-2.0 and written in Rust. You can read it, fork it, and audit what it does before it touches your repository. For security teams, that is often the deciding factor.

It has a cloud path. Beyond the local loop, you can dispatch a task to a cloud sandbox from ChatGPT and collect the result later. You stop supervising, and come back to a finished diff.

The async dispatch model

This is the part worth understanding, because it suits a different kind of work than an interactive loop does.

Async dispatch fits tasks you can specify completely before they start. A dependency bump. A codemod across two hundred files. A migration with a clear finish line. You describe the outcome, hand it off, and do something else.

An interactive loop fits work where the goal moves as you learn. Exploratory refactors, debugging, anything where you will change your mind twice before it is right.

The honest question when evaluating Codex CLI is what share of your backlog falls in the first category. Teams with a lot of well-specified mechanical work get real value from dispatch. Teams doing exploratory product work will mostly use the local loop, and then the async capability is not doing much for them.

There is a corollary that catches people out: if you are not there to watch, verification has to be part of the task specification or it does not happen. Nobody notices the agent skipping a check when nobody is present. That pushes dispatch users toward checks that run in CI on the resulting branch, which is a healthier default anyway but takes setting up first.

Token economics

On identical tasks, Codex generally completes work using materially fewer tokens than the main alternatives. Reports through 2026 put the gap at several times over, and the direction is consistent even where the multiple is disputed.

This matters once an agent is in daily use, because token cost stops being a rounding error and starts behaving like infrastructure spend. A multiple-times difference in cost per task changes what you are willing to delegate at all.

The counterweight, which is easy to skip: a cheaper task is not a cheaper outcome if it needs more human passes afterward. Cost per accepted change is the number that matters, and only your own team on your own codebase can measure it. Two weeks of real tickets tells you more than any published benchmark.

Extensibility

Codex CLI speaks the Model Context Protocol, so any tool exposed over MCP works with it: browser automation, database access, your own internal tooling. See what is MCP? if the protocol is new.

Its customization model leans on MCP and configuration rather than a layered extension system. For teams whose need is "give the agent these tools," that is enough and simpler to reason about. For teams trying to encode process so that conventions hold across many engineers, the layered approach some alternatives offer does things configuration cannot. That comparison is in Codex vs Claude Code.

Benchmarks, honestly

Codex has led on SWE-bench Verified and terminal benchmarks. Competing agents have led on SWE-bench Pro, which is built to resist contamination.

Those are compatible facts rather than a contradiction: a model can score higher on a suite whose problems may have leaked into training and lower on one designed to prevent that. Contamination-resistant suites are the more trustworthy signal and also the newer ones.

Developer preference surveys and blind quality reviews have also disagreed with each other. The conclusion for an engineering team is not that benchmarks are useless, but that none of them is measuring your codebase.

What has to happen to the output

At the end of a run, the agent reports that the change works. That report describes code it just wrote, assessed from the context that produced it, which is structurally the weakest position from which to audit anything. This is not a knock on this agent specifically; it applies to all of them, for reasons set out in can coding agents test their own code?

The failure that costs the most is not a wrong new feature. It is a quiet deletion: a refactor that removes a null check, a rate limiter or an offline fallback that was there for a reason nobody wrote down, with nothing in the summary mentioning it. See regression risk in AI-generated code.

What settles it is evidence from outside the agent's context. A real browser exercising the flow. Assertions derived from what the feature was supposed to do rather than from the diff. A test artifact a human can read in review.

Shiplight works with Codex CLI through MCP: the agent opens a real browser, walks the flow it changed, and the successful check is written into your repository as intent-based YAML that runs on every future change. Because it is MCP rather than a Codex-specific integration, the same setup follows you if you switch agents. Web applications; native mobile is not in it. The step-by-step version is in OpenAI Codex testing.

Who it fits

Good fit: cost-sensitive teams, work that can be fully specified before it starts, organizations that need to audit or self-host their tooling, and anyone who wants the agent's source readable.

Less good fit: teams whose main need is encoding conventions across many engineers, or whose work is exploratory enough that dispatch adds nothing.

Worth knowing: running more than one agent and routing work by shape is a common 2026 pattern rather than a hedge. Subscriptions are cheap next to engineer time.

Frequently Asked Questions

1

Is Codex CLI open source?

Yes, Apache-2.0 and written in Rust. You can read and audit it before giving it access to your repository, which is often the deciding factor for security teams.

2

What is the difference between Codex CLI and the cloud version?

The CLI runs locally and interactively. The cloud path lets you dispatch a fully specified task to a sandbox from ChatGPT and collect a finished diff later, which suits mechanical work you do not need to watch.

3

Does Codex CLI support MCP?

Yes, so any tool exposed over the Model Context Protocol works with it, including browser automation and internal tooling.

4

Is Codex CLI cheaper than other agents?

On tokens per task, consistently. The number that decides it is cost per accepted change, which depends on how often output needs rework in your codebase.

5

Do I still need tests if Codex verifies its own work?

Yes. An agent assessing code it just wrote judges from the context that produced it, and its verification leaves no artifact for tomorrow's regression.