Skip to main content
This lesson explains how to work with multiple files in a project, navigate a codebase, and use Claude Code to analyze or modify an entire repository rather than a single file. You’ll see how Claude inspects the repository structure, summarizes how files relate, and recommends targeted changes (for example, for a database migration).
A presentation slide titled "Multi-file Project Navigation" with a large dark curved shape on the right containing the word "Demo" in blue. A small "© Copyright KodeKloud" appears in the bottom-left corner.

Inspecting a repository

Claude can list the repository contents and return a concise file tree so you can quickly understand the app layout:
From the tree, Claude can produce a clear summary of the main components and how they connect:
Because Claude analyzes multiple files together, you can ask higher-level questions such as “What files would be affected if we change the database to MariaDB?” and get a focused list of files and specific edits.

Example: Files affected by a database migration

Here’s an example list of files and the typical changes required when migrating from PostgreSQL to MariaDB/MySQL: Notes:
  • Using parameterized queries and a query builder/ORM improves portability.
  • Placeholder syntax and pool configuration are the main code-level differences.

Example file: current PostgreSQL pool (before migration)

This is an example config/database.js using the pg client:
To migrate to a MySQL driver like mysql2, you’d replace the pg Pool implementation with mysql2’s pool API and update query parameter placeholders and execution calls.

How Claude performs multi-file edits safely

Claude supports file-level operations and constraints. Examples of common workflows:
  • Inspect: Ask Claude to summarize the project structure and identify key components to target.
  • Plan: Request a list of files and specific changes required for a migration or refactor.
  • Restrict: Specify which files may be changed and which must remain unchanged.
  • Apply & Verify: Have Claude perform the changes and then verify that the specified files were refactored.
You can also instruct Claude to avoid modifying certain files; if a requested change requires touching excluded files, Claude will flag the conflict and request permission.
When requesting modifications, specify the files that may be changed and which files must not be modified. This avoids accidental edits to unrelated parts of the codebase.

Practical dos and don’ts for multi-file work with Claude

  • Do provide contextual groupings (for example, “the auth system consists of these three files”) instead of pasting every file.
  • Do ask Claude to analyze relationships between files (routes → controllers → database) before making large changes.
  • Don’t paste a massive, unrelated list of files without context; Claude already knows the repo structure and will reprocess unnecessarily.
  • Don’t copy code from an unrelated stack (for example, React components) and expect it to work unmodified in a Node/Express application.

Why multi-file awareness matters

Multi-file analysis is especially valuable for:
  • Refactors where business logic moves between layers (routes → controllers → services).
  • Migrations (databases, auth providers) that touch configuration, schema, and queries.
  • Understanding legacy codebases where relationships span several files.
Claude’s ability to reason across files reduces the manual work of tracing dependencies and speeds up safe, targeted edits.

Watch Video