Skip to content
AI Skill Index

Explain this code to me at the depth I ask for

Paste the code and pick one paragraph or a full walkthrough. You get what it does, why it might be written that way and what to watch for.

Author: Editorial
Sign in to save
Explain this code to someone competent but new to this codebase.

```
[PASTE CODE]
```

Depth: [ONE PARAGRAPH | FULL WALKTHROUGH]

Cover, in this order:

1. What it does, in two sentences.
2. Why it might be written this way rather than the obvious alternative.
3. Anything that would surprise a reader — edge cases handled implicitly, assumptions about callers, side effects.

Do not restate the code line by line. Assume [LANGUAGE] fluency. If part of it only makes sense with code you cannot see, name what you would need to read.

Highlighted parts are placeholders. Replace them before you send.

Worked example

The input is invented for this page. The output shows what the prompt asks for with that input.

Example input (invented)

Code

import time
from functools import wraps

def retry(times=3, delay=0.5):
    def decorator(fn):
        @wraps(fn)
        def wrapper(*args, **kwargs):
            for attempt in range(times):
                try:
                    return fn(*args, **kwargs)
                except ConnectionError:
                    if attempt == times - 1:
                        raise
                    time.sleep(delay * 2 ** attempt)
        return wrapper
    return decorator

Depth: One paragraph

Language: Python

Example output

retry builds a decorator that calls the wrapped function up to times times and returns the first result that arrives without a ConnectionError. Between failed attempts it sleeps, doubling the wait each time, and after the last failed attempt it re-raises the error. It is a decorator factory and not a loop at each call site, so the retry policy sits next to the function definition and every caller gets it without asking. @wraps keeps the function's name and docstring for logs and debuggers. Five things would surprise a reader. Only ConnectionError is retried, so a TimeoutError fails on the first attempt. The sleep blocks the calling thread. With the defaults, a call that keeps failing waits 0.5 s and then 1 s, 1.5 s in total, before it raises. The wrapper assumes the function is safe to run twice, and if a request reached the server before the connection dropped, the retry sends it again. With times=0 the loop never runs, so the wrapper returns None without calling the function. To say whether retrying is safe here I would need to read the functions this decorates.

ShareXLinkedIn

3 of the 7 other prompts filed under Coding.

Coding tools and skills

3 of the 9 tools and 3 of the 7 skills filed under Coding, the same category as this prompt.

Tool

Aider

Pair programming with an LLM in the terminal, wired directly to git.

Open source
Tool

Claude Code

Anthropic's agentic coding tool for the terminal and IDE.

Paid
Tool

Cline

An open-source coding agent that runs inside VS Code with your own API key.

Open source
Skill

Accessibility reviewer

Reviews a component against WCAG failures that automated tools miss.

Claude Code, Cursor, Any agent
Skill

API endpoint reviewer

Checks a handler for the auth, validation and error gaps that recur.

Claude Code, Cursor, Any agent
Skill

Code reviewer

Reviews a diff for defects, and refuses to pad the list with style opinions.

Claude Code, Cursor, Any agent

Coding guides

3 of the 6 guides filed under Coding, the same category as this prompt.

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy