← Back to Claude Code
Claude Code / Lesson 04

Plan, edit, test, and review a change

Turn a small bug report into a change you can verify and keep.

Before you begin

Use a repository with Git and a reproducible bug. Inspect the current status before working; preserve any edits already there. Know the expected behavior and a command or manual check that can demonstrate it.

1. Explore in Plan mode

Shift+Tab cycles available permission modes. Select Plan mode for analysis before implementation. Ask Claude to locate the failure, name affected files, and propose acceptance checks. Read its plan and correct misunderstandings before allowing edits.

2. Implement a bounded task

Return to the normal approval mode when ready. Read each requested file or command permission. Ask for one small change and tests tied to the bug. If the task drifts, press Escape to interrupt and restate the boundary. Do not enable bypass-permissions just to avoid prompts.

text
Fix only the blank-email validation bug. Preserve unrelated edits.
Add a check that fails before the fix and passes afterward.
Run the relevant checks and show the diff.
Do not commit, push, or deploy.

3. Review evidence, not just the summary

Run the relevant checks yourself or inspect the reported results. Read git diff for unintended changes, missing error cases, and secrets. A successful test does not prove every workflow. Check the concrete user behavior too. Commit only the files you intend to keep after review.

shell
git status --short
git diff --stat
git diff

4. Recover deliberately

Checkpoint rewind can restore eligible Claude edits; use /rewind and read its options. It does not reverse every shell command, remote write, or external effect. Use Git and backups for durable recovery, and never discard existing user changes to undo one generated change.

Practice & self-check

YOUR TURN / PRACTICE

Fix one small bug on a practice branch. Compare the behavior before and after, inspect the diff, and record which checks you ran.

When you’re done, take a moment to check:

Read the official sources

CLI instructions checked against official documentation; API examples tested with simulated responses. Product-account walkthroughs were not performed.

Start with a question