Make software by describing it

Giving an AI Coding Assistant the Context It Needs

An AI coding assistant only knows what is in the conversation, so the context you provide decides the quality of the help. The most useful context is a short description of the project, the current code, the exact task, and any limits you want respected. Give those four things at the start of each new task and you will avoid most misunderstandings.

This guide covers what to include, how to keep it short, and what to do when a long chat starts to wander.

The assistant starts from zero every time

Even when a tool offers memory features, treat each new conversation as a blank page. The assistant has not seen your folder, your earlier decisions or your preferences. If you ask it to “add a delete button” without showing the page, it will invent a page and give you code for that invented page.

Think of the assistant as a skilled contractor who has just walked into the room. They can do good work, but they need to be shown the plan and the current state before they start.

A project summary of five lines

Write a short summary you can paste at the start of any conversation. It might read:

Project: a to-do list web page, one file (index.html), plain HTML/CSS/JavaScript, no libraries.
It saves tasks in localStorage. Features so far: add, check off, delete.
Style: simple, single column, mobile friendly.
Constraints: no build tools, no external services, keep everything in one file.
Preferences: explain changes briefly; show only changed parts unless I ask for the full file.

Keep this summary in your notes file and update it when the project changes. It takes two minutes to write and saves repeated explanations.

Share the current code

Paste the actual file, not a description of it. For a small single-file project, that means the entire file. Label it so the assistant knows what it is: “Here is my current index.html.” If the file is long, include the part you want changed and a short list of what else the file contains.

Make sure what you paste is the latest working version. Pasting an outdated copy leads to fixes that do not match your current file and can reintroduce bugs you already solved.

State the task and the limit

After the summary and code, write one task: “Add a button that deletes all completed tasks, with a confirmation.” Then add the limits: “Do not change the layout. Do not rename existing functions.”

One task per message works best. If you need several changes, list them in order, but ask for them one at a time. Smaller steps are easier to verify.

Say what you tried

If you are asking for help with a problem, include what you have already tried and what happened. “I changed the color value and reloaded, but nothing changed” prevents the assistant from suggesting the same step. Include errors from the browser console as exact text.

Being specific about the environment also helps: the browser and device you use, and whether you open the file directly or through a host. A bug that appears only on a phone calls for different advice than one that appears everywhere.

Keep long conversations healthy

Chats that run for dozens of messages tend to drift. The assistant may forget early constraints, repeat old suggestions or mix up versions of the file. Signs include reintroduced bugs, ignored instructions and answers that contradict earlier ones.

Good habits to prevent this:

  1. Start a new conversation for each new feature or major task.
  2. Open it with your project summary and the latest file.
  3. When a chat has produced a good result, save the file, copy the key decisions into your notes, and close it.
  4. If answers get strange, restart rather than push on.

Restarting feels like a loss, but with a summary and file ready, it takes a minute and usually produces cleaner results.

Keep a decisions file

Beyond the project summary, keep a short list of decisions you have made and why. For example: “Store amounts as whole cents. Single file only. No external libraries.” When the assistant suggests something that conflicts, you can point to the list instead of re-arguing it.

Decisions are the first thing lost when a chat restarts, and they are the main reason new conversations produce code that does not fit. Paste the list along with your summary and the file. It rarely needs more than five to ten lines, and updating it takes a moment whenever you change course.

Do not share what you should not

Context does not mean everything. Leave out passwords, API keys, private customer information and confidential business material. If the code contains a secret, replace it with a placeholder such as YOUR_KEY_HERE before pasting. Check your tool’s data settings if you are unsure how conversations are stored or used.

Some tools can read your project files directly. Before you grant that access, check which folders it can see and keep sensitive files outside them.

Ask the assistant to confirm understanding

Before a large change, ask: “Summarize what this project does and what you plan to change, in four sentences, before writing any code.” If the summary is wrong, you have caught a misunderstanding before it cost you a rewrite. If it is right, say “go ahead.” This one extra exchange is cheap insurance on bigger requests.

What to do now

Write your five-line project summary for the project you are working on and save it in a notes file. Next time you ask for a change, paste the summary, the current file and a single clearly stated task. Notice whether you need fewer correction rounds, and adjust the summary with anything you had to explain twice.