Agent harness

Plan, checkpoint, then execute

Have the agent propose a plan and stop. Approve or correct it before any changes are made.

The problem

When an agent plans and executes in one go, a wrong early assumption turns into many files of wrong work. Correcting direction after the fact costs far more than correcting it before.

The pattern

Split the run into two phases with a hard stop in between:

  1. Plan: the agent reads the relevant code, then writes a numbered plan: files to touch, approach, risks, open questions. It makes no changes.
  2. Checkpoint: you review the plan. Fix misunderstandings, answer questions, cut scope.
  3. Execute: the agent follows the approved plan, step by step, and flags any deviation instead of improvising silently.

Saving the plan to a file also gives you something to resume from if the session ends.

Template

Phase 1 – plan only. Do not edit any files or run state-changing commands.

Read what you need, then reply with:
1. Your understanding of the task in 2–3 sentences.
2. Files you will create/modify/delete, one line each with the reason.
3. Step-by-step plan (numbered, each step small enough to verify).
4. Risks and how you'll check for them.
5. Open questions (if any, ask them and stop).

Save this plan to `PLAN.md`, then wait for my "approved".

Phase 2 – after approval
Execute the plan in order. After each step, tick it off in PLAN.md.
If you need to deviate from the plan, stop and explain before doing it.

When not to use it