If you run aider with --watch-files, it will watch all files in your repo and look for any AI coding instructions you add using your favorite IDE or text editor.
Aider will take note of all the comments that start or end with AI. Comments that include AI! with an exclamation point or AI? with a question mark are special. They triggers aider to take action to collect all the AI comments and use them as your instructions.
Aider will look for those comment types in all files. You can use them into any code file you’re editing, even if they aren’t the correct comment syntax for that language.
You can add an AI comment in the function you want changed, explaining the change request in-context right where you want the changes.
You can add multiple AI comments without the !, before triggering aider with a final AI!. Also keep in mind that you can spread the AI comments across multiple files, if you want to coordinate changes in multiple places. Just use AI! last, to trigger aider.
You can add a block of comments, with longer instructions. Just be sure to start or end one of the lines with AI or AI! to draw aider’s attention to the block.