AI-Assisted Software Development: Coding Agents in PracticeThe plan-implement-verify workflow · Lesson 7 of 17

The explore-plan-implement-verify loop

Article · 14 min · 9 min lecture

Video lecture

The explore-plan-implement-verify loop

14 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 14

Plan → implement → verify

  • Five-step loop
  • Checkpoints where you apply judgment
  • Small steps you can trust

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

Why agents need a loop, not a prompt

The most common failure with coding agents is not bad code. It is the right code for the wrong plan, or a sprawling diff that nobody can review. The antidote is a deliberate loop with checkpoints where you, the engineer, apply judgment:

  1. Explore. The agent reads relevant code and reports what it found. No edits.
  2. Plan. The agent proposes a step-by-step plan, files to change, risks and a test strategy. You review and edit the plan.
  3. Implement. The agent executes one step at a time in small, reviewable increments.
  4. Verify. Tests, type checks, linters, and a manual check of behavior. The agent must show evidence, not claims.
  5. Review and commit. You read the diff, then commit with a meaningful message. Repeat for the next step.

Anthropic's Claude Code best-practice guidance describes essentially this sequence (explore, plan, code, commit), and tools increasingly bake it in: Claude Code has a read-only plan mode; Cursor, Copilot and Codex support asking for a plan before edits. The mechanism differs, the discipline is the same.

Checkpoint 1: exploration without edits

Ask explicitly for read-only exploration:

Explore only; do not edit files yet. Read the code involved in CSV export and summarize:
(1) the request path from route to database, (2) where memory is allocated per row,
(3) existing tests that cover export, (4) anything surprising. Cite file paths and line ranges.

The citations let you spot-check claims in seconds. If the summary is wrong, the plan will be wrong; correct it now.

Checkpoint 2: a plan worth reviewing

A good plan is short, ordered, and testable:

Plan: stream CSV export
1. Add failing test: export of 10k fixture rows keeps heap growth under threshold (test/load/export.test.ts).
2. Add streamRows() in src/infra/db/stream.ts wrapper (reuse existing cursor helper).
3. Change exportCsv handler to pipe rows through csv-stringify stream; keep headers identical.
4. Byte-compare output with the existing small fixture.
5. Run npm test && npm run check; report results.
Risks: backpressure on slow clients; transaction held open during stream.
Out of scope: Excel export.

Your review questions: Is step order safe? Is the risk list honest? Does the test prove the goal? Edit the plan in the chat or in a PLAN.md file before any code is written. For large work, keep the plan in the repository so a fresh session (or a teammate) can resume.

Checkpoint 3: small steps, frequent commits

Ask the agent to implement one plan step at a time and stop. Small diffs are easier to review and easier to revert. Commit after each verified step, so git becomes your undo button. Many teams use a dedicated branch per task, and for parallel agents, git worktrees (separate working directories on separate branches) so agents do not trample each other's files.

git worktree add ../invoicing-stream -b feat/stream-export
cd ../invoicing-stream && claude   # or codex, or open in your editor

Checkpoint 4: verification with evidence

Require proof, not assertions:

Run npm test and npm run check. Paste the final summary lines. If anything fails,
show the failure and your hypothesis before changing code.

Also verify what tests do not cover: run the app, hit the endpoint, look at the UI. For front-end work, some agents can drive a browser via MCP and capture screenshots; still look yourself before merging.

Worked example: the loop in practice

A two-person studio in Manchester adds a "resend receipt" button to a Shopify-connected dashboard. Exploration reveals receipts are generated in two places (a legacy path and a new one). Without the exploration checkpoint, the agent would have changed only the new path. The plan adds a failing test for both paths, extracts a shared function, then wires the button. Four small commits; total review time under twenty minutes.

When to break the loop

For trivial changes (rename a variable, fix a typo), the full loop is overkill; use pair mode and move on. For high-risk changes (auth, payments, data deletion), tighten the loop: plan reviewed by a second engineer, and no auto-accept of edits.

Pitfalls

  • Skipping the plan because the agent "seems to know". Plans are cheap; rework is not.
  • Accepting "all tests pass" without seeing output. Agents occasionally misread results or run the wrong command.
  • Letting the agent edit tests to make them pass. Watch for changed assertions in the diff.
  • Mega-commits. If the diff is too big to review, it is too big to merge.

How to measure success

Track average PR size for agent-assisted work and the share of agent PRs merged without major rework. Both should improve as the loop becomes habit.

Key takeaways

  • Explore read-only first and insist on file and line citations.
  • Review and edit the plan before code exists; persist large plans in the repo.
  • Implement one step at a time with commits; use git worktrees for parallel agents.
  • Verify with evidence, not claims, and watch for edited test assertions.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. Where does human review add the most leverage in the agent loop?
  2. You run three agents in parallel on the same repository. What prevents them from overwriting each other's changes?

Put it into practice

Run the full five-step loop on one real ticket, saving the plan in PLAN.md, and compare the final PR size with your usual.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.