Skip to content
Prompt · Coding

Explain an unfamiliar codebase

Quickly orient yourself in code you did not write.

Recommended context

Key files or the entry point, and what you are trying to change or understand.

The prompt

I am new to this codebase and need to {{task}}.

Here is the relevant code:
{{code}}

Explain:
1. What this code is responsible for, in two sentences.
2. The control flow for the path relevant to my task.
3. The key files/functions I will likely need to touch and why.
4. Any landmines (shared state, side effects, implicit contracts) I should watch for.
Keep it concrete and point to specific names.

Variables to customize

{{task}}
What you are trying to do
{{code}}
Entry point or key files

Good follow-ups

  • Draft a step-by-step plan to make the change safely.
  • What is the riskiest assumption in this code?

More coding prompts

Explain an unfamiliar codebase: AI prompt · SDEN