Explain Unfamiliar Code
Get a clear, layered walkthrough of a function, file, or snippet — what it does, how it works, and the gotchas — as if onboarding a new teammate.
0 likes
0 dislikes
Sign in to rate this prompt
Prompt
Explain the code below as if you're onboarding a new engineer who is competent but has never seen this codebase.
Code:
{{code}}
Cover, in this order:
1. **In one sentence** — what does this do, and why would it exist?
2. **Walkthrough** — step through the important parts in plain language. Explain the *why*, not just the *what*.
3. **Inputs & outputs** — what it expects, what it returns or produces, and any side effects.
4. **Gotchas** — edge cases, assumptions, or non-obvious behavior a newcomer would trip over.
Keep it concrete and skip trivial lines. If part of the code is ambiguous without more context, say what you'd need to be sure rather than guessing.