PromptDev
Explain unfamiliar code
Get a structured explanation of code you've inherited: what it does, how, what would break it — pitched at the level you choose.
Last updated
Fill in the blanks
Assembled in your browser — nothing you type is stored or sent anywhere.
Your prompt
Explain the code below to a developer who knows JavaScript but not this codebase.
Structure: one sentence on what it does overall; then walk the flow top to bottom, explaining WHY at each step, not just what; then list any assumptions it makes about its inputs or environment, and the most likely way it breaks. If you are not certain what something does, say so explicitly instead of guessing — and do not invent behaviour for functions whose definitions you cannot see.
Code:
[paste the function or file here]
Model-agnostic — works in Claude, ChatGPT, Gemini or any AI chat.
Why this prompt works
- →Pitching the explanation at a named level stops the two default failures: condescending line-by-line narration, or a summary that assumes you already understand it.
- →Asking for assumptions and the likely break is what turns an explanation into understanding — it is the part you cannot get from reading the code slowly.
- →The no-guessing clause matters for snippets: models otherwise confidently describe what an unseen helper function "probably" does.