What does a good message look like?
How to talk to Claude · lesson 3 of 8
The message you write to Claude is called a prompt.
What should it contain?
A good prompt has four parts:
- What to do: the problem or the result you want - Where: which files or folders to look in - Constraints: what it’s not allowed to change - How to check: how Claude shows you it worked, with a command, a test, or something you can check yourself
Sounds complicated
It isn’t. I’ll show you an example, and you’ll see it’s just a few short sentences.
Show me an example
The example is a café’s website, the one you build in lab 0.
First a bad one, where Claude has to guess almost everything:
> fix the button
And a good one?
Here it is:
> On a phone, the “Book” button on the café’s website does nothing when you tap it. > It should open WhatsApp. Look in index.html, at the booking section. > Don’t change the colours or the texts. Check: tell me what link the button has now and what link it has after the fix.
What does each line do?
In plain words:
- “the «Book» button does nothing... it should open WhatsApp”: what happens and what you want to happen - “Look in index.html, at the booking section”: where to search. index.html is the page’s file - “Don’t change the colours or the texts”: the constraint. You want only the button fixed, not the whole site - “tell me what link the button has now and after”: the check. You see for yourself what changed, without reading the code
I want to try it too
Build it piece by piece and see what Claude does with each one:
vag: fix the button
piesa: What to do | On a phone, the “Book” button does nothing when you tap it. It should open WhatsApp. | It knows the problem: the booking button doesn’t open WhatsApp. | It doesn’t know which button or what’s broken. It guesses: maybe the colour, maybe the menu.
piesa: Where | Look in index.html, at the booking section. | It searches straight in index.html, at the booking section. | It searches every file, one by one, and wastes time.
piesa: Constraints | Don’t change the colours or the texts. | It fixes only the button. The rest of the site stays as it was. | It might “improve” the colours or texts too, without being asked.
piesa: How to check | Check: tell me what link the button has now and what link it has after the fix. | It shows you the old link and the new one. You see for yourself it’s fixed. | It has no way to check. It tells you “done” and you hope it works.
In the exercise you fix something else on the site, again with all four parts.