Skip to main content
In this lesson you’ll learn how to navigate multi-file projects, inspect project structure, and perform cross-file analysis and refactors with Claude Code. We’ll cover how Claude Code reads the working directory, summarizes relationships between files, proposes changes (for example, a DB migration), and verifies refactors across multiple files.
A presentation slide titled "Multi-file Project Navigation" with a dark curved panel on the right that prominently shows the word "Demo." The slide uses a light background and teal/blue accent colors.

What Claude Code provides for multi-file projects

Claude Code can:
  • Inspect the current working directory and list files and folders.
  • Produce a project-level summary (entry points, route structure, DB layer, where business logic lives).
  • Identify which files need changing for a cross-file task (for example, migrating a database driver).
  • Execute or propose targeted refactors while respecting file-level constraints.
  • Verify that intended changes were applied to the correct files.

Launching Claude Code from a project directory

Example of starting Claude Code in a local repo:

Show the file structure

Ask Claude Code to show the repository layout. Example output:

Project-level summary (condensed)

Claude Code can turn a file listing into an actionable summary. The following table captures the information from the example project: High-level architecture:
  • Route-controller pattern: server.js mounts auth routes at /api/auth; auth router contains inline controllers (no separate controller layer).
  • Database: PostgreSQL with the pg client, connection pooling, bcrypt for password hashing, and JWT for tokens.
Claude Code can answer follow-up questions like:
  • How are routes connected to controllers?
  • What database driver and pooling strategy are in use?

Example workflow: migrating PostgreSQL → MariaDB

When planning a migration (for example PostgreSQL → MariaDB), Claude Code lists affected files and the exact types of changes required. Files likely to need direct modification: Schema-level adjustments to review:
  • SERIAL PRIMARY KEY → AUTO_INCREMENT PRIMARY KEY
  • Remove or replace \c database commands (use USE dbname or omit)
  • Review timestamp defaults, UUID usage, and any Postgres-specific data types
Environment updates:
  • .env: change default port (MariaDB usually 3306 vs Postgres 5432) and driver-specific connection variables.
Example text output Claude Code might produce when identifying required changes:

Existing PostgreSQL connection pool (example)

Here is the typical pattern you might find in config/database.js when using Postgres. This is the code you would replace when migrating to MariaDB:
Note: When migrating, swap this implementation for a MariaDB client (for example, mysql2 or mariadb) and adapt pooling and query methods accordingly.
Parameterized queries separate values from SQL, improving safety. Placeholder syntax differs between drivers — Postgres uses 1,1, 2, …; many MySQL/MariaDB clients use ? or named placeholders. Update your query placeholders and any client-specific methods when switching drivers.

File-level instructions and safety controls

Claude Code accepts precise file-level instructions:
  • Tell it exactly which files it may modify (e.g., only auth-related files).
  • Or explicitly list files that must not be changed; Claude will warn if a requested modification would require touching those files.
Best practices:
  • Provide contextual information about how files relate (for example: “server.js mounts the routers; auth logic lives in routes/auth.js”).
  • Limit the list of files you paste — Claude Code already knows the repository layout and can focus on the relevant files.

Verifying refactors

After a refactor, ask Claude Code to:
  • Confirm which files were modified.
  • Show diffs or summarize the applied changes.
  • Run static checks (lint/test) or provide commands to run tests locally.

Do’s and don’ts

Summary

Claude Code helps you navigate multi-file projects by:
  • Mapping file structure and relationships,
  • Summarizing architecture and responsibilities,
  • Proposing and implementing targeted cross-file refactors (like DB migrations),
  • Respecting file-level constraints, and
  • Verifying the results.
This workflow accelerates working with legacy codebases, multi-file apps, and incremental migrations while reducing human error.

Watch Video