Agent question
Why does my AI agent change files outside the task?
Short answer: Because the task never said where the change should stay. Agents tidy what they touch on the way: a rename here, a reformat there, a helper improved in another folder. Name the files or folder the change belongs in, and tell the agent to ask before editing anything else.
Common causes
- The task names a goal but not where the change belongs.
- A formatter or lint auto-fix runs over the whole repo instead of the changed files.
- The agent fixes unrelated failures to get a green run.
- Shared helpers and config files sit in the path of many tasks.
- Nobody reads the list of changed files before reading the diff.
How to check
For each recent agent task, compare the files it changed with the files or folder the task was about. Count the files outside that scope. A few agents or task kinds usually account for most of them.
What to change
- Name the files or folder in the task, and add a standing rule: ask before editing anything outside them.
- Run formatters and auto-fixes on changed files only.
- Put unrelated cleanup in its own task and pull request.
- Review the changed-file list first, and send back any change that wanders.
Where Overdrive helps
Your agents can report how many files a task touched outside its scope. Overdrive's Agent health page flags wandering agents, and Fix it gives your own agent a rule to stay inside the task. Overdrive then re-checks the tasks that follow.