Chapter 1: Ground Zero
Multi-File Changes
Multi-File Changes
Real development rarely involves touching just one file. A new feature usually means a new component, updated imports, shared types, and maybe a style change. Claude Code handles all of this in a single conversation turn.
Build a Todo component
Let's ask Claude Code to create the core of our todo app:
"Create a TodoItem component that displays a todo with a checkbox, title, and delete button. Use Tailwind for styling and lucide-react for the icons. Also create a Todo type in src/types/todo.ts."
Watch what happens:
- Claude Code creates
src/types/todo.tswith the Todo interface - Claude Code creates
src/components/TodoItem.tsximporting the type - Both files are internally consistent -- the component uses the exact type definition it just created
This is what makes Claude Code different from a regular AI chat. It doesn't just generate isolated code snippets -- it creates files that work together, with correct imports and shared types.
See the files it created
src/ āāā types/ ā āāā todo.ts ā Todo interface definition āāā components/ ā āāā TodoItem.tsx ā TodoItem component āāā lib/ ā āāā utils.ts ā cn() utility (from last section) āāā app/ āāā layout.tsx ā Root layout āāā page.tsx ā Home page
Wire it all together
Now ask Claude Code to connect everything:
"Update the home page to show a list of 3 sample todos using the TodoItem component. Create the sample data using our Todo type."
Claude Code will:
- Open
src/app/page.tsx - Add imports for
TodoItemand theTodotype - Create sample todo data that matches the type definition
- Render the list of TodoItems
- Show you each diff for approval
When you ask for something that spans multiple files, Claude Code plans all the changes first, then applies them in the right order. It won't import a component before creating it.
Updating types across files
One of the trickiest parts of development is keeping types in sync. Try this:
"Add a 'priority' field to the Todo type with values 'low', 'medium', or 'high'. Update TodoItem to display the priority with a colored badge."
Claude Code will:
- Update
src/types/todo.tsto add the new field - Update
src/components/TodoItem.tsxto render the priority badge - Update the sample data in
src/app/page.tsxto include priority values
All three files stay in sync. No missing properties, no type errors.
Why this matters
In traditional development, multi-file changes are where bugs hide. You update a type but forget to update a consumer. You rename a prop but miss one import. Claude Code eliminates this entire class of errors by seeing your whole project as a connected system.
As your project grows, multi-file changes become Claude Code's biggest advantage. A single prompt can update types, components, tests, and documentation -- all in sync.
Your todo app now has real components with proper types. Let's learn some shortcuts that will make you even faster.