Gaëtan Wittebolle.
UmamiContactFR
FR
← guides
Claude Code, the guide
Chapter 5 / 19
  • 04How to talk to Claude Code
  • 05Plan before coding
  • 06The daily work cycle

Part 2 · Communicate and plan

Plan before coding

Chapter 5 · 10 min reading

What this chapter teaches you: the 2-document planning method that turns a vague idea into a delivered feature with no surprises. What separates a random outcome from a predictable one. Reading time: 10 minutes.

Why it's non-negotiable

The biggest beginner mistake: directly asking "build me this feature". Without a plan, Claude will:

  • Make technical choices without consulting you (and you'll find out too late)
  • Potentially break existing functionality without realizing it
  • Produce something that doesn't match your vision because it interpreted things differently
  • Force you to redo everything, losing the work already done

The magic ratio: 10 minutes of planning = 2 hours of rework avoided. Ratio verified across dozens of features built.

The 2-document method

Working example: a publishing streak system for freelancers. We'll walk it from brainstorm to executable plan.

Document 1, the Design Doc (the WHAT)

The product vision. It answers: what are we building, for whom, and why?

You start with a brainstorm:

"Brainstorm a publishing streak system. Context: freelancers publish 1-2 times then quit. I want a gamified system that pushes them to publish regularly."

Claude proposes 3-4 approaches with the pros and cons of each:

Daily streak (Duolingo style)

Simple to understand but punitive, one missed day = everything lost. Not suited for freelancers who can't publish every day.

Weekly streak (recommended by Claude)

More flexible, suited to the freelancer pace (1-2 posts/week). Tolerant on days, demanding on consistency.

Points + levels system

Rich gamification with visible progression, but more complex to implement and potentially distracting from the core of the app.

You choose. Your domain knowledge makes the difference, you know what will motivate your users. Claude then writes the final design doc with your choice.

What the design doc contains

Concrete example for the weekly streak:

  • Problem: 80% of freelancers who sign up stop publishing after 2 weeks. We want to install a habit.
  • Chosen solution: weekly streak, validated with 1 publication per week from Monday to Sunday.
  • User stories: "When I publish content, my counter goes +1. When I hit 4 consecutive weeks, I get a badge. When I miss a week, the counter resets to 0 but I still see my best streak."
  • Business rules: one week = Monday 00:00 to Sunday 23:59 (user timezone). The streak breaks if no valid publication over a full week.
  • Out of scope: no leaderboards between users, no push notifications, no monetary rewards. Deferred to v2.

Document 2, the Implementation Plan (the HOW)

The technical roadmap. It answers: which tasks, in what order, with which checks?

You ask:

"Write the detailed implementation plan for the weekly streak described in docs/plans/2026-03-01-streak-design.md. List each task with the files to create or modify, the verification commands, and the execution order."

Claude produces a numbered plan:

Task 1: SQL Migration, create the streaks table with columns user_id, current_streak, best_streak, last_publication_date

File: supabase/migrations/20260301_streaks.sql

Check: npx supabase migration up --local

Task 2: Regenerate the TypeScript types

Command: npx supabase gen types typescript --local > src/lib/types/database.types.ts

Check: npm run typecheck

Task 3: Server Action, calculate and update the current streak

File: src/lib/actions/streak.ts

Check: npm run typecheck && npm run lint

Task 4: UI Component, animated flame + counter

File: src/components/dashboard/publishing-streak.tsx

Check: npm run typecheck + visual check

Task 5: Dashboard integration

File: src/app/app/page.tsx

Check: test visually on localhost:3000

Task 6: Unit tests

File: tests/unit/actions/streak.test.ts

Check: npm run test

What makes a plan solid

  • Each task has a single clear objective
  • The order respects dependencies (database before logic, logic before UI)
  • Each task has a specific verification command
  • Independent tasks are identified (can run in parallel)

Where to save the plans?

Create a docs/plans/ folder in your project. Name each file with the date and the feature name:

docs/plans/
  2026-03-01-streak-design.md      ← the design doc
  2026-03-01-streak-plan.md        ← the implementation plan
  2026-02-28-notifications-design.md
  2026-02-28-notifications-plan.md

These files act as living documentation for the project. When you wonder "why did we make this choice?", the answer is in the design doc.

Quick alternative: native plan mode

For medium-sized features, Claude Code includes a native plan mode that avoids creating separate files:

  • Shift+Tab in the chat to activate plan mode
  • Or type /plan followed by your description

Claude produces a plan directly in the chat, waits for your validation, then executes. Faster than the design doc + plan method for features that don't need durable documentation.

When to use what? Complex or structural feature → design doc + plan in docs/plans/. Medium feature or fix → native plan mode (Shift+Tab).

Executing the plan

Once the plan is validated (file or chat), a single sentence is enough:

"Execute the plan in docs/plans/2026-03-01-streak-plan.md"

Claude reads the plan, executes each task sequentially, checks between each step, and asks for your validation at key moments (typically: UI design choices, ambiguous business logic).

You supervise instead of piloting line by line. The difference between a manager who does the work themselves and a manager who delegates effectively.

Handling surprises during execution

Sometimes the plan doesn't survive contact with reality. Here's how to handle common cases:

SituationReaction
A check failsClaude fixes it automatically and retries. If it fails twice, it asks you for help.
You change your mind on a designSay it right away. Claude adapts and adjusts the rest of the plan accordingly.
A task is more complex than expectedClaude breaks it into subtasks and continues.
You discover an unplanned needAdd it to the plan: "Add a task 7: send a congratulations email when the streak reaches 4 weeks."

Takeaway: brainstorm → design doc → plan → execution. This sequence is unbeatable. It turns a vague idea into a delivered feature, predictable, and matching your vision.

← Chapter 4

How to talk to Claude Code

Chapter 6 →

The daily work cycle