Day 03 of 21
Plan Mode - make Codex think before it builds
Goal: Learn how to ask Codex for a written plan before it touches any file, how to read and evaluate that plan, and how to reduce it if it looks too large.
What to do
Understand what a Codex plan is — and what it is not
A Codex plan is a numbered list that Codex writes before it changes any files. It tells you which files it intends to touch and what it will do to each one. A plan is not the same as an edit — it is a preview you can read, question, or reject before anything happens on your computer.
Ask Codex to write a plan — no file changes yet
Start Codex in your project folder. Give it your one-sentence task, but add a plan-only instruction at the end. The key phrase is: "Do not change any files. Show me a plan only and wait for my approval." Copy the exact prompt below and fill in your task.
I want you to [PASTE YOUR ONE-SENTENCE TASK HERE].
Before you touch any file:
1. Write a numbered plan that lists every file you will change
2. For each file, describe exactly what you will do to it
3. List any files you will NOT touch
Do not make any changes until I say "go ahead." Wait for my approval.Read the plan and spot the warning signs
A safe plan is specific: it names exact files, describes one clear action per file, and lists nothing unexpected. An unsafe plan is vague or includes files you did not mention. Read the example below and then apply the same checks to your own plan.
Safe plan example — task: change homepage heading from "Welcome" to "Start here"
1. File: src/pages/index.html
Action: Find the h1 tag and change text from "Welcome" to "Start here"
No other files will be changed.
Unsafe plan example — red flags in brackets:
1. [vague] Update the homepage heading
2. [unrelated file] Update package.json dependencies
3. [too broad] Fix any other issues I notice while I am there
Check your own plan for:
- Vague actions ("update", "fix", "improve") without a specific target
- Files you did not mention in your task
- Steps that say "and anything else that needs it"Ask Codex to reduce the plan if it is too big
If the plan lists more than three files or feels complicated, shrink it before approving. The rule is: approve only the part you fully understand. If any step is unclear, reduce the task to just the first safe action and do the rest in a future session.
This plan is too large for one session. Please reduce it to the smallest possible first step only.
The first step should:
- Touch no more than one file
- Describe a single specific change
- Leave everything else for a future session
Show me only that one step and wait for my approval.Approve and then compare the plan to the diff
Once the plan looks right and small, type "go ahead." Then open GitHub Desktop immediately and compare the changed files to what the plan said. The diff should match the plan exactly. If Codex changed something that was not in the plan, discard that specific file and ask Codex to explain why it changed it.
Expected result
You asked Codex for a plan before it touched any files, read the plan and identified safe vs unsafe elements, reduced the plan to a single-file first step, approved it, and verified that the diff matched the plan exactly.
Key takeaway
- Asking for a plan before edits is the most powerful safety habit in this challenge. It costs you 30 seconds and saves hours of undoing unexpected changes. Always ask for a plan. Always check that the diff matches the plan.