How do you stop AI coding tools from rewriting files you didn't ask them to touch?

by•

Asked my coding agent to fix a tiny UI issue and it silently refactored two helper scripts on the side because it thought it looked cleaner.

The original bug got fixed, but the extra refactoring broke a completely unrelated feature that i only noticed days later through a user email.

Now i have to explicitly tell it not to touch other files in every single prompt. Do you guys use any specific system Rules or prompt constraints to keep agents from drifting?

4 views

Add a comment

Replies

Best

AI coding agents can be unpredictable with scope once they start making helpfulchanges Id probably use strict file level rules and always review the diff before accepting changes Curious what tools others are using to control this behavior