When I ask Claude Code to fix a small bug, I sometimes get the fix plus renamed variables, reformatted sections, or nearby cleanup. Those extra edits may be reasonable, but they make a ten-line change much harder to review.
I want to establish a minimal diff workflow without preventing necessary changes to tests or shared helpers. “Only edit this file” can be too restrictive when the bug actually starts somewhere else.
What has worked better for you: asking for an edit plan first, specifying allowed files, or requiring approval before expanding the scope? I’d also like to distinguish edits Claude chooses to make from changes caused by a formatter or pre-commit hook.
If you use repository instructions for this, how do you phrase the boundary so it discourages opportunistic cleanup but still allows a proper fix?
Can you answer this question?
Write Answer0 Answers