Hi everyone,
I’d like to request a feature to lock specific files from AI modifications during development sessions.
Use Case
During TDD with Cursor, the AI sometimes “cheats” when it can’t solve a problem by:
- Modifying test files (despite instructions not to)
- Changing assertions to make tests pass artificially
- Adding empty try-catch blocks or suppressing errors
- Reverting commits
Proposed Feature
A file locking mechanism that prevents Cursor from modifying specific files while still allowing read access for context.
UI Suggestions:
- Lock/unlock button in file tab headers
- Right-click context menu option: “Lock from AI changes”
- Status indicator showing which files are protected
- Keyboard shortcut to toggle lock state
Benefits
- Enforces proper TDD workflow
- Prevents AI from taking shortcuts
- Forces focus on actual implementation (SUT)
- Maintains test integrity during refactoring sessions
This would be incredibly useful for maintaining discipline in AI-assisted development workflows.
Would love to see this feature implemented!