WZ VaultPrompts › Understanding

The prompt that makes an agent read before it writes

How do you get an AI coding agent to understand a codebase before it changes anything?

Last checked 2026-09-24

Ask it to explain the part you are about to change, in plain English, before it writes a line. If the explanation is wrong, you have found the problem in thirty seconds instead of after a broken change. Agents guess fluently, and a guess reads exactly like knowledge.

The prompt

Before changing anything, explain in plain English what [file or feature] currently does, what calls it, and what would break if it changed. Do not write any code yet.

When to use itAny change to code you did not write yourself, or wrote more than a month ago.
Why it is worded that wayAn agent will produce a confident change to code it has not read, because producing a change is what it was asked for. Requiring an explanation first turns an implicit assumption into a visible sentence you can disagree with. The 'do not write any code yet' clause matters — without it you get the explanation and the change together, and once the diff exists you will review it less carefully than you meant to.

What a wrong explanation looks like

It names the right file and the wrong purpose. It describes what the function appears to do from its name rather than from its body. It misses the caller that matters. All three read as competent prose, which is why you have to compare it against what you know rather than judging it on tone.

The follow-up that catches the rest

"What else depends on this?" An agent that has genuinely read the code answers with specific names. One that has not gives you a general answer about good practice. The difference is obvious once you have seen it twice.

Why this is cheaper than it looks

One extra message before the work, against a broken change you find out about on Thursday. The explanation also gives you something to point at when the result is wrong: the misunderstanding is written down, so you can correct that instead of re-describing the whole task.

The Operator Prompt Pack

This is one of 60 prompts, from the phase "Understand before you touch". The pack has the rest, each with the same reasoning underneath, plus the research they are built on and a house-rules file you paste in once.

Get the pack — €9

Tools this applies to

ToolWhat it doesPrice
Claude CodeAn AI agent in your terminal that reads your files, edits them, runs commands and deploys.~€17–20/mo
CursorA code editor with AI. The step between browser builder and terminal.~$20/mo
GitHubVersion control. Your restore point when an hour of building goes wrong.Free

Every tool has its own page with what it costs and who should skip it. Some links are affiliate links.

More prompts like this

Building

The prompt that stops an AI agent touching everything

How do you stop an AI coding agent from refactoring or changing files you did not ask it to?

Verifying

The prompt that makes an AI agent prove its code works

How do you verify that code written by an AI agent actually works?

Setup

The prompt that sets a project up for an agent

How do you set up a project so an AI coding agent works well in it?

The whole library

All prompts →The packs →