Using Plan Mode in Codex CLI
00:00
You’re finally ready to start using Codex to add features to your project. So now the question is, what features are you going to add? And if you run the command uv run rpcontacts, you’ll see your interface with the test contacts you added earlier.
00:15 But if you select one and you press the button Delete, nothing happens. And if you press the big red button Clear All, nothing happens. So this is what you’ll use Codex for.
00:26
You’ll implement deletion and clearing all contacts. So at the root of your repository, run the command codex. And once you’re in, run the command /plan, switching Codex to Plan mode.
00:40 Now the Plan mode just means that Codex will generate a plan before implementing the changes you request because this tends to yield better results.
00:48 So while in Plan mode, and you should see an indicator if you’re in Plan mode. If you’re in Plan mode, go ahead and ask for the changes you want, which in this case is “Implement the behavior for the button delete, which should delete
01:06 the currently highlighted row of the DataTable and implement the behavior for the button Clear All, which should delete all existing contacts.”
01:27 So you type that, you press Enter, and now you give it some time. Codex will now work on the plan. Now the interesting thing is while it’s working, if you’re able to keep up, you can read through the transcript and see more or less what’s happening.
01:43 You can also scroll up and down if you want to read in more detail what’s going on. You’ll want to take a look through the plan because if you’re happy with the plan, you can just tell Codex to go with that plan.
01:56 And if you want to make changes, you can ask for changes on that plan. Now whenever Codex gives you a plan like this, you’re supposed to read it and see if it makes sense.
02:08 For the sake of your own time, I’m just skimming through it. But you’ll want to take a look at the plan and even if it’s suggesting things that you don’t necessarily fully understand, because you can use Codex to amplify your knowledge, you’ll want to read and look for sentences, for decisions that don’t feel like they make sense.
02:30 Because even if Codex is going to do work that you don’t fully comprehend, you can check if the plan looks sensible or not. So you take a look at the plan and if you’re not happy with it, you should ask for changes.
02:46 If you’re happy with the plan, pick option one, “Yes, implement this plan.” And if you want to change something of the plan, pick the option “No, stay in Plan mode” and then give further instructions to Codex.
02:58 Now because this is a sound plan, you’ll be happy to accept it. And that’s what you’ll do in the next lesson. Implement this plan and make sure that the implementation works.
Become a Member to join the conversation.
