The plan-first workflow

11 min read text
Course contents (20 lessons)
  1. Meet Claude Code
  2. What Claude Code is and how it differs from a chat window
  3. Installing Claude Code and signing in
  4. Your first session: explore, ask, change
  5. Asking well and staying in control
  6. Asking for changes: context, goal, constraints and acceptance criteria
  7. Reading and approving edits
  8. Permission modes: how much freedom to give
  9. Project memory and slash commands
  10. CLAUDE.md: teaching the tool about your project
  11. Slash commands and custom commands
  12. Everyday coding workflows
  13. The plan-first workflow
  14. Understanding unfamiliar code
  15. Debugging with Claude Code
  16. Refactoring safely
  17. Writing tests with Claude Code
  18. Git, small changes, cost and security
  19. Git workflows: branches, commits and pull request descriptions
  20. Keeping changes small and reviewable
  21. Context and cost awareness
  22. Security habits: secrets, commands and untrusted input
  23. Extending the tool, teamwork and a final project
  24. Hooks and MCP servers explained
  25. Team practices for AI-assisted coding
  26. Final project: building a small app step by step

Why plan first

When the tool starts editing right away, it commits to the first idea that fits. If that idea is wrong, you find out after twelve files have changed. A plan is cheap to read and cheap to change. A wrong implementation is expensive to review and expensive to undo. So for anything bigger than a small fix, I ask for a plan first.

The four-step loop

  1. Explore. Let the tool read the relevant code and report back. No edits.
  2. Plan. Ask for a written plan. Read it, challenge it, correct it.
  3. Implement. Ask it to carry out the plan, in steps if the work is large.
  4. Verify. Run tests, read the diff, try the behaviour yourself.

Step 1: explore

I want to add email notifications when an invoice becomes overdue. Before we plan, find: where invoice status changes, how emails are sent today, and whether any background job system exists. Summarise with file paths. Do not edit anything.

Notice that this does not ask for the design. It asks for facts about the current code. Good plans come from good facts.

Step 2: plan

Based on that, propose a plan to send an overdue email once per invoice. Include:
1. The approach and why you prefer it over the main alternative.
2. The files you will change or add.
3. How we avoid sending the email twice.
4. The tests you will write.
5. Risks or open questions.
Keep it under 30 lines. Do not edit any files yet.

Why it works

The numbered list forces the plan to cover the parts that people forget: duplicates, tests, risks. "The main alternative" makes the tool show a choice, so that you can pick. The line limit stops it from writing an essay. When I read the plan, I look for wrong assumptions about my system, and I usually find one.

Now respond to the plan like a reviewer:

Changes to the plan: use the existing background job runner, not a new timer. Store a sent flag on the invoice rather than a new table. Skip draft invoices. Update the plan and then wait.

Step 3: implement in steps

Implement step 1 of the plan only: the sent flag and the migration. Stop after that and show me the diff. Do not start step 2.

Working in small steps means each diff is short, each review is quick, and a wrong turn costs one step, not the whole feature. You can commit after each step.

Step 4: verify

Run the tests for the invoices module and the full suite. Then list what is not covered by tests that I should check by hand.

The second sentence is a trick I like. It asks the tool to name its own weak spots. Sometimes it points at real gaps.

Save the plan

For work that lasts more than one session, ask the tool to write the plan into a file in the repository, for example a short markdown file in a docs or notes folder. A plan in a file survives /clear, can be edited by you and can be reviewed by teammates. Start the next session with "Read the plan file and continue with step 3."

When you can skip planning

  • Typos, renames and one-line fixes.
  • A change you could describe in one sentence with no choices.
  • Throwaway experiments in a scratch branch.

If you could write the diff yourself in two minutes, just ask for it.

When the plan goes wrong

If during implementation the tool finds that the plan does not fit, tell it to stop and report rather than improvise: "If any step does not work as planned, stop and tell me before changing the approach." Silent changes of direction are how a three-file task becomes a fifteen-file one.

The common mistake

The common mistake is accepting the plan without reading it because it looks organised. A neat plan can still rest on a false assumption, for example that your project has a job runner when it does not. Read the plan as if a colleague had written it, and ask about anything you do not understand.

Try it yourself

Pick a feature that touches at least three files. Run the four-step loop. Time yourself: how long did the exploring and planning take, and how long did review take? Then ask yourself whether the plan changed in a way that avoided a mistake. If yes, you have just seen why this is worth doing.

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account