Cursor Changing Files I Didn't Ask It To
Quick Answer
Without scope limiters, Cursor tries to be helpful by making related changes. This often breaks things. Start with "Prefix every prompt with scope limits" before making broader code changes.
You're in the right place if...
- !Modified 10 files when you asked about 1
- !Refactored code you didn't mention
- !Styling broke across the app
Why this happens
Without scope limiters, Cursor tries to be helpful by making related changes. This often breaks things.
Fix
Prefix every prompt with scope limits
Add this to the beginning of your prompts:
Only modify [filename.tsx]. Do not touch any other files. Do not refactor anything I didn't ask about. Make only the specific change I describe.
Prevent this next time
Always specify which files to edit. 'Only modify src/app/page.tsx' prevents Cursor from touching anything else.
Frequently Asked Questions
It tries to make related changes for consistency. This is helpful sometimes, but scope limiters give you control.
Yes. Press Cmd+Z in each modified file, or use git checkout -- . to revert all uncommitted changes.
Related fixes
Weekly Newsletter
Get next week's fix before you need it.
Join developers getting weekly vibe coding tips, error fixes, and tool updates.
Subscribe on Substack →