Module 03.3

Codex debugging and review

Do not trust smooth answers.
Trust evidence.

Codex becomes dangerous when you confuse fluency with correctness. This lesson trains the debugging and review loop: reproduce first, ask for changes against real evidence, validate with commands, and read the diff before you approve anything.

Outcomes

What disciplined Codex review looks like

Reproduce first

Before asking for a fix, make the bug observable: failing test, broken screen, log trace, or exact reproduction steps.

Validate after changes

Ask Codex to run or specify checks, then inspect whether those checks actually prove the problem is resolved.

Review as a separate lens

Use `/review` or a review-oriented pass when you need a bug finder, regression detector, or second look at risky code.

Workflow

The debug and validation loop

01

Capture the failure

Collect the failing command, stack trace, screenshot, or reproduction steps so the problem is not abstract.

02

Constrain the search space

Point Codex at the most likely files or subsystems instead of inviting it to guess across the whole codebase.

03

Ask for a fix plus validation

Do not ask only for code changes. Ask what should be run or checked after the patch.

04

Inspect the diff

Read what changed, especially around assumptions, deleted code, and any new edge cases.

05

Run review when risk is higher

If the change touches sensitive logic or broad surfaces, use review mode as an explicit second pass instead of trusting the first patch.

Templates

High-signal prompts for debugging and review

Bug fix

Ask for evidence-based debugging

I can reproduce this issue with:
- Command: pnpm test src/foo.test.ts
- Failure: timeout after the loading spinner never clears

Please inspect the likely files first, explain the probable cause, propose a fix, and tell me exactly which checks should pass afterward.
Review

Use a second pass when risk is real

/review

Focus on:
- behavioral regressions
- missing tests
- risky assumptions
- performance or security concerns

Treat findings as the primary output.

Practice

Three drills that force review discipline

Drill 1: reproduction pack

  • Pick one real bug.
  • Write a reproduction note with command, file, and visible symptom.
  • Only then ask Codex for the fix.

Drill 2: diff reading

  • Have Codex make a non-trivial edit.
  • Read the diff line by line.
  • Write down two possible regression risks before accepting it.

Drill 3: review mode

  • Take an existing change, not one you just approved.
  • Run a review-oriented pass.
  • Compare what a second lens catches that implementation mode missed.
Common mistake

Asking for fixes without reproduction

If Codex cannot see or infer the failure clearly, it is guessing from symptoms rather than solving the real problem.

Common mistake

Treating “no new errors” as proof

Absence of obvious failure is weaker than explicit confirmation that the intended behavior is restored.