An AI coding tool is only as good as the task you give it and the checks you run afterwards. Five habits cover both.
Plan first#
Before the tool writes anything, know what you want: which function, what inputs and outputs, which edge cases. A vague prompt produces vague code. The same rules as any clear instruction apply.
Give it the right context#
The tool only knows what is in its context window. Point it at the relevant files, paste the interfaces it must use, and tell it the constraints. An agent working in a large codebase with no context about your architecture will ignore your patterns and invent its own.
Keep changes small#
Ask for one thing at a time. A focused change is easy to review and easy to revert. A 500-line diff across 12 files is hard to verify and hard to undo when something is wrong.
Run tests after every change#
Tests are the contract between what you asked for and what the tool produced. Without them, "it looks right" is your only check.
Read every diff#
Never accept a change you have not read. This one is not optional: every other habit only reduces how much there is to read.
Short line#
Plan what you want before you prompt, give the tool the files and constraints it needs, ask for one small change at a time, run the tests after each change, and read every diff before you accept it.
Key takeaways#
- Know the function, inputs, outputs and edge cases before you prompt.
- The tool only knows its context. Give it the relevant files, interfaces and constraints.
- One change at a time keeps the diff easy to review and revert.
- Tests are the contract. Run them after every change.
- Read every diff. Never accept a change you have not read.