Skip to content

Understand an unfamiliar codebase faster

Get a plain explanation of a module, its data flow and the risky parts before you change it.

Recommended: BuilderResearchDocuments

Best for

  • Engineers joining a new team
  • Developers picking up legacy services
  • Freshers learning a production codebase

What you need

  • An AI assistant your company allows for code
  • The files for one module
  • The ticket you need to work on

Starter prompt

Copy it, fill in the parts in square brackets, and paste it into the AI assistant your organisation allows.

I am a developer new to this codebase. Below are the files for the [module name] module, written in [language and framework]. Explain: what this module is responsible for, the main functions and how data flows between them, what it depends on outside these files, and the three places where a change is most likely to break something. For each claim, name the file and function. If something depends on code I have not given you, say so rather than guessing. My task is: [describe ticket]. Files: [paste files].

How to use it

  1. 1.Pick a small scope

  2. 2.Ask for the map

  3. 3.Probe the risky parts

  4. 4.Write it down

  1. 1

    Pick a small scope

    Choose one module related to your ticket, not the whole repository. Remove secrets, keys and customer data from the files.

  2. 2

    Ask for the map

    Run the prompt and read the explanation next to the code. Check each claim by opening the named function.

  3. 3

    Probe the risky parts

    Ask follow-up questions about the three risky places, such as what happens on an error or empty input.

  4. 4

    Write it down

    Turn what you learned into a short README note for the next person.

Watch out. The assistant only sees what you paste, so its view of dependencies can be wrong. Verify against the real code, and never paste secrets or code your company does not allow in external tools.

What you end up with

A clear mental map of the module and a README note for your team.

Read why AI matters in software engineering

Related use cases