The biggest mistakes with coding agents happen before any code is written: the agent heads off in the wrong direction and you find out 400 lines later. The fix is a rhythm Anthropic teaches in Claude Code 101: explore, plan, code, commit.
Explore. Let it read the relevant files first, without changing anything.
Plan. It proposes the change in steps. You read the plan and correct it. This is the cheapest moment to catch a bad idea.
Code. It makes the change, small enough that you can review it.
Commit. Once the checks pass, save it with a clear message.
Plan mode does steps 1 and 2 for you: press Shift+Tab until you see it, or start a single prompt with /plan. Claude reads and proposes, and can't edit anything until you approve.
Keep each change small. One feature or one fix per task. A small diff is one you'll actually read; a giant one you'll wave through. Between unrelated tasks, run /clear so old context doesn't leak into the new job.
Tests are the agent's eyes. An agent can't look at your app the way you do. A test, a typecheck or a linter gives it a yes or no it can see. Ask it to run the check and show you the output, not just say "done". Matt Pocock goes further: have the agent write the failing test first, so the fix has a target.
promptAdd a “closed today” banner to Moon Café's homepage
Done! I've added the banner, refactored the hours module, renamed three helpers for consistency and updated the styles across the site. All looks good.
Plan: 1) add isClosedToday() to src/hours.ts with a test, 2) show the banner in src/pages/home.tsx when it's true. Nothing else changes. After step 2: pnpm test → 14 passed. Ready to commit?
The left reply sounds productive, but you now have a sprawling diff and no proof. The right one did less, told you what it touched, and showed the test run.
Your turn. Brief an agent to add that "closed today" banner. Put the homepage in src/pages/home.tsx and the hours logic in src/hours.ts. Your brief should keep the scope tight (say what not to touch), name the check (pnpm test), ask for the test output as proof, and ask for the plan first.
Goal Get a plan for one small change that names its files, stays in scope and ends with proof
What good looks likeThe coach checks the reply
- Names the filesnot checked yet
- Names the checknot checked yet
- Asks for proofnot checked yet
- Asks for a plan firstnot checked yet
- Limits the scopenot checked yet
- Ran at 1.0not checked yet
- Replies with a plannot checked yet
- Says what's out of scope, so the agent doesn't refactor around itnot checked yet
- Asks to see the check's output, not just “done”not checked yet
- The plan stays within the files the brief namesnice to have
Run your prompt and the replies land here.