Explain unfamiliar code line by line

Walks through code you did not write, from the big picture down to tricky lines, at the level of experience you choose.

Prompt, 2 blanks to fill
Explain this code to me. My experience level: {{MY_LEVEL}}.

```
{{CODE}}
```

1. Big picture: what it does and where it probably fits in a larger system, in 3 sentences.
2. Walk through it in chunks, explaining what each chunk does and why.
3. Point out any line that is clever, surprising or easy to misread.
4. List anything that looks like a bug or a risky assumption.
5. Suggest 2 questions I should ask the person who wrote it.

Use the same names as the code. Define any term you think I might not know.

Example output

Big picture: this middleware checks a session cookie and loads the user before each request. Line 7: `req.user ??=` only loads the user if no earlier middleware did. Watch out: errors are swallowed on line 15.

How to use

Set MY_LEVEL honestly, for example "I know Python but not async code". For a big file, paste one function at a time so the explanation stays detailed.

Why it works

Stating your level lets the model pitch the explanation correctly instead of defaulting to an expert or a beginner. Smaller pastes keep the code well inside the context window, which tends to give more precise answers.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close