FRI, 17 JUL 2026
Live · Daily AI brief from inside the industry
14:14:36 UTC

CHAPTER 6 OF 7 · 8 min · 3 COPYABLE ASSETS

How to turn a plan file into working code with Claude Code (/plan and /implement)

Create a plan.md carrying every implementation detail (patterns, files, task order, validation), then execute it in a brand-new session with the /implement command.

TL;DW

The /plan command converts your exploration into a single plan.md artifact: summary, locked-in decisions, patterns to follow, the exact files to create or change, task order, and a self-validation strategy covering type-checks, linting, unit tests, and even browser automation. Then comes the critical move. You implement in a brand-new session with /implement path/to/plan.md. The plan carries all the context, the fresh agent brings unbiased eyes, and it writes the code, validates its own work, and hands back to you for code review.

Lesson · 7 parts

After the subagent research, the agent presents a synthesis with real decisions to make. In production work you would chew through those carefully. On camera Cole delegates: go with your recommendations. Either way, the planning output must be a single artifact holding everything the implementing agent will need.

The invocation
/plan Go with your recommendations and create the plan for AT-22.

The command phases the agent through research, codebase exploration, then writing plan.md. Where the PRD stayed at requirements level, the plan lives in the weeds, and its structure is the contract.

Each ingredient exists to kill a specific failure mode. Locked decisions stop the implementing agent from re-litigating choices you already made. Patterns-to-follow stops it from inventing a second style in a codebase that already has one. The explicit file list keeps the diff surface small and reviewable. Task order gives the agent a spine for its internal todo list instead of improvising sequence. And the validation section decides in advance what 'done' means, so the agent finishes to a standard rather than to a feeling.

What every plan.md must contain

  • Summary plus user story
  • Decisions locked in during exploration
  • Patterns to follow from your existing codebase
  • Exact files to create or change
  • Task order for the agent's internal todo list
  • Self-validation strategy: type-check, lint, unit tests, optional e2e

Cole is comfortable handing all the coding to the agent for one reason. He never left the driver's seat: he shaped the exploration, answered the questions, iterated the plan. The agent then also writes the unit tests, integration tests, linting, and type checks, so that when control passes back to a human, far less remains to correct. The engineer stops being the bottleneck.

The generated plan shows the work summary, the locked decisions, the files to create and update, and a granular task list. That list is intentionally not ticket material; it is one implementation's internal checklist. Self-validation is spelled out too, and can extend to real end-to-end testing: the agent-browser skill can open the app, create polls, and vote like a user.

The counterintuitive core of the PIV loop: with the plan ready, do not implement here. The planning conversation has accumulated bias, and a fresh session gets clean eyes. Since plan.md carries every needed detail, there is no reason to stay in the old context window.

Two concrete things change with the fresh session. Context quality: the planning chat is full of dead ends, rejected options, and subagent noise, and none of it should influence code. Verification: the implement command makes the new agent re-check the plan's assumptions against the codebase before writing, which means a second pair of eyes reviews your plan for free.

This also mirrors how a real team works. The person who wrote the ticket is rarely the person typing the code, and the handoff artifact is what keeps that safe.

Fresh session, one argument
/implement .agents/plan-at22.md

Cole's /implement runs a couple hundred lines, because the plan drives the development. The command only encodes process: load the plan, cut a git branch, re-verify assumptions with a second pass, run the validation, and know when to hand control back. Whatever your team's engineering rituals are, they get encoded here.

Some people ship agent code straight to production. Cole does not: 'the engineer in me still wants to review all the code,' plus manual testing before any merge to main. Meanwhile the implementing agent builds its internal task list from the plan and moves fast. A simple, well-planned feature is quick work.

Key terms

plan.md
The single artifact carrying everything an implementing agent needs: decisions, files, task order, validation.
Plan mode
Claude Code's built-in planning feature; unrelated to the custom /plan command used in this course.
Self-validation
Tests, linting, and type checks the agent runs on its own output before human review.

Key takeaways

  1. The plan artifact contains everything implementation needs, which is exactly why implementation can and should happen in a different session.
  2. Have the agent validate as much as possible (tests, linting, type checks) so less needs correcting when control returns to you.
  3. Planning sessions accumulate bias. A fresh implementing agent gets clean eyes on the problem.
  4. The engineer still reviews production code. Delegating the writing is not delegating the responsibility.

Watch out

  • /plan here is Cole's custom command, not Claude Code's built-in plan mode. Same word, different things.
  • The granular task list inside plan.md serves one agent's internal run. Do not promote those micro-tasks into JIRA tickets.

Check your understanding

Why must implementation happen in a different session from planning?

The planning session has built up bias, and a fresh agent gets unbiased eyes. The plan.md artifact carries all the needed context, so nothing is lost by switching.

Why is the /implement command so short?

Because the plan guides the entire development. The command only encodes process: load the plan, branch, verify assumptions, validate, hand back.