Chapter 4. Build — Plan First, Branches and Commits
Required Read this to follow this stage.In one sentence: Start a new session, hand over SPEC.md, and get a plan first in Plan mode. Once you approve it, build inside a separate workspace called a branch, and save each small change as a commit. This flow of building on a branch, recording, and getting reviewed before merging is called GitHub flow. It is a lightweight workflow useful for anyone, not just developers.
This chapter is based on the official Claude Code and GitHub documentation checked on November 1, 2026. You already tried Plan mode and commits in Claude Code Chapters 4 and 5. This chapter ties them together with branches into a workflow for building safely.
Get a Plan First
Once you have SPEC.md, open a new session and switch to Plan mode. In the desktop app, switch the mode below the input box to Plan (계획), just like in Claude Code Chapter 5. In Plan mode, Claude reads your files and proposes a plan, but changes nothing until you approve it.[1]
Read SPEC.md and make a plan to build a to-do board that meets this spec. Do not create any files yet.When you get the plan, ask yourself these questions:
- Which step of the plan matches each line in SPEC.md?
- Is each step small enough to check all at once?
- Did it sneak in any new tools or installations you don't know?
If you don't like something, ask Claude to fix the plan before you approve it. Fixing things at the planning stage is the cheapest.
Quick check
Which statement about plan mode is true?
Build on a Branch
A branch lets you build a feature in its own separate space. Your main version (main) stays untouched until you are ready.[2] Even if you mess up, main is safe, so you can experiment freely.
GitHub's introductory tutorial sums up the building process like this: set up a workspace → make and save changes → propose them for review. The tools for this are branches, commits, and PRs.[3] A PR (Pull Request) is a proposal you put forward saying "Please merge what I changed on the branch into main." You will make one yourself in Chapter 6.
Give your branch a short name that shows what it does.[4] For the first screen of our to-do board, first-board is plenty.
Create a branch named first-board, and build the first screen following the approved plan. Make it open from a single index.html file in the top folder, with no build step needed.The build mentioned in the request is a preparation step that turns the code you wrote into files a browser can read. "With no build step needed" means you want it to show up when you open the file directly in a browser, without any such step.
We use a single index.html file because GitHub Pages in Chapter 7 looks for index.html at the top of the folder it publishes.
Quick check
What is a good reason to use a branch?
Make Small Commits
A commit saves your changes like a snapshot of that moment, and a push sends that snapshot to your GitHub repository.[5]
Each commit should hold one separate, complete change. That makes it easy to undo just that part if you decide to try a different approach.[6] For unrelated changes, make separate branches too.[6:1]
| Weak commit | Better commits |
|---|---|
| A whole day's work labeled "Work" | "Add to-do table reader", "Highlight overdue to-dos in color" |
Source: Examples from this guide (principles from official GitHub docs)[6:2]
Just as you learned in Stage 3, the habit of saving a record before and after delegating work applies right here too.
Quick check
What commit style does GitHub recommend?
Read What AI Built
Accept AI-generated work only after reading it. The GitHub tutorial also tells you to review what AI generates and adjust it to match what you need.[7]
In the Claude Code desktop app, you can check changes file by file in the diff view (바뀐 내용 보기). Click + next to a line to leave a comment, and Claude will read it and fix the code.[8]
It is okay if you don't understand all the code. Ask Claude like this:
For each file you just changed, explain in one line what you changed and why. Also tell me which line in SPEC.md it connects to.If an explanation doesn't connect to any line in SPEC.md, Claude may have done something you didn't ask for. Ask about that part.
Quick check
What does this guide recommend when you do not fully understand the code AI wrote?
Try It Yourself
- Open a new session in your to-do board folder and switch to Plan mode.
- Send the plan prompt above, check the plan with the three questions, and approve it.
- Have Claude build the first screen on the
first-boardbranch. Use the to-do table from the Stage 3 meeting notes as your to-do data. - Check the files in the diff view, and ask for an explanation of the changes.
- Have Claude commit the work in small chunks.
- Ask Claude: "Push the
first-boardbranch to GitHub." Once you see the branch on your GitHub repository page, you are done. If a login window pops up the first time you upload, follow the prompts as in Chapter 2. If you get a message saying it failed, show that message to Claude exactly as it is and ask what the problem is.
Up next: In Chapter 5, you will build a check so Claude can verify on its own whether every single to-do item shows up on the screen.
Summary
- Start a new session, give Claude SPEC.md, and get a plan in Plan mode first. Fixing things is cheapest at the planning stage.
- A branch is a workspace that leaves
mainuntouched. Keep branch names short and clear. - Put one complete change in each commit. Split unrelated changes into separate branches.
- Read what AI builds before accepting it. Ask which line of SPEC.md each change connects to.
Key Terms
| Term | One-line meaning |
|---|---|
| Branch | A separate line of work that leaves the main version untouched |
| Commit | Saving changes like a snapshot of that moment |
| Push | Sending your saved commits to a GitHub repository |
| GitHub flow | The workflow of branch → change → PR → review → merge |
Finished this chapter?
Progress is saved only in this browser. See your progress on the full table of contents.
Next chapter: Chapter 5. Verification and Testing
References (8)
Claude Code official docs, "Common workflows". "For changes you want to review before they touch disk, switch to plan mode. Claude reads files and proposes a plan but makes no edits until you approve." code.claude.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Writing and storing your code". "A branch lets you work on your feature in its own space, without changing the
maincopy of your code until you're ready." docs.github.com (checked on 2026-11-01) ↩︎GitHub official docs, "Writing and storing your code". "Along the way, you'll follow the core developer workflow—setting up a space for your work, making and saving your changes, and proposing them for review—using branches, commits, and a pull request." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "GitHub flow". "A short, descriptive branch name enables your collaborators to see ongoing work at a glance." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Writing and storing your code". "Committing saves a snapshot of your changes, and pushing sends them to GitHub where they will be stored in your repository." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "GitHub flow". "Ideally, each commit contains an isolated, complete change. This makes it easy to revert your changes if you decide to take a different approach." / "Make a separate branch for each set of unrelated changes." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Writing and storing your code". "Review what Copilot generates, then adjust the files to match the examples below." docs.github.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Desktop application". "After Claude makes changes to your code, the diff view lets you review modifications file by file before creating a pull request." / "Claude reads your comments and makes the requested changes, which appear as a new diff you can review." code.claude.com (checked on 2026-11-01) ↩︎