Protect Files from Accidental Changes with a Lock Feature

Description:

I would love to see a feature that allows me to lock certain files from my codebase in Cursor AI, preventing them from being accidentally modified by the AI. This would be incredibly useful for protecting working files that are already correct and should not be altered.

Proposed Solution:

Introduce a small lock symbol next to files in the interface. When clicked, this lock would prevent Cursor AI from making any changes to the file, ensuring that important documents remain untouched unless the user explicitly unlocks them.

Benefits:

  • Data Integrity: Ensures that critical files are not altered unintentionally.
  • User Confidence: Provides peace of mind when working with sensitive or finalized documents.
  • Efficiency: Saves time by avoiding the need to revert unwanted changes.

Use Case:

Imagine working on a project where certain files are already finalized and should not be changed. With a file locking feature, users can confidently work alongside Cursor AI without worrying about accidental modifications to their important documents.

Thanks for considering this feature!

6 Likes

Something like cursor.lock. Great idea, +1.

YES! Great idea. +1

This would be very helpful to prevent regression which is a big problem. (can’t use cursorignore because it still needs it for context)

How about using git for this purpose?

The problem is not reverting, is that the AI includes it as part of the changes it makes. You have to aggressively prompt it not to, and on long agentic chains it stops adhering. Yes, you can revert, but then you lost that whole editing chain. On the other hand, if it failed to make the change and there was some error or reminder that this file is frozen and why, then it would do its “Okay let me try this another way” process and figure something else out.