Chapter 1: Ground Zero
Exploring the Codebase
Exploring the Codebase
You've scaffolded a Next.js project. But before you start building, you need to understand what's already there. Claude Code is exceptional at reading and explaining code.
Ask Claude Code to look around
With Claude Code running in your todo-app directory, try this:
"Explain the file structure of this project. What does each file do?"
Claude Code will scan the directory tree and give you a guided tour. No find commands, no digging through folders -- just a clear explanation.
This is one of Claude Code's superpowers. When you join a new project or open unfamiliar code, asking "explain this" is the fastest way to get oriented.
Dive into specific files
Now go deeper. Ask Claude Code to explain individual files:
"What does src/app/layout.tsx do? Walk me through it line by line."
Claude Code will read the file and break down each part -- the imports, the metadata export, the HTML structure, and how the layout wraps child pages.
Try a few more:
- "What's in package.json? What dependencies do we have?"
- "Explain the tsconfig.json -- what TypeScript settings are enabled?"
- "What does tailwind.config.ts configure?"
Find patterns and conventions
Claude Code can spot patterns across your codebase. This is especially useful on larger projects:
"What patterns does this project use for styling? Is it CSS modules, Tailwind, or something else?"
"How does routing work in this app? Where do I add new pages?"
This project doesn't have a testing setup yet. The default create-next-app template doesn't include testing. I'd recommend adding Jest and React Testing Library. Want me to set that up?
Claude Code doesn't just answer questions -- it often suggests next steps. This is a great way to discover things you didn't know you needed.
Understand dependencies
Ask about the dependency tree:
"What are the main dependencies in this project? Are any of them outdated?"
Claude Code will check your package.json and can even look up version information to tell you if something needs updating.
The exploration habit
Every time you start working on a new area of code, spend 30 seconds asking Claude Code to explain it first. This habit will save you hours of confusion later.
You don't need to memorize every file. The point is to build a mental map. Claude Code remembers the details -- you just need to understand the big picture.
Working with existing codebases
So far you've explored a project you just created. But Claude Code really shines when you're dropped into a codebase you've never seen before — which happens all the time in real work.
Try this exercise with any open-source project (or a coworker's repo):
- Clone or open any project you haven't worked on before
- Run
claudeinside the project directory - Ask: "Give me a high-level overview of this project. What does it do, what's the tech stack, and how is it organized?"
- Follow up: "Where would I make changes if I wanted to add a new API endpoint?" or "Where is the authentication logic?"
- Try: "Find any TODO or FIXME comments in the codebase and summarize them"
This is one of the most common real-world uses of Claude Code. Senior engineers use it when reviewing pull requests, onboarding to new teams, or auditing unfamiliar dependencies. The skill you're building right now — asking Claude Code to explain code — transfers to every project you'll ever work on.
Now that you understand the project, let's start changing it. Next up: editing files with Claude Code.