Code Explainer

Learn an unfamiliar function by following a concrete input through its decisions to the output.

Trace an example you can reproduce

Paste the function and a real call site or test fixture. Tell Claude what you already know, such as the language or the data structure. Ask it to follow one input and point to each branch, especially the path that returns early.

Verify the walkthrough against the source or a debugger. Note any dependency whose behavior is assumed, then try changing one input value and predicting the result. If your prediction fails, ask Claude to explain that specific decision.

Copy-ready prompt

Prompt
Explain [code] to someone with [experience level]. Start with its inputs and outputs, walk one real example through the major steps, and point out the decisions and failure paths. Define terms the first time they appear.

Configuration

  • Difficulty · beginner
Browse Prompts