996 words Slides

2.1 Exploring Codebases

Course: Claude Code - Essentials Section: Core Workflows Video Length: 2-5 minutes Presenter: Daniel Treasure


Opening Hook

You've just installed Claude Code and opened it in a project. But what if you don't understand what you're looking at? In this video, we'll explore how to let Claude be your guide through an unfamiliar codebase—reading structure, understanding architecture, and asking smart questions to get answers fast.


Key Talking Points

  1. Ask Claude to Understand the Project First
  2. Before making changes, always ask Claude to analyze what you're working with
  3. Questions like "What does this project do?" or "Where's the main entry point?" get you oriented
  4. Claude reads multiple files and summarizes the architecture
  5. Show on screen: Ask a simple question and let Claude explore—no edits yet, just reading

  6. The Power of Natural Language Questions

  7. You don't need to manually search every file
  8. Claude Code understands questions about code flow, dependencies, and design patterns
  9. Examples: "How does authentication work in this project?" or "Where are the database queries?"
  10. Show: Ask a question that requires understanding multiple files; Claude connects the dots

  11. Using @-Mentions to Focus the Scope

  12. Reference specific files or directories with @filename or @directory/
  13. Narrows Claude's attention when the codebase is large
  14. Example: @src/api what endpoints are exposed here?
  15. Show: Use @ to reference a folder, then ask a targeted question

  16. Reading Without Writing

  17. Exploration is read-only; Claude shows you what's there
  18. No file changes yet—this is safe discovery
  19. Perfect for understanding before proposing changes
  20. Show: Terminal output showing Claude's analysis without any Edit or Write tool calls

  21. Building Context for Later Tasks

  22. What you learn here becomes the foundation for 2.2 (making changes), 2.3 (git), and beyond
  23. Claude remembers context in the session, so avoid re-explaining
  24. A few smart questions now save you time in every future task
  25. Show: Brief context summary in the conversation for reference

Demo Plan

Demo Project: A small, well-known open source project (suggest: a simple Node.js app like express-starter or next-auth-demo, or a Python project like flask-blog)

Setup (off-camera before video): - Clone or have a sample project ready - Open terminal - Run cd /path/to/project && claude to start a session

On-Camera Sequence (aim for 2-3 minutes of live demo):

  1. First Prompt: Ask Claude to summarize the project What is this project? What technologies does it use?
  2. Show Claude reading files and responding with a summary
  3. Highlight that Claude is exploring without permission prompts (read-only)
  4. ~30 seconds

  5. Follow-up: Ask about structure Where is the main entry point? How are routes/handlers organized?

  6. Show Claude referencing specific file paths
  7. Demonstrate that follow-up questions build on prior context
  8. ~30 seconds

  9. Scoped Question with @-Mention: Focus on a specific area @src/database explain how the data models are defined

  10. Show the @ autocomplete and how it narrows scope
  11. Claude dives into that directory
  12. ~20 seconds

  13. End with a Takeaway: Optionally show asking Claude a question you "need" answered for a future change How would I add a new user role to this system?

  14. Claude provides guidance without making changes
  15. Signal this analysis will help in upcoming videos (2.2, 2.4, etc.)
  16. ~20 seconds

Code Examples & Commands

Starting a session:

cd /path/to/your/project
claude

Example prompts to use:

What does this project do?
What's the main entry point?
Explain the folder structure.
How are the API routes organized?
@src/auth How does authentication work?
@components What React components are in this directory?
What would need to change to add X feature?

Using @-mentions:

@filename.js - Reference a single file
@src/components/ - Reference a directory
@package.json - Ask about dependencies
@README - Include the readme in context

Gotchas & Tips

  1. Claude reads gitignore by default – Node_modules, .env files, etc. are usually excluded. This is intentional (saves tokens, avoids noise).

  2. Larger codebases may need guidance – If Claude's response is vague, ask a more specific follow-up. "Which file contains the API handler?" narrows it down.

  3. @ autocomplete saves time – Press Tab or start typing after @ to see available files and folders. Much faster than typing paths.

  4. Session context is your friend – Claude remembers what you told it. Avoid repeating "This is a Node app" multiple times in the same session.

  5. Read-only exploration doesn't require permissions – No approval prompts appear for exploring code. That changes in 2.2 when you make edits.

  6. Large responses may truncate in terminal – If Claude's response is very long, you can ask "summarize that in 3 bullet points" or scroll back to read more.


Lead-out

Now that you understand your codebase, you're ready to make changes. In the next video, we'll show how Claude helps you edit files, add features, and refactor code—with your approval at each step. You'll use all this context you just learned.


Reference Material

  • Claude Code Quickstart (Getting Started section): https://code.claude.com/docs/en/quickstart
  • Common Workflows - Exploring Codebases: https://code.claude.com/docs/en/common-workflows
  • CLI Reference (@ mentions): https://code.claude.com/docs/en/cli-reference
  • VS Code Integration (@-mentions): https://code.claude.com/docs/en/vs-code

Relevant Articles & Posts

  • Official Docs: "Common Workflows - Claude Code Docs" (https://code.claude.com/docs/en/common-workflows)
  • Article: Joe Njenga's "17 Best Claude Code Workflows" (Medium) – covers exploration patterns
  • Resource: ClaudeLog - Claude Code Best Practices (https://claudelog.com/)

Additional Notes

  • Keep the tone conversational—you're showing how Claude becomes a "guide" through unfamiliar code
  • Pause after showing Claude's response to let viewers read the summary
  • Emphasize that exploration is safe (read-only, no approval needed)
  • Call attention to the session context continuing across multiple prompts
  • Use a real (but simple) project so viewers can follow along with their own code later