Reading an unfamiliar codebase
Understand the idea
You need to fix one screen, but the repository has hundreds of files. Reading them alphabetically gives you detail without explaining the behavior.
Trace one route before the whole map
You do not have to understand every file before making a useful change. Pick one concrete action, such as searching for a title. Find where the input enters, which transforms it, and where the result is displayed. This gives the surrounding files a purpose as you encounter them.
Start from a visible behavior
Start with the README, package scripts, runtime configuration, and test commands. Find how the application starts and how its main framework organizes routes or entry points. A lockfile, environment example, and migration directory often explain assumptions that function names do not.
| Place to inspect | What you are looking for | Evidence to keep |
|---|---|---|
| Entry point or handler | Where the chosen behavior begins | The actual input and its source |
| Imported helper | How the input changes | Arguments, return value, and side effects |
| Data boundary | Where values enter from storage or a service | The expected shape and failure path |
| Tests | Behavior the project already checks | A command and case relevant to this route |
| Project instructions | How changes are built and reviewed | Existing conventions before adding new ones |
Follow definitions and data
Choose one concrete action, such as submitting a search. Find its visible label or route, then follow the handler, the service or state update it calls, and the code that renders the result. Search for symbols and their references instead of opening every nearby file.
A dependency is another piece of code a file relies on. Follow a dependency when it helps explain your chosen route, rather than opening every import. A contract is the behavior a function for its inputs. Write down that promise in ordinary language before assuming a similar-looking helper is interchangeable.
Find the project’s working rules
At each boundary, record the input shape, output shape, , and error owner. Distinguish behavior you observed from behavior a comment promises. Tests can reveal intended contracts, but run the relevant case to see whether the current implementation still satisfies them.
Write down the route you verified
Make a small change or temporary observation only after you can explain the route. Keep unrelated cleanup separate so a reviewer can assess the behavioral change. If generated files or vendored code appear in the path, find their source and build step before editing an output that will be overwritten.
In the example, raw input is trimmed and lowercased before the search function sees it. The search also lowercases titles, so both sides use the same comparison rule. If a search fails only for leading spaces, this route gives you a specific place to investigate. Keep a short note of the verified path, its assumptions, and a test you can rerun.
Mental model
FOLLOW THE VALUE
Find where external input first changes shape.
01 / 03Trace the transformation
Live example
Trace rawInput → query → matches. A whitespace failure belongs in normalization; changing the title filter would hide the missing boundary step.
Your console output appears here.
Guided challenge
Repair the boundary you traced
The query contains surrounding spaces. Correct normalization before changing the search function.
Your console output appears here.
EXPECTED CONSOLE OUTPUT
JS notes
Hints 0/2
Use all hints or make 3 failed runs (0/3).
Free sandbox
Make a variation, test an assumption, or break the example on purpose. This draft is saved separately.
Your console output appears here.
Quiz
A quick check for understanding. Retry as often as you like; your learning path stays open.
Ready to call this one understood?
Mark this lesson complete to earn 200 XP. You can always revisit it.