AI Coding Agents: 5 Habits That Hold Up in Real Work
By Morteza Bazrafshan2 min readAICoding agentsWorkflow
A coding agent is a fast, tireless junior engineer with a short memory and no sense of what is dangerous. Most bad experiences come from handing it work the way you would hand it to a senior who knows the codebase. The habits below are what I have found to hold up in day-to-day product work.
1. Give it a task it can finish
"Improve the checkout" is not a task. "Make the coupon field on the checkout page validate on blur, using the same rules as the server, and add a test" is. A good task has a visible end state and a way to check it.
If you cannot describe how you would verify the result, the task is not ready, for a person or an agent.
2. Write the context down once, in the repo
Agents start every session knowing nothing about your project. Put the stable facts in a file the agent reads at the start: how to run tests, folder layout, naming conventions, what never to touch. The AGENTS.md convention exists for exactly this, and it helps human newcomers too.
Keep it short and concrete. A page of real rules beats ten pages of aspirations. When the agent makes the same mistake twice, the fix is usually a new line in that file.
3. Close the loop with checks the agent can run
The single biggest quality lever is letting the agent run your tests, type checker and linter and read the failures. Without that loop you are the test runner. With it, the agent fixes its own typos and broken imports before you ever look.
Cheap, fast checks matter most. A two-second type check used twenty times beats a ten-minute suite used once.
4. Keep changes small and reviewable
Ask for one change per branch or commit. Review the diff the way you would review a colleague's pull request: look for what is missing (error handling, edge cases, tests) as much as what is there.
Be suspicious of diffs that are larger than the task. Unrequested refactors, renamed files and "while I was here" changes are where regressions hide.
5. Decide what it may do without asking
Reading files and running tests: yes. Deleting data, pushing to shared branches, spending money, sending messages to customers: no, or only with explicit approval. Write that boundary down (the reasons are in prompt injection and agent security), and enforce it with permissions rather than hoping the instructions are followed.
A starting routine
- Write the task with an end state and a check.
- Point the agent at the relevant files and the context file.
- Let it work with tests and linters available.
- Read the diff. Ask for changes, not rewrites.
- Merge, then update the context file if you learned something.
The downloadable checklist on this site turns this into a one-page template.
Frequently asked questions
Can an AI coding agent replace a developer?
No. It is fast on well-scoped tasks, but it lacks product judgment and a sense of risk, so a person still defines the task, reviews the diff and owns the result.
What should go in an AGENTS.md file?
How to run tests and linters, folder layout, naming conventions and areas the agent must not touch. Keep it short and concrete, and add a line whenever the agent repeats a mistake.