Lesson 2 - Plan Then Execute

Welcome to Plan Then Execute

Draft-critique-revise is perfect for improving one artifact, but some tasks are too big to draft in a single piece — a full report, a multi-part research project, a folder-wide reorganization. Forcing those into one loop overwhelms the check and tangles the revisions. The pattern for them is plan then execute: first break the task into a plan of ordered steps, then run a small, focused loop on each step. It’s the “decompose the problem” instinct, made into a loop shape — and, as you’ll see, it’s also more predictable and safer than the alternative of deciding each move on the fly.

By the end of this lesson, you will be able to:

  • Recognize a task too big for a single loop
  • Break a big task into a plan of steps, each its own sub-loop
  • Explain why reviewing the plan first makes the whole thing more reliable
  • Understand the security reason to prefer a fixed plan over deciding as you go

Let’s start with decomposition.


Break the Big Task Into Steps

The core move is simple: plan first, execute second. Instead of pointing a loop at “write the full competitor report” and hoping, you first have the AI (or yourself) produce a plan — an ordered list of steps: gather the data on each shop, draft each section, assemble and check the whole. Then you run each step as its own small loop, most of them a draft-critique-revise from Lesson 1. The big task becomes a sequence of small, manageable ones.

A pipeline titled 'Plan then execute: break a big task into a plan, then loop on each step'. A blue 'Big task — too big for one draft' box flows into a purple '1 · Plan — break it into ordered steps' box containing a checklist: Step 1 gather, Step 2 draft, Step 3 assemble, with the note 'review the plan before running it'. That flows into a green '2 · Execute each step' box with three rows, each a small loop: 'Step 1 — its own small loop', 'Step 2 — draft, critique, revise', 'Step 3 — its own small loop'. That flows to a green 'Done — assembled' box. A caption notes each step is small enough for a focused loop of its own and you can check the plan before any work starts, which makes it more predictable and safer than deciding the next move on the fly as content streams in.
Plan then execute. Break the big task into an ordered plan you can review, then run a small, focused loop on each step and assemble. Each step is manageable, and you get to check the plan before any work starts.

Why this beats one giant loop: each step is small enough for a real check. A single loop on a whole report has a check that can’t hold all of it, so quality slips and revisions in one section quietly break another (the “undoing its own work” pattern from Module 6). Broken into steps, each has a focused goal and a check it can actually pass — and you assemble verified pieces rather than wrestling one sprawling draft.


Reviewing the Plan Is the Superpower

The most valuable part of plan-then-execute is easy to miss: you get to check the plan before any work happens. The plan is cheap to produce and cheap to read, so you can catch a wrong approach at the planning stage — before you’ve spent rounds (and money) executing it. If the AI’s plan for the report skips pricing entirely, or orders the steps wrongly, you fix the plan in seconds, rather than discovering the problem after it’s built the whole thing wrong.

This is a check at a new level. Draft-critique-revise checks the output; plan-then-execute adds a check on the approach. Catching a bad approach early is enormously cheaper than catching a bad output late, which is why decomposing a big task and reviewing its plan is one of the highest-leverage moves in loop engineering. Treat the plan as its own artifact with its own quick check: “Does this plan, if executed perfectly, actually produce what I want?”

A good plan is checkable and ordered

When you have an AI produce a plan, ask for it as concrete, ordered steps you could hand to someone else — not a vague strategy. “1. Pull each shop’s current pricing from its own site. 2. Draft one section per shop. 3. Assemble and check every claim is sourced.” A plan like that is reviewable at a glance and each step is small enough to loop on. A plan that’s really just a restatement of the goal (“research the competitors and write it up”) hasn’t decomposed anything.


Plan-First vs. Decide-As-You-Go

There’s an alternative to planning first: let the agent decide each next step on the fly, reacting to what it just saw — think, act, observe, think again. This reason-and-act style is flexible and is the classic way agents were first built, but plan-then-execute is usually the safer, more predictable choice, for two reasons.

First, predictability. A fixed plan you reviewed is a known quantity — you know roughly what will happen. An agent improvising each step can wander somewhere you didn’t expect, and you only find out afterward. For anything with real consequences, the reviewed plan is easier to trust.

Second — and this is a genuine, current concern — security. When an agent decides its next action based on content it just read, that content can influence the decision. If the agent is reading web pages or documents that contain instructions (hidden or overt), a decide-as-you-go agent can be nudged into doing something you didn’t intend, because the untrusted content arrives exactly at the moment it’s choosing what to do next. Recent security work argues this makes the pure reason-and-act style risky for agents that browse or read untrusted material, and recommends planning first — where the plan is fixed before the agent starts ingesting outside content — as the safer default. You don’t need the technical details; the takeaway is practical: for agents that touch untrusted content, prefer a reviewed plan over letting the content steer the next move.


