Justin McKelvey
Fractional CTO · 15 years, 50+ products shipped
How to Use Codex (2026): The Delegation Loop, Not the Install Guide
Quick Answer
To use Codex well: run it in the repo you want changed, scope one task you can verify, set the approval mode to match how reversible the work is, then review the diff before it merges. Its real advantage is delegation — it works well unsupervised, which means your skill is defining boundaries, not writing prompts. The CLI is free; the model behind it is $20/month bundled with ChatGPT Plus, $200 on Pro, or roughly $5–$250/month metered by workload. The loop and the three habits that actually change output quality are below.
Verified August 2026 · Author: Justin McKelvey, fractional CTO & founder of Vibe Code Rescue, 15 years in software, 50+ products shipped
TL;DR: The Skill Changed When the Tool Stopped Needing You
Codex is the first of these tools that is genuinely good at working while nobody is watching. That sounds like a feature. It is actually a change in what you have to be good at.
When an agent needs you in the loop, your skill is steering — nudging, correcting, catching it mid-mistake. When it doesn't, none of that applies. You get one shot at the instructions and one shot at the review, and everything in between happens without you. The people getting real leverage out of Codex are not better prompters. They are better at scoping work they can verify after the fact.
That is the whole guide. The rest is detail.
The Loop: Scope, Set Approvals, Run, Verify
- Scope one task with a boundary you could say out loud. "Add rate limiting to the public API endpoints and cover it with tests" is a task. "Clean up the API" is a wish. Scope is the variable that predicts whether the diff is mergeable, and it is entirely under your control.
- Set the approval mode to match the blast radius. This is the step most people set once and never revisit, and it is where both the speed and the accidents come from. More on it below.
- Let it run — actually let it. Interrupting a delegated agent halfway through is how you get half-finished work with none of the benefit. If you didn't trust the scope enough to walk away, the problem was step one.
- Verify before you merge. Run the thing. Read the diff. "The tests pass" is necessary and nowhere near sufficient, because it wrote the tests.
Habit One: Write AGENTS.md, Then Keep Pruning It
AGENTS.md in your repo root is read as standing instructions every session. It is the only place where fixing a mistake once actually stops it recurring.
What earns a line in it:
- The exact commands for your tests and your dev server, as typed.
- Conventions you genuinely enforce in review — not the ones in the style guide nobody follows.
- The traps. The thing that took production down once. The dependency that behaves nothing like its docs. This section is worth more than the other two combined and almost nobody writes it.
What ruins it is length. Once the file is long enough that a reader would skim it, you have buried your six real rules under ninety decorative ones, and the agent has no way to tell which is which. Prune it as often as you append to it.
Habit Two: Use the Cloud for the Work You'd Otherwise Not Do
The CLI runs locally, in your repo, with your commands — you watch it work. The cloud side runs tasks in its own sandbox and hands back a diff or a pull request.
Most people underuse the second one, and the reason is emotional rather than technical: watching feels like control. But delegated execution is not less control, it's deferred review — and it unlocks the category of work that otherwise never gets done. The dependency bump nobody wants to babysit. The test coverage on the module everyone avoids. The four small refactors you keep deprioritising.
Send several of those at once and review them like a morning inbox. That is the workflow that actually changes your week, and it is available to anyone already paying for it.
Habit Three: Set Approvals Per Task, Not Once
The rule I use is one sentence: automatic execution is safe in exact proportion to how easily you can undo the result.
Feature branch, clean tree, tests that fail loudly — let it off the leash, that's where the speed is. Anything touching production, deleting data, or pushing to a remote — approvals stay on, no exceptions, no matter how routine it looks. And notice what the safety net actually is: not the permission setting, which only governs what happens next. Git is what governs what you can take back.
The failure mode is picking a comfortable mode in week one and never thinking about it again. Both directions cost you — too tight and you're clicking approve on a hundred file reads, too loose and you find out what "and also I refactored the auth layer" means on a Friday.
Habit Four: Review Like It Wrote Plausible Code, Because It Did
Read the diff the way you'd read a pull request from a fast, competent, slightly overconfident junior — because functionally that is what arrived. Ask why for anything you don't recognise. Be most suspicious of the parts you would have found tedious to write yourself, since that is precisely where your attention wants to slide off.
The real risk with delegated agents was never that they write bad code. It is that they write plausible code into a codebase nobody is reading closely anymore, at a rate no one is reviewing at. If that already describes your situation — a working app whose internals nobody can vouch for — the vibe coding security checklist is a twenty-point self-audit rather than a sales page. And if you're trying to work out how much of an inherited codebase came from an agent in the first place, that's what telling whether code is AI-generated is for.
What It Costs to Run Daily
The CLI is free and open source. What you pay for is the model behind it, billed one of two ways.
Bundled: ChatGPT Plus at $20/month includes Codex credits that cover light-to-moderate daily use, and Pro at $200/month is the tier for heavy agentic work. Metered against an OpenAI API key instead: roughly $5–$15/month light, $30–$60 moderate, $80–$250 full-time.
If you already pay for Plus, Codex is included at the margin, which is the closest thing to free that exists here — the full breakdown of that question is in is Codex free, and the credit mechanics and overage traps are in Codex pricing.
Where Codex Stops Being the Right Tool
Being honest about the ceiling is what makes the rest of this worth reading.
It is strongest where the task has a hard boundary and a fast, objective check — a scoped feature, a migration you can roll back, test coverage, a mechanical refactor. It is weakest exactly where delegation is weakest generally: architecture decisions whose cost surfaces in six months, anything requiring taste about your specific users, and any change where "did this work?" cannot be answered in under a minute. Delegation needs a verification step, and where you can't build one, don't delegate.
If you'd rather stay in the loop and steer line by line, a different shape of tool fits better — the honest three-way comparison is Cursor vs Claude Code vs Codex, and the equivalent working loop for the terminal-agent alternative is how to use Claude Code.
The Micro-Action
Before you close this tab: find one task you have been deprioritising for a month because it's tedious rather than hard — the dependency bump, the missing tests, the rename you keep flinching at. Scope it in two sentences, put it on a branch, and delegate it. Then review what comes back. Whether you merge it or bin it, you'll have learned the only thing that actually matters here, which is how good your scoping is.
Next step Get the free repo audit →
What your AI stack actually costs
Prices changed 3x this year. The always-current cost sheet: sticker price vs what heavy use actually costs for Cursor, Claude, Replit, Lovable, Bolt & more.
Frequently Asked Questions
- How do you use Codex?
- Start it in the root of the repository you want it to work on, describe the outcome rather than the implementation, choose an approval mode that matches how reversible the work is, and review the diff before you merge anything. The loop is: scope one task, pick the approval level, let it run, verify it actually works. The step people skip is scoping — they hand it something with no clear boundary and then judge the tool by the mess that comes back.
- What is AGENTS.md and do I need one?
- AGENTS.md is a file in your repository that Codex reads as standing instructions for every session — how to run your tests, the conventions you actually enforce, and the traps specific to your codebase. You need one, and it should be short. Its value is that you write a rule once instead of repeating it every session, and that value collapses if the file grows long enough to bury the rules that matter.
- How much does Codex cost to use?
- The Codex CLI is free and open source. What you pay for is the model behind it. It comes bundled with ChatGPT Plus at $20/month, which includes Codex credits that cover light-to-moderate daily use, or Pro at $200/month for heavy agentic work. Metered against an OpenAI API key instead, real-world usage runs about $5-$15/month light, $30-$60 moderate, and $80-$250 full-time. If you already pay for Plus, Codex is effectively included at the margin.
- What is the difference between Codex CLI and Codex cloud?
- The CLI runs on your machine, in your repository, with your files — you watch it work and it can run your actual commands. The cloud version runs tasks in its own sandboxed environment and hands you back a diff or a pull request. The practical split is that the CLI is for work you want to steer, and the cloud is for work you can describe once and check later. Most people underuse the second one because it feels like less control, when it's really just deferred review.
- Which approval mode should I use in Codex?
- Match the approval level to how easily you can undo the result. On a feature branch with a clean tree and tests that fail loudly, full auto is where the speed lives. Anywhere that touches production, deletes data, or pushes to a remote, keep approvals on. The permission setting is not your safety net — a branch and a commit are. Set it per task rather than picking one mode and forgetting about it.
- Is Codex better than Claude Code?
- They're shaped differently rather than ranked. Codex is stronger at long, delegated work you don't supervise — hand it a scoped task, walk away, review the diff. Claude Code is stronger when you want to stay in the loop and steer as it goes. Plenty of people run both and choose per task. If you want the full comparison against the wider field, the three-way breakdown is more useful than a winner.
More on Vibe Code Rescue
Lovable Review (2026): What It's Actually Like, From the Guy Who Fixes These Apps
An honest Lovable review from someone whose day job is repairing AI-generated codebases. What it genuinely does well, the three places it reliably falls over, who should use it, and the one thing that makes it better than most of its category.
How to Use Claude Code (2026): The Working Loop, Not the Install Guide
Installing Claude Code takes ten minutes. Using it well is a different skill, and it's mostly about what you do before you let it write anything. Here's the loop that separates people who ship with it from people who spend an afternoon undoing it.
How to Tell If Code Is AI-Generated: A CTO's Field Guide (2026)
There is no reliable detector for AI-generated code — the tools that claim otherwise are guessing. But after auditing dozens of AI-built codebases, I can usually call it in ten minutes, because AI code has tells: over-commented obviousness, hallucinated APIs, five different naming conventions, and tests that assert nothing. Here are the nine tells, and what to do if your codebase has them.
OpenClaw Review (2026): What the Most-Starred Repo on GitHub Actually Does
OpenClaw is a free, open-source AI agent you text like a colleague — and it can genuinely run files, messages, browsers, and code on your machine. My honest review: what it does well, where it bites, what it costs to run, and who should (and shouldn't) install it in 2026.
Written by
Justin McKelvey
Fractional CTO & AI consultant in Austin, TX. 15 years building software, 50+ products shipped, $53M+ in client revenue generated. I help $1M–$50M founders ship production software and automate operations with AI — without hiring a full-time executive team.
Work with me