YES

As of 13 August 2026, AI can explain unfamiliar code to you.

Most people should hand this to a purpose-built tool.

Can you do it?

2 minutesto a draft.

30 minutesto something you’d act on.

Cost, all in£0

Skill neededchat-fluent

Who has to check ityou

What the alternative costsCursor is a purpose-built AI code editor described as the tool professional developers reach for.

If this goes wrong: you misunderstand a dependency or side effect and make a change that breaks a service, exposes data or creates a fault that takes time to diagnose.

What to actually do

  1. Use a tool built for this

    The route this page recommends

  2. Do it yourself

    Second choice

    A chat interface, chat-fluent skill, and roughly 30 minutes until you can act on the result.

    How to actually do it

    1. Open the relevant repository in your code editor and identify the file you want explained, its language and framework, and the files it imports.
    2. Gather the surrounding context from the README, package or dependency file, configuration names, entry-point file and relevant tests, removing passwords, API keys, tokens, personal data and confidential business data.
    3. Paste the prompt into ChatGPT, Claude or Gemini and replace each bracketed slot with the repository details and code you are allowed to share.
    4. Ask a separate follow-up for each unresolved dependency or file, pasting only the relevant excerpt and asking the model to distinguish observed facts from inferences.
    5. Compare the explanation with the actual call sites, imports, configuration and tests, then run the existing test or a safe local execution path to check the described inputs, outputs and error handling.
    6. Ask a colleague or technical owner to check any security concern, production side effect or behaviour the model marked as uncertain before relying on the explanation to change code.

    Prompt

    Explain the following unfamiliar code for a working developer or technically confident colleague. Use only the code and context I provide, and label anything you are inferring. Do not invent the purpose of functions, data sources, configuration values or business rules.
    
    First give a short plain-English summary of what the code appears to do. Then explain:
    1. The entry point and the execution flow, in order.
    2. Each important function, class, module or block, including its inputs, outputs and side effects.
    3. External services, databases, files, environment variables and permissions it depends on.
    4. Error handling, unusual cases and likely failure points.
    5. Security or privacy risks that are visible from the supplied code.
    6. Any parts you cannot determine without running the code or seeing other files.
    
    Quote short code fragments when useful, but do not reproduce the whole file. Finish with a list of specific checks I should make in the repository, documentation or tests to confirm your explanation.
    
    Language and framework: [language and framework]
    Purpose or task context: [what this code is believed to support]
    Relevant repository structure: [folders and related filenames]
    Code:
    [paste code here, after removing passwords, API keys, tokens, personal data and confidential business data]
    
    Do not propose changes unless I ask for them.

    Open it prefilled in ChatGPT or Claude, or copy it into Gemini, which takes no prefill link.

  3. Hand it to a person

    The distant third

    A person who owns the outcome does this end to end, worth it when the failure is dear.

What it gets wrong

Even on a YES, the friction has a name: context depth and judgement under ambiguity.

How we scored this

Five axes, each scored nought to two by hand: ten means AI carries the task cleanly, and the thresholds that turn a total into YES, PARTLY or NO are published in the methodology. Each axis name links to its definition.

AxisScore (0–2)
Output2
Inputs2
Verification1
Liability1
Effort delta2
Total8 / 10

FAQ

Can ChatGPT explain code to me?
Yes. Give it the relevant code and surrounding context, and ask it to separate what it can see from what it is inferring. Check the explanation against imports, tests and a safe local run before changing anything.
Can AI explain code I do not understand?
Yes, including the execution flow, functions, dependencies and likely failure points. It cannot reliably supply missing repository context or runtime behaviour, so include related files and treat uncertain parts as questions to investigate.
Is it safe to paste company code into AI?
Only if your employer has approved the tool and the data handling arrangements. Remove secrets, personal data and confidential code where possible, and use an approved enterprise setup when your organisation requires one.
Can AI explain what a piece of code does without running it?
It can produce a useful static explanation from the code, but it cannot confirm runtime behaviour, hidden configuration or external service responses without execution or more evidence. Run existing tests or a safe local path and compare the results with the explanation.

Nearby answers

Assessed by gpt-5.6-luna (gpt-5.6-luna) on 2026-08-13, second-checked by an independent model. Wrong somewhere? Email [email protected] and it gets re-checked.

The newsletter

AI news, new answers and product picks, straight to your inbox.