Lesson 01 · AI Hero

Plan before code

The one habit to teach a professional developer who has never driven an agent. Ten minutes.

The problem it solves

An agent asked to write code straight away has to guess. It has not read your files, so it invents a structure, invents a convention, and produces something plausible that you then have to unpick. The cost lands on you at review time, which is the most expensive moment to find it.

What plan mode is

In plan mode you enter a restricted mode. The agent can read files, explore the codebase and analyse code. It cannot edit files, run commands, or run tests. It then “explores your repo, asks clarifying questions, and outputs a step-by-step plan.”

“Plan mode isn't optional. It's a foundational tool for AI-assisted coding.”

Matt Pocock, An Introduction To Plan Mode

Why it works, twice over

For the agentFor you
It “builds that context window before any code gets written.” By the time it starts, the files are loaded and the structure is understood. The guessing is gone. “You don't know what you want until you see it.” The plan is a cheap prototype of the work. You iterate on the plan, not on the code.

The transfer. You already do this. It is the design conversation you have with a colleague before either of you opens an editor. Plan mode is that conversation, with something that has read the whole repository first.

Check yourself

In plan mode, which of these can the agent still do?

Matt gives a reason plan mode helps you, not the agent. Which?

From memory: name the three things the agent is stopped from doing in plan mode.

Editing files, running commands, and running tests. It keeps reading, exploring and analysing.

Do this before the next lesson

Take one real ticket. Start the agent in plan mode. Do not let it write a single line until the plan is one you would hand to a colleague. Notice how many of your corrections are about intent rather than syntax. That ratio is the argument for the habit.

Read the source

Primary source, worth twelve minutes: An Introduction To Plan Mode by Matt Pocock. Append .md to that URL for the clean text.

Stuck on anything here? Ask me. I am your teacher for this topic, and a half-understood habit is worse than none. Ask me to go deeper on any line above, or to run the quiz again with harder options.