Websites, apps & code / Coding & debugging

Add explanations to code

Code that is hard to read, and you want plain notes and tidying added.

Fill in your details

Leave blank to use the example. Names are remembered for other prompts too (stored only on your device).

Variation:How much

Prompt

Please add plain explanations to the code below and tidy it.

Code:
(paste code you cannot follow)
Who will read it later: Me, and the colleague who takes over
How much to explain: Fewer, better notes, not one per line.

Requirements:
1. Behaviour must stay exactly the same; only add notes, rename and tidy layout.
2. Tell me your understanding first, then edit.
3. After editing, list what you touched so I can compare.
4. Mark anything unclear as "unsure here"; do not invent explanations.
5. If you find a password or key, warn me first and suggest moving it to an environment variable.

Paste it into ChatGPT, Gemini, Claude or Meta AI.

Test result

Run on 2026-12-01 with Claude Sonnet 5.5 (variation: Only the hard parts), using the example details above. AI never answers word for word the same twice, but the shape stays close.

What we noticed

The sample still had the code placeholder, so there was nothing to annotate. The AI described its method: behaviour unchanged, notes plus renaming and tidying, a list of changes, and "unsure here" markers. No code was actually annotated.

See what the AI actually wrote

Happy to help, but the "code" slot still reads "(paste code you cannot follow)" and no real code came through, so I have nothing to annotate yet.

Before you paste:

  • Replace passwords, API keys and customer data with [FAKE] values.
  • If it is only a part, tell me roughly what it does in the whole project, and I will say plainly where I cannot tell.

Once I have it I will work to your requirements:

  1. Tell you my understanding first, for example "this reads the order sheet, picks today's deliveries and writes them into another tab". I only edit after you confirm.
  2. Behaviour stays exactly the same. Only three things: add notes, rename variables so they read clearly (for example x and tmp become orderRow and todayList), and tidy layout (indentation, blank lines). I will not change the calculation or the order, and I will not "optimise while I'm here".
  3. Fewer, better notes: not one per line, only where the reason is not obvious, where there is a hidden rule, or a common trap, so you and the colleague taking over can follow it.
  4. List what I touched: for example "line 5: x renamed orderRow; line 12: note added; no other logic changed", so you can compare item by item. You can also compare before and after in a diff tool (for example VS Code's compare).
  5. Mark anything unclear as "unsure here" rather than inventing an explanation.
  6. If I find a password or key: I warn you first, suggest moving it to an environment variable (for example a .env file listed in .gitignore) and treat that key as leaked and replace it.

Paste the code and I will begin.

AI tools that suit this

  • Claude Suggested tool Free plan

    Strong at long documents, editing and code

  • ChatGPT Suggested tool Free plan

    The most widely used AI chat, for writing, questions and images

  • Cursor Suggested tool Free plan

    AI code editor

Recommendations only, not sponsored. Check each site for what the free plan includes.

This site is made by FullMark Tech

Want your own website, or your shop spreadsheets automated? FullMark Tech builds business websites and custom Excel tools.

Ask on WhatsApp See FullMark Tech services