Tell it which file to change.

By (@charleeai) ·

The model fixed the bug once, and then I spent an hour finding out where it had fixed it. It had rewritten a function — in the wrong file. There were two files with similar names, an old one and a new one, and the model picked the old one, because nothing told it which one was live. The app kept crashing, the "fix" sat in a file nothing imported, and I was convinced the model was useless until I realised I had never actually told it where the code lived.

A prompt without a file is a wish, not an instruction. "Fix the login" could mean five files in a real project. The model will pick one, and it will pick wrong about half the time — not because it is bad at coding, but because you gave it a coin flip and called it a job. Every time it edits the wrong file, you pay twice: once for the wrong edit, and once for undoing it and explaining the layout you should have explained at the start.

Now the file goes in the first line of the prompt, before anything else. "File: src/auth/login.js. Fix the login button in this file only. Do not touch anything else." Then the problem. The model is good at following a target once you give it one — it just will not guess your project structure for you, and it should not have to. If two files are involved, I name both, and I say what each one is for: "the form lives here, the save logic lives here."

It takes five seconds to write the filename down. It saves the evening where a fix lands in a dead file and the real bug sits there untouched, while you wonder why nothing changed. Point at the file, then describe the job. In that order, every time.

3 views

Explore more on Prompted