Cursor is constantly deleting my CSS without me asking it to while I'm trying to fix issues.

by•

Has anyone else had this problem?

I tell Cursor to fix a database query and for no reason it starts "cleaning up" the frontend file I have open and removes all my Tailwind classes.

The backend code is working,. I just click accept.. Then I look at the browser and my user interface is completely messed up. I'm saving a lot of time on server logic. Spending all that time putting my styling back the way it was.

Is there a way to lock files so the AI can't change them at all during a refactor?

12 views

Add a comment

Replies

Best

Could file locking prevent this kind of AI generated CSS change while the app is running?

Give each task an explicit list of files it may change, then reject the diff if anything outside that list is touched. For a database fix, any frontend edit should stop the task before you accept it instead of waiting to notice the damage in the browser.