WZ VaultPrompts › Handover

The prompt that makes an agent document what it built

How do you get an AI agent to write documentation for the code it just produced?

Last checked 2026-09-24

Ask for the note you would need in six months: what this does, how to run it, what breaks it, and which decisions were deliberate. Ask at the end of the session, while the context still exists. A week later the agent knows no more than you do.

The prompt

Write a short note for someone who has never seen this: what it does, how to run it locally, what environment variables it needs, what breaks it, and which decisions here were deliberate rather than accidental.

When to use itAt the end of any session that produced something you will come back to. Before you close the window.
Why it is worded that wayThe last clause is the valuable one. Anyone can re-derive what the code does by reading it; nobody can re-derive why it was done that way. Deliberate-versus-accidental is exactly the distinction that disappears overnight, and it is what stops a future change from undoing a decision that had a reason.

Ask while the session is still open

The agent's understanding of what it built exists inside the conversation. A new session reads the same code you would and reconstructs the same guesses. Five minutes now replaces an hour later.

Keep it next to the code

In the repository, not in a note-taking app. Documentation that lives somewhere else goes stale silently, because nothing reminds you it exists when the code changes.

The version that pays for itself

"What breaks it." Every project has two or three things that look optional and are not. Written down once, they stop being the thing you rediscover at the worst moment.

The Operator Prompt Pack

This is one of 60 prompts, from the phase "Deploy and hand over". 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
GitHubVersion control. Your restore point when an hour of building goes wrong.Free
CursorA code editor with AI. The step between browser builder and terminal.~$20/mo

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

More prompts like this

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?

Planning

The prompt that gets a plan before any code

How do you make an AI coding agent plan the work before it starts writing code?

Selling

The prompt for deciding what to charge

How do you decide what to charge for software you built yourself?

The whole library

All prompts →The packs →