The Problem
You cloned a repository with hundreds of files and need to become productive as quickly as possible. Reading everything is impractical, and the documentation may be outdated.Ingredients
- A code repository cloned to your local machine.
Step by Step
This workflow uses a “top-down” approach: first we get an architecture overview and then we dive into specific details.The Panoramic View with @file --mode=summary
The first step is to get a map of the territory. The What to expect from the AI:The AI will return a high-level analysis, such as:With this, you already have a mental map of where to look for things.
summary mode is perfect for this, as it lists the file and directory structure without sending the code content.Specific Investigation with @file --mode=smart
Now that you have an overview, you can ask specific questions. The
smart mode is ideal here, because you don’t need to know which files contain the answer. The AI will find them for you.Let’s investigate the authentication flow.How it works:
- ChatCLI sends the list of all files inside
./internal/to the AI. - The AI, based on the question “authentication flow,” identifies that files like
auth_handler.go,jwt_service.go, anduser_repository.goare likely the most relevant. - ChatCLI then sends the content of only those selected files.
- The AI answers your question based on the actual code from the most important files.
Deep Dive into a File with @file --mode=full
During your investigation, you may want to understand a specific file in detail. Now, use the The AI now has the complete file content and can perform complex tasks such as refactoring, documentation, or test generation.
full mode (or simply omit the mode, as it is the default).