Skip to content

How to write a codebase tour for new developers

A codebase tour walks a newcomer through the files that matter, in the order that makes sense. How to choose the stops, write them and keep the tour from going stale.

October 13, 2026 · 2 min read · RepoGrasp team

A codebase tour is a guided path through a repository: ten or so stops, each a file or function, in an order that builds understanding. It's one of the most effective onboarding documents you can write, because it answers the newcomer's first question, "where do I start?", with a concrete route.

Choose one journey

Don't tour the whole codebase. Tour one important journey through it, usually the core thing the product does: "a user places an order", "a webhook arrives and updates a subscription", "a file is uploaded and processed". One journey crosses most layers of the system, so it teaches the architecture by example.

Pick eight to twelve stops

Each stop should be a place where something important happens:

  1. Where the journey starts (a route, a component, a command)
  2. Where input is validated
  3. Where identity and permissions are checked
  4. Where the main business rule lives
  5. Where data is written
  6. Where side effects are triggered (emails, jobs, events)
  7. Where errors are handled
  8. Where the result goes back to the user

Add one or two stops for important shared infrastructure, such as the database client or the config module.

Write each stop the same way

For each stop:

  • Location: src/services/orders.ts, createOrder, around line 40
  • What happens here: one or two sentences
  • Why it matters: what would go wrong if you changed it carelessly
  • Look at: one detail worth noticing, such as a guard clause, a transaction or a retry

Keep each stop short. The point is to send the reader to the code, not to replace it.

Add a "try it" step

End the tour with a small exercise: "Add a field to the order confirmation email" or "Make the order total log its line items." Doing something cements the reading.

Formats that work

  • A Markdown file in the repository, such as docs/tour.md, with links to files on GitHub.
  • CodeTour, a VS Code extension that plays a tour of files and line ranges inside the editor, stored as .tour files in the repository.
  • A recorded walkthrough of someone following the tour, as a companion to the written version.

Keep it from going stale

  • Link to functions by name, not just line numbers, since names change less often.
  • Review the tour when the files it mentions change in a pull request.
  • Ask each new developer to fix one thing in the tour after using it.

Draft it faster

Ask RepoGrasp "trace what happens when a user places an order, from the click to the confirmation email," and you'll get the journey as ordered steps with file:line citations. That's a first draft of your stops. Check each one, add the "why it matters" notes only a person can write, and you have a tour.

Draft a tour with RepoGrasp.