Skip to content
Agentic Levels
Start hereLevelsTracksPromptsAbout
Get my levelGet my level

  • Start hereYour first useful task with AI.
  • Level quiz8 questions. No AI needed.
  • Fluency ScoreYour Level and a score, from your own AI.

  • LevelsThe 11 levels, in order.
  • LessonsShort lessons, filter by level.
  • TracksGuided paths by tool, role or goal.
  • Set up your AI tool
  • Starter packFree files that help AI remember.

  • PromptsReady prompts to copy and adapt.
  • ChatGPT vs Claude vs GeminiPick the right one for the job.
  • How-tos
  • ReferenceCommands for Claude Code, Codex, Antigravity.
  • ResourcesHand-picked reading and tools.

  • Your progress
  • Your next moveAn interview that picks your next skill.
  • Your next lessonsThe next lessons at your level.
  • Updates

  • Pricing
  • About
  • FAQ & Feedback
  • Work with us
  • How we handle your data
Sign inPreferences
AboutPricingHow-tosPromptsStarter packMy stackHow we handle your data

© 2026 Fuentes Studio

PrivacyTermsRefundsAccessibilityAI content policyCredits
yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

←Codex Fundamentals
  1. Tracks
  2. ›Codex Fundamentals: Module 4
  3. ›Review diffs before commit
5

Level 5 · Lesson 7 of 12 · Free

Review diffs before commit

Accept the change you asked for, not every change present

After this, you'll be able to inspect a Codex diff, separate intended edits from incidental changes, and stage only accepted work.

Before you start

Complete Run the proof loop first.

The idea

Diff review is where you take ownership back. Codex writes the patch. You still decide what belongs in the commit.

Worked example

Before and after

