Most pages that explain how to use Codex open with an install command, because Codex is easy to describe as a thing you install. It is OpenAI's agentic coding assistant, and it arrives in three places that share one agent underneath: an open-source command-line tool you run in a terminal, an extension inside your editor, and cloud tasks that run on OpenAI's machines against a GitHub repository while you are somewhere else. The command-line half really is open source, which is why searches for an open source AI coding assistant keep landing here.
The Claude Code walkthrough put a terminal agent to work while you watched, and that habit of watching is worth keeping. Codex's more interesting setting points the other way: you write the task down, you leave, and you come back to a change that is either good or needs another round. Making that work is a different skill from supervising a session, and it has three hinges. The brief has to be complete enough that the agent never needs to ask you anything. The sandbox has to be able to install and run whatever proves the work is done. And you have to be able to read what comes back, because the agent's summary of its own work is not the work.
The case: one bug, one brief
The example below is invented, but it is the ordinary shape of a first handoff. You have a small timesheet app, the kind of thing exported from an app builder or written in a few chat sessions, that turns logged hours into a CSV for invoicing. A user reports that the export breaks for any client whose name contains a comma: the invoice rows shift one column to the left, and they have been renaming clients to work around it. There is a test suite, npm test runs it, and a few tests already cover the export function.
The instinct is to type "fix the CSV bug" and hit send. That brief hides four decisions the agent will then make for you: which escaping rule to apply, which file to touch, whether to add a test, and how the finished work should be checked. Each of those silently becomes the agent's guess.
A handoff brief answers them in advance. Four lines, in this shape:
1Fix the CSV export in src/export.ts. Today exportCsv builds each row with
2row.join(',') and no quoting, so a client name with a comma splits into two
3columns in the invoicing spreadsheet.
4
5Expected: fields wrapped in double quotes when they contain a comma, a double
6quote, or a line break, and any double quote inside a field doubled. That is
7what Excel and Google Sheets expect.
8
9Verify with: npm test. Add a test named "quotes client names containing
10commas" that exports a row with the client "Smith, Jones & Co" and checks the
11resulting string. Existing export tests must still pass.
12
13Do not: rename the export file, change the download button, reorder columns,
14or touch anything under src/billing/.Read each line as an answer to a question the agent would otherwise answer itself: what is wrong right now, what should be true instead, how will we both know, and what is out of bounds. The last line is the one people skip, and it is the one that keeps a two-line fix from arriving as a refactor of three files.
Before sending, run the no-questions test: reread the brief and ask, for each sentence, what the agent would have to guess. Anything it must guess is a decision you have handed over. In an interactive session the agent asks and you answer in ten seconds. In a handoff there is no pause to ask, so the guess survives all the way to your review, where it costs a whole round trip.
The sandbox decides what "it works" can mean
A cloud task does not run on your laptop. Codex takes the repository at the commit you point it at, starts a fresh container, installs your dependencies, edits files inside that container, and runs commands there. So when the task comes back saying the tests pass, the only thing that sentence can mean is that the tests ran, in that container, against that code. Whether they could run at all is decided by how the environment is set up before the agent starts: a setup script that installs dependencies, plus any environment variables the app needs.
This is the hinge that surprises people, and the failure is quiet rather than loud. If the project has no committed lockfile, npm ci has nothing to install from. If the setup script is empty, the test runner may not be present. If the agent's own run has no network access, which is the default in the cloud sandbox and a sensible default, then nothing it does can fetch a package or call a live API. In all three cases Codex still finishes the task and still describes a correct fix. It just replaces "the tests pass" with "the change looks right", a much weaker claim wearing similar clothes.
Two habits fix this before it bites. First, make the setup script do the boring, explicit thing:
1npm ciand commit the lockfile so that line has something to read. If your repository came out of a builder without one, run npm install locally first and commit the resulting package-lock.json as its own change, so the lockfile is not part of the fix under review.
Second, calibrate the environment with a throwaway task that changes nothing: "run the full test suite and report the exact output, do not modify files." If the answer is a test summary, your environment can verify real work. If it is "the command was not found", you just learned that every future task in this repository will hand you unverified code, and you learned it for the price of one trivial round trip instead of a week of false confidence.
Reading the change it hands back
What returns from a task is three things: a log of the commands the agent ran, a diff, and a written summary. Read them in that order, because the order of certainty runs the same way. The summary is the agent's account of the log, so if the two disagree, the log wins.
In the log, look for one pattern above everything else: the new test failing first, then the fix, then the suite passing. That red-to-green sequence is the strongest cheap evidence you can get, because it shows the test was actually sensitive to the bug. If the only run in the log is a green one at the end, and the agent wrote the test, you have something weaker than it looks. A test written after a fix proves that the code and the test agree, not that the bug was ever there. So plan to spend your own two minutes recreating the broken case before you call the task done.
Then read the diff, mainly for size and reach. Two files, src/export.ts and the test file, matches the brief. A diff that also reformats the download button, or bumps a dependency "while it was there", is scope drift, and the fix is one follow-up task that says exactly that: revert the unrelated edits, keep the quoting change.
The part the sandbox cannot do for you is the last check, because the container has no spreadsheet. You can borrow the container's eyes, though: add a line to the brief asking the final message to include the first three lines of the exported CSV as text. Then you can look at "Smith, Jones & Co",8,720 yourself and judge the thing your user actually cares about, without a working development environment of your own.
The CSV escaping rule and the npm ci line belong to this example. What transfers is the shape: four-part brief, named check, calibrated environment, log before diff before summary, and a small human check at the end that a machine cannot make for you.
Two things you repeat in every brief should move into a file instead. Codex reads AGENTS.md at the repository root at the start of a task, so the run command, the test command, and standing rules like "never touch src/billing/" belong there once. That file name is shared across several agents now, not just Codex, so you write it once and other tools read it too, the same role the Claude Code walkthrough gave CLAUDE.md.
If you hand off from the command-line version instead of the cloud, nothing in the reasoning changes, only the mechanism: the sandbox is your own machine, it is limited to the folder you started it in by default, network access is off unless you grant it, and approval prompts stand in for environment configuration. Installation lines and flag names in Codex change between releases, so confirm the current ones in the docs rather than trusting a snippet from a blog post, including this one.
One more restraint is worth naming, because the handoff model invites the opposite. Queueing five tasks at once feels like five times the work, but each one returns a diff that has to be read by the same one person, and two tasks touching the same file arrive as a conflict you now own. One or two in flight is the honest limit. And if you cannot yet say how the finished work would be checked, with no test, command, or output you could look at, do not hand it off. Work beside the agent instead, in a session where you can watch it discover the problem, and write the brief once you know what "done" looks like.