A Harborlight Example

The owner wants a full “local market report” — competitor pricing, local events, and a recommendations section. As one loop, it’s a mess: the check can’t judge the whole thing, and every revision to one part jostles another. So they use plan-then-execute. Plan: the AI proposes steps — (1) research each of three competitors, sourced; (2) research upcoming local events, sourced; (3) draft the recommendations from the findings; (4) assemble and check every claim is sourced and the report is under two pages. The owner reviews the plan and catches that it never validates event dates, so they add “confirm each event is still upcoming” to step 2 — a fix that cost ten seconds at the plan stage and would have cost a rebuild later.

Then they execute: each step is its own small loop (the research loops from Module 4, the drafting a draft-critique-revise), producing verified pieces. Assembling checked pieces is easy, and the final report holds together — because it was built from small, individually-passed steps against a plan the owner had already approved. The big task got done well precisely because it was never attempted as one big loop.


Practice Exercises

Exercise 1: One loop or plan-then-execute?

Which fits: (a) tightening a single email, (b) producing a 20-page onboarding guide with sections on setup, usage, and troubleshooting, (c) writing one social caption?

Hint

(a) and (c) are single artifacts — draft-critique-revise. (b) is too big for one loop and has natural parts — plan-then-execute: plan the sections, then run a focused loop on each, then assemble. The tell is “too big to draft in one piece, with separable parts.”

Exercise 2: Check the plan

An AI’s plan for a research report is: “1. Research the topic. 2. Write the report.” What’s wrong with it, and why does catching that now matter?

Hint

It hasn’t actually decomposed anything — it’s just the goal restated, with steps too big to loop on or review. Catching it at the plan stage costs seconds; you’d ask for concrete, ordered sub-steps (which sources, which sections, what check). Catching it after it built the wrong thing would cost a rebuild.

Exercise 3: The security reason

Why might you prefer a fixed, reviewed plan over an agent deciding each step on the fly, when the agent is reading web pages you don’t control?

Hint

Because untrusted content arrives exactly when a decide-as-you-go agent is choosing its next action, so instructions hidden in that content can steer it somewhere you didn’t intend. A plan fixed before the agent reads outside material isn’t influenced that way, making it the safer default for agents touching untrusted content.


Summary

Plan-then-execute is the pattern for tasks too big to draft in one piece: first break the task into an ordered plan of steps, then run a small, focused loop (usually a draft-critique-revise) on each step and assemble the verified pieces. It beats one giant loop because each step is small enough for a real check, so quality doesn’t slip and revisions don’t break other parts. Its superpower is that you can review the plan before any work happens — a check on the approach, not just the output, catching a wrong direction in seconds instead of after an expensive rebuild. And it’s usually preferable to deciding each step on the fly: a reviewed plan is more predictable, and it’s safer for agents that read untrusted content, because a plan fixed up front can’t be steered by instructions hidden in the material the agent later reads. Decompose the big task, check the plan, then loop on each step.

Key Concepts

  • Plan-then-execute — break a big task into an ordered plan, then run a focused loop per step.
  • Decomposition — turning one oversized loop into several small, checkable ones.
  • Checking the approach — reviewing the plan catches wrong directions before you pay to execute them.
  • Plan-first vs. decide-as-you-go — a reviewed plan is more predictable and safer with untrusted content.

Why This Matters

Plan-then-execute is what lets loop engineering scale beyond one-artifact tasks to the big, multi-part work that’s often the most valuable — reports, guides, projects. And the “check the plan first” move is one of the highest-return habits you can build: catching a bad approach early is dramatically cheaper than fixing a bad result late. The security angle is a live, practical concern as more people point agents at the open web, and knowing to prefer a reviewed plan there is real protection. Next, you’ll learn the pattern for when the problem isn’t size but variance — generate-and-test, where instead of refining one attempt you produce several and pick the best.


Continue Building Your Skills

You can now handle big tasks with plan-then-execute — decompose into a reviewable plan, then loop on each step — and you know why checking the plan first, and preferring a fixed plan over improvising with untrusted content, makes it reliable and safe. Reach for it whenever a task is too big to draft in one piece. Next, you’ll meet the pattern for high-variance tasks, where one draft is a coin flip: generate several candidates and test them, rather than polishing a single lucky-or-unlucky start.

Sponsor

Keep DATATWEETS free. Help fund practical data, AI, and engineering lessons for learners worldwide.

Buy Me a Coffee at ko-fi.com