Before: Looks good, stage everything (the fix works, but the diff also holds changes you didn't ask for). After: List every file you changed, and for each one the schedule fix doesn't need, tell me why it changed. Stage only the schedule files.

What the AI might say

Two files fix the schedule: the page and its helper. The lock file (an automatic list of the exact add-ons a project uses) also changed because a package was installed, which wasn't part of the task.

Review FlowMove through Review diffs before commit, check proof, then fix only the weak part.
yesnorun it again
StartBegin with the real task
Review diffs before commitAfter this, you'll be able to inspect a Codex diff, separate intended edits from
1Proof visible?Intended files are separated from incidental changes
Ready to useReview one Codex diff and decide what to stage, inspect, or reject
Fix the weak partBreaks when an unrelated cleanup ships with the bug fix and creates a second

Review in three passes. Behavior first. Did it solve the task?

Scope next. Did it touch only what you expected?

Proof last. Do the checks actually match the risk?

The review pane is the panel in the Codex app that lists changed files. It needs your project to be a Git repository (a folder with saved history), and the app offers to set that up if it isn't. You can stage a change (mark it for the next commit) or revert it (undo it) for the whole diff, one file, or one chunk (one block of changed lines), using buttons such as Stage all and Revert all.

The pane opens on Unstaged (changes you haven't picked for the next commit). Its header also lets you switch to Staged, a single Commit, the whole Branch, and just the Last turn (Codex's most recent reply). That matters when Codex ships one good change bundled with an unrelated cleanup, and you don't have to accept the whole patch.

Comment on a line. Select the plus beside any line in the diff to leave a note there, such as Why did this change? The note sits on the exact line, so you don't have to describe where it is.

Ask Codex to check the work. Type /review and Codex asks whether to review against a base branch (the version your work started from) or just your uncommitted changes (edits not yet saved as a commit). Treat its answer as a second pair of eyes, not a replacement for yours.

Watch for churn you didn't ask for. Stray formatting (spacing and layout changes that do nothing) in unrelated files, a hand-edited generated file, a dependency change from an install, or a test that quietly got weaker. Each one still needs a reason.

I staged the two files and left the lock file for you. Not comfortable with the pane's buttons? Ask in words instead: Stage only these files and commit with this message.

Why it works: the After reviewed scope, not only behavior. The unrelated change got a reason or stayed out of the commit.

In Claude Code and Antigravity: Claude Code's /diff shows what changed, and /code-review checks the current diff for bugs. Antigravity asks you to review its implementation plan before it builds, but the sources for this track describe no diff pane there. In either tool, you can ask for the same scope question in words.

A good commit holds the smallest accepted change that passes proof. Everything else waits, or gets its own task.

Try it (14 min)

Paste this into Codex

Review this Codex diff summary:

Task: [original task]
Changed files: [paste file list]
Proof run: [paste commands and results]
Unexpected changes: [paste any surprise, or write none]

No diff yet? Use the practice site. First give it a starting point, so the pane shows only your change: ask Codex *Commit everything in this project as the first commit, with the message "Start practice site". If it says it doesn't know who you are, set my name and email for this project only, then try again.* Then ask *Show me the commit history* and check it lists that one commit. (The worktree in lesson 12 also needs it.)

Then ask Codex to add a footer line to index.html. Open the review pane (the panel that lists changed files; if you can't find it, ask Codex *Where do I open the review pane?*) and paste what it lists. It should show only index.html with your one new line.

Return:
1. Files to stage.
2. Files to revert or inspect.
3. One question for Codex if the diff is unclear.
4. Commit message only if the diff is ready (a one-line note saying what the commit does).

On the practice site, finish by asking Codex: *Stage index.html and commit it with that message.* Then ask: *Show me the last commit and its files.* Lesson 12 builds on this commit.

What a good response looks like

1. Files to stage: index.html. The pane shows one new line inside a footer tag, "Made in my practice folder", under the paragraph. Nothing else in the file moved. 2. Files to revert or inspect: none. Only one file changed, so there is no stray formatting to question. 3. Question for Codex if unclear: "Did you change any spacing or other lines outside the footer?" 4. Commit message: Add footer line to practice site.

Proof: I opened index.html in the browser and the footer shows under the paragraph. Not checked: how the page looks on a phone. After the commit, ask Codex to show the last commit and its files.

Check yours against

  • Intended files are separated from incidental changes
  • Generated, dependency, auth, data, or config changes are inspected
  • The proof matches the staged change
  • The commit message is withheld when the diff is not ready
  • Staging every file because the main behavior works.
  • Ignoring package manager lockfile changes.
  • Accepting test edits that reduce coverage (how much of the code the tests check).
  • Letting generated files into the commit without the command that produces them.

When this breaks

  • Breaks when an unrelated cleanup ships with the bug fix and creates a second regression.
  • Breaks when a generated artifact is hand-edited and later overwritten.

AI can help with this

Use Codex to help you inspect a Codex diff, separate intended edits from incidental changes, and stage only accepted work. Start with the exercise prompt and your real input. Ask for one draft, then check it against this proof: Intended files are separated from incidental changes. Accept only the version you can verify yourself.

You can now

✓

You can review behavior, scope, and proof

  • ✓You can stage part of a Codex change
  • ✓You can spot incidental churn
  • ✓You can withhold commit until the diff is ready

Try it from memory

Pulling this out of your own head now is the part that actually moves it into long-term memory. Re-reading only feels like it does.

A Codex run on your project changed ten files and only three solve the task. Write what you stage, what you leave out, and the order you review in.

One good answer: 'Task: fix the dates on my school's term calendar. Review behavior first, scope second, proof third. Stage the calendar file and its test. Leave out the reformatted and generated files until I see a reason.' If you stage only what solves the task and leave out whatever is unexplained, you're there.

Key takeaways

Codex writes the patch. You own the commit. Stage only the change that solves the task and passes proof.

  1. 1Review behavior first, scope second, proof third.
  2. 2Good and bad changes can appear in the same diff.
  3. 3Generated and dependency files need a reason.
  4. 4A commit should be smaller than the agent run when the run wandered.

Go deeper

  • Codex app reviewlearn.chatgpt.com (opens in a new tab) ↗
Up nextUse MCP only for a real gap→

Was this helpful?

Related lessons

Write a task brief Codex can finishHand off between local, IDE, and cloud
← Back to Codex Fundamentals