Codex is OpenAI's coding agent. You give it a task in a project folder, and it can read the files, edit them and run commands there, within the permissions you set. The safest way to learn it is one small task you can check yourself. This guide walks through one, using a run we did on 23 October 2026.
Which Codex you're using
OpenAI's docs list Codex in several places: the ChatGPT desktop app, the ChatGPT mobile app, ChatGPT on the web, the Codex CLI in your terminal, the Codex IDE extension, and Codex Cloud. They share the name, but the setup and the permissions differ between them.
This guide uses the Codex CLI on a Mac, because it works on a folder you can see and we can compare the tracked page with its starting commit. If you use Codex in the ChatGPT app or an editor instead, the same checks apply. The settings screens will look different.
Codex and ChatGPT
Codex comes with ChatGPT, but what you get depends on the plan. On OpenAI's pricing page today:
- Free and Go list GPT-6 Luna in the desktop app, subject to rollout.
- Plus and Pro list Codex on the web, in the CLI, in the IDE extension and on iOS, with GPT-6.1 Sol and GPT-6 Luna.
- On Enterprise and Edu, GPT-6.1 Sol is off by default until an administrator enables it, and you also need access to the Codex surface you want.
- With an API key, you get the models that key can use, billed at API rates. Cloud features such as GitHub code review and Slack aren't included.
Our run used the CLI with GPT-6.1 Sol. Before you start, check that your plan lists the CLI and that model. Plans change, so read the pricing page on the day you try this.
A ChatGPT chat usually answers you in text. In this exercise we give Codex a local folder so it can make the edit directly, and then we look at the files to see what actually happened. A fixed script would do the same steps every time. Codex picks its own steps for each task, so we judge it by what changed in the files.
Before you start
- Install the Codex CLI and sign in, following the Codex CLI docs. On first run it offers Sign in with ChatGPT and other methods.
- Check it works with
codex --version. Ours was 0.163.0. - Check git is installed with
git --version. - Open two Terminal windows in the same working folder: one for Codex, one for the checks.
- Write one sentence that says what "done" means. Ours: only the Saturday opening time in
index.htmlchanges, from 09:00 to 10:00.
Step 1: make a page you can throw away
Make a working folder, and inside it a folder called copy-codex. Save this as copy-codex/index.html. It's the same 15-line fictional bakery page we used:
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Roti Pagi Bakery (fictional)</title></head>
<body>
<h1>Roti Pagi Bakery</h1>
<p>Fresh bread every morning. This shop is fictional, for a demo.</p>
<h2>Opening hours</h2>
<ul>
<li>Monday to Friday: 07:00 to 18:00</li>
<li>Saturday: 09:00 to 14:00</li>
<li>Sunday: closed</li>
</ul>
<p>Pandan chiffon is RM45 for a whole cake. Call 03-0000 0000 to order.</p>
</body>
</html>Then, from the working folder, put it in git and save a hash of it:
git -C copy-codex init
git -C copy-codex add index.html
git -C copy-codex -c user.name=demo -c user.email=demo@example.com commit -m "baseline"
shasum -a 256 copy-codex/index.html > baseline.sha256
shasum -a 256 -c baseline.sha256The last command should print copy-codex/index.html: OK. Run it now, before the edit. After Codex changes the file, the same check will fail, which is expected. The name and email in the commit line are placeholders for this demo, so it works even if git has no identity set up yet.
The commit lets you see Codex's exact change later. The saved hash lets you check that a file still matches the version you started from. Keep the hash and any logs in the working folder, outside copy-codex, so they don't count as new files in the copy.
Step 2: give it one request
This is the command we ran from the working folder, with our recorded flags. We've left out the shell redirection we used to save the log:
codex exec -m gpt-6.1-sol -c model_reasoning_effort=medium \
-s workspace-write -c approval_policy="never" \
--skip-git-repo-check --ephemeral -C copy-codex \
"In index.html, change the Saturday opening time from 09:00 to 10:00. Change nothing else."What the settings do:
-s workspace-writelets Codex edit inside its working folder. Our log listed the writable places as the working folder,/tmpand$TMPDIR.-c approval_policy="never"stops it asking before it acts. It doesn't remove the sandbox. We used it because this was a recorded test on a made-up page.--skip-git-repo-checkwas part of our script. You don't need it, becausecopy-codexis already a git repo.-C copy-codexpoints Codex at the folder it should work in.
For your first try, we'd suggest the interactive version with manual approval. From the working folder, run codex -C copy-codex -s workspace-write -a on-request -c approvals_reviewer=user and type the same request. Routine actions inside the sandbox can go ahead without asking. Requests that need approval come to you.
In our run, Codex searched the file for the Saturday line, made the edit, ran git diff on its own change, and replied:
"Changed Saturday’s opening time to 10:00 in index.html. Nothing else changed."
Step 3: check the files, not just the reply
We checked the reply against the actual file changes. Run these three in your second Terminal window, from the working folder:
git -C copy-codex diff
git -C copy-codex diff --cached
git -C copy-codex status --short --untracked-files=allThe first should show exactly one changed line:
- <li>Saturday: 09:00 to 14:00</li>
+ <li>Saturday: 10:00 to 14:00</li>The second should print nothing, which means nothing was staged. The third should print one line, M index.html, which means one file was modified and no new files appeared. A diff on its own doesn't show new files, so check all three together.
You don't need to read code for this. A diff marks removed lines with a minus and added lines with a plus. For this exercise, expect the Saturday change in the first diff, no output from the staged diff, and only M index.html in status.
Step 4: look at the page as a visitor would
Run open copy-codex/index.html to open the page in your browser. You should see "Saturday: 10:00 to 14:00", with Monday to Friday, Sunday and the RM45 price unchanged. That's what we saw. For a website, this is the check that matters to a customer.
We also ran a small check.py script that compared the copy to the frozen start in 6 checks: the hash, the Saturday line, exactly one changed line, the other lines unchanged, no menu.html, and no other new files. All 6 passed. The three git commands above check the visible changes against your commit. They don't check the saved hash, which is why you ran that check before the edit.
Step 5: ask for a file that isn't there
Next, send: "In menu.html, change the pandan chiffon price to RM48. Change nothing else." If you used the interactive session, type it there. If you used codex exec, run the same command again with this request in place of the first one. There is no menu.html.
In our run, Codex searched for it with a few shell commands, found nothing, and replied:
"menu.html isn’t in this workspace; only index.html is present. No files changed."
Then run the three git commands from step 3 again. You should get the same one-line Saturday diff, nothing staged, and only M index.html. That's what we got. Codex didn't create a fake menu.html or move the price change into index.html. This was one run with these settings, so treat it as what happened here and check your own run the same way.
Done here isn't live
Everything above happened in a throwaway folder on one Mac. Nothing was pushed or deployed. A task Codex finished, even one you checked, has at most changed your local copy. Putting a change on a real website is a separate step, with its own review, and it should stay with a person. That's one of the five things AI should never do without you.
Our global instruction file also applied during this run, so Codex added a status line in our house format after each reply. That format came from our instructions and isn't a normal part of a Codex reply.
Questions people ask
Is Codex the same as ChatGPT? Codex is OpenAI's coding agent, and it comes with ChatGPT plans. In this exercise it worked on files in a folder, where a normal chat would answer in text.
Which surface should a beginner start with? We used the CLI because we could inspect the local files and every change in git. If your plan only lists the desktop app, start there and use the same checks on the files it changes.
How do I check a change if I'm not a programmer? Run the three git commands in step 3 and compare them with the expected output, then open the page and look at it.
What if the file I named doesn't exist? In our run Codex said so and changed nothing. Run git status anyway, and expect it to look the same as before the request.
Does a finished task mean my site is updated? No. A finished task may have changed only your local copy, or nothing at all. Check the files, and treat publishing as a separate step.
Official docs: Codex CLI, pricing and plans, sandboxing and the CLI flag reference. For a longer real job, our daily AI news digest guide shows GPT doing research with code that validates its output and checks source links. AI Work OS shows how we split builder and reviewer work across agents.
Quick checklist
- Check that your plan lists the Codex surface and model you want to use.
- Write what "done" means first: only the Saturday time in
index.htmlchanges, from 09:00 to 10:00. - Commit the starting file in git and save its hash outside the copy.
- Ask for one change, in one sentence, naming the file.
- Run
git diff,git diff --cachedandgit status --short --untracked-files=all, and compare them with the expected output. - Open the page the way a visitor would.
- Ask for the edit to the absent
menu.html, and confirm the Saturday edit is still the only change and no new files appeared. - Keep publishing as a separate step with a person.