How to use the Codex CLI: a working day with it

The mechanics take five minutes. What takes longer is the working rhythm, and the parts of it that are specific to Codex rather than generic agent advice.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Start Codex in your repository root, run /init to create an AGENTS.md, explore in read-only mode before changing anything, then describe one specific task naming the files and the constraint. Review with /diff and /review before you accept, commit in small pieces, and use /new between unrelated tasks. Escalate reasoning effort on evidence rather than by default.

What you need to know
  • Run /init first in any new repository. It pays for itself in the first session.
  • Start in read-only while you do not know the codebase yet.
  • Every strong prompt has three parts: the symptom, the file, and the constraint.
  • /diff before you accept anything. /review before you push.
  • Commit in small pieces, not at the end of a long session.
  • /new between unrelated tasks. Context you did not clear is context you are paying for.
  • Escalate model_reasoning_effort on evidence, not by default.

The first fifteen minutes

01

Start in the repository root

cd ~/code/your-project
codex

The launch directory is the workspace root and the sandbox is scoped to it, so this is not merely a convention. Outside a git repository Codex refuses to start unless you pass --skip-git-repo-check, because git is the undo button for everything that follows.

02

Generate an AGENTS.md

/init

Codex reads the project and drafts one. Edit it down hard: keep the commands and the traps, delete anything it could have inferred, then commit it. Every future session in this repository starts better because of it.

03

Explore before you change anything

codex -s read-only -a never

Ask it to explain the architecture, find where a feature lives, or trace a request from handler to database. It cannot break anything and it will not interrupt you to ask permission for a grep. This is the highest value-per-token session you will run all week.

04

Then make one small change

Something you could do yourself in twenty minutes, so you can review the output properly. The goal of the first real task is calibration, not output: you are learning what this model does well in this codebase, and that is not knowable from a benchmark.

Prompting for Codex

The difference is the same as anywhere, and the cost is higher here because effort multiplies it.

WeakStrong
"Fix the auth bug""Sessions expire an hour early. Look at internal/auth/token.go, I think the TTL is applied twice. Do not change the public signature."
"Add caching""Add an in-memory cache to GetUser in internal/store/user.go. 60s TTL. Do not change the signature and do not add a dependency."
"Clean this up""Extract the validation from handler.go into validate.go. Behaviour identical; the existing tests must pass unchanged."

Give it the failure, not your theory

Paste the actual test output, the actual stack trace, the actual log line. A model given a symptom investigates; a model given your diagnosis implements your diagnosis, including the part where you were wrong. If you do have a theory, say so as a theory: "I think the TTL is applied twice" is useful, "the TTL is applied twice, fix it" is not.

Reviewing before you accept

/diff
  1. Read the diff, not the explanation. The explanation was written by the same thing that wrote any bug in it.
  2. Check the deletions. Removed lines get less scrutiny than added ones and are where regressions hide.
  3. Run the tests yourself. "Tests pass" is a claim, and a cheap one to verify.
  4. Watch for scope creep. Files touched that had nothing to do with what you asked are the signal that the constraint was missing.

Codex has a second review surface worth using once you are past the diff. /review in a session, or codex review outside one, runs a dedicated review pass over the changes and reports what it finds.

Before you push, not instead of reading.
codex review --uncommitted            # staged, unstaged, untracked
codex review --base main             # everything on this branch
codex review --base main "focus on error handling and missing tests"

Managing context, model, and effort

Three dials, and knowing which one to turn is most of what experienced use looks like.

SituationDo
Starting an unrelated task/clear or a fresh session
Long session, still on the same task/compact
Task is harder than expected/model, raise effort one step
Task turned mechanical/model, drop to gpt-5.6-luna
Unsure what is actually configured/status
A command needs the networkEnable it deliberately, then turn it back off

The escalation ladder

  1. Try it at the default. gpt-5.6-sol ships at low effort and is strong there.
  2. If the first attempt misunderstood the problem, add context rather than effort. Usually it was missing a file.
  3. If it understood and still got it wrong, raise effort one step to medium or high.
  4. If it is still wrong, the task is underspecified. Rewrite the prompt; do not reach for xhigh to compensate.
A decision tree from the default run: if the model misunderstood, add context; if it understood and was still wrong, raise effort one step; if it is still wrong, rewrite the prompt rather than raising effort again WHEN A TASK RESISTS run it at the default sol, low effort it misunderstood understood, still wrong add context usually a missing file raise effort one step low to medium to high still wrong rewrite the prompt the task is underspecified, not underpowered THE EXPENSIVE HABIT xhigh by default several times the cost for the same answer Escalate on evidence, after one attempt has already failed.

The Codex-specific surprises

What you seeWhat it is
npm install fails with a network errorThe sandbox blocks network in workspace-write by design
It refuses to start in a folderNot a git repository. That guard is deliberate.
Suddenly billed per tokenOPENAI_API_KEY is set and overrides the subscription
--full-auto is not recognisedRemoved. Use -s workspace-write -a never.
A profile block stopped workingProfiles are separate <name>.config.toml files now

Running more than one thing

Once the single-session rhythm is comfortable, the constraint stops being the model and becomes you: one agent finishes and waits while you read. The fix is more than one working tree, not more than one terminal in the same directory.

One worktree per task, so two agents never edit the same file.
git worktree add ../proj-auth   -b fix/auth-ttl
git worktree add ../proj-cache  -b feat/user-cache

( cd ../proj-auth  && codex "sessions expire an hour early; see internal/auth/token.go" )
( cd ../proj-cache && codex "add a 60s in-memory cache to GetUser" )
And hand the chores to exec.
git diff --cached | codex exec -m gpt-5.6-luna -
codex exec -s read-only -a never "which files changed most in the last 30 days?"
Three tasks, three worktrees, three branches moving at once. The bottleneck stops being the model and becomes how fast you can review.

Questions people ask

Install it, run codex in your repository root, sign in with ChatGPT, then run /init to generate an AGENTS.md. Explore in read-only mode before you let it change anything.

Something small you could do yourself in twenty minutes, so you can review the output properly. The first task is for calibration, not output.

Run /diff in the session, which includes untracked files. Read the diff itself rather than the explanation, and pay particular attention to deletions.

/diff shows you the changes. /review runs a dedicated review pass over them and reports issues it finds, focusing on behaviour changes and missing tests. Use /diff while working and /review before you push.

The workspace-write sandbox disables network access by default. Install dependencies before the session, or set network_access = true under [sandbox_workspace_write] when you genuinely need it.

When the model understood the problem and still got it wrong. If it misunderstood, add context instead. Running high by default costs several times more for work the default completes identically.

Yes, in small pieces. One commit containing four unrelated agent changes cannot be reviewed or reverted cleanly, and you will eventually want to revert exactly one of them.

Yes, with one git worktree per session so two agents never edit the same files. Running two sessions in the same directory produces conflicting edits that neither of them knows about.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. OpenAI Codex documentation
  2. AGENTS.md specification
  3. openai/codex on GitHub
Try it

A diff pane,
by default.

Continuum shows every Codex session with its own diff view, so review is the path of least resistance.

free app · your subscriptions · local-first