How to help coding agents help you in writing grokkable code. Some practical advice from my own personal experience of getting machines to write code for me.
I write a lot of code using AI assistance. Not because I don't like coding, but because it allows me to spend more time on the semantics of the code and less time on the syntax. A part of me still enjoys getting into the weeds of the syntax, but when there's some delivery on the line, it's somewhat irresponsible to choose the scenic route.
Disclaimer: Before we start, I should tell you that if you are strongly opinionated about the aesthetics of your code, and have a artisanal approach to writing code, this article is probably not for you. In fact, it may offend you.
Organize code into larger, well-structured files with clear module boundaries instead of scattered small files. This gives AI agents better context and reduces cognitive load. Group related functionality together and maintain a modular directory structure to help direct AI attention to relevant code sections.
Coding agents build context from the code they can "see" at once. When code is scattered across many small files, the agent may miss important relationships or make assumptions without full context. For example, if related functionality is split across multiple files, the AI might suggest changes that break dependencies it wasn't aware of. Good structure helps the AI understand the full picture and make more informed suggestions.