I like to be aware of all the files cursor will change. I have set a rule to only change files open in the IDE, however with much testing cursor recognises files open only as the focussed tab, not the open files in the tab that are not in focus.
Steps to Reproduce
In Chat with several files open in the IDE in a single tab type “what files are open in the IDE”. The answer is only a single file and several recent files, but NOT all the files that are open.
Expected Behavior
That cursor knows which files are open. I have a rule that instructs for only open files to be edited. This is both frequently not respected and … cursor doesn’t know the file list anyway.
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Where did you set the “only change open files” rule? (e.g., in a .cursorrules file, a chat prompt, or project/user rules)
What’s the exact wording of your rule?
Can you share an example where Cursor edited a file that wasn’t open despite the rule?
If you’re using a custom rule in .cursorrules or prompts, keep in mind these are guidance for the AI, not hard constraints, the model might not always follow them perfectly.
A more reliable way to block changes to specific files is to add a .cursorignore file in the project root to fully deny AI access.
I have had this in various locations, the present version is “NEVER edit files i do not have open in the IDE” set in User Rules in Cursor Settings. The files that cursor edited that were not open with package.json and tsconfig.json. These are arcane configuration files where there is a lot of noise on Internet on changes, cursor is not good at choosing advice that is applicable to the present version of angular so while I like cursor to pay attention to these files and to advise when it thinks a change is needed here, discovering the edits have happened in these closed files causes me concern.
Using .cursorignore is a different problem. Cursor considers files in here is “not existing”. I have had it happen when i have node_modules in here. node is so huge this is a good choice, however having cursor unable to follow a path to see the version of module I am using and to state that my code is wrong when it is correct for the version is somewhat entertaining, if also frustrating.
I tested - in chat - cursors knowledge of what files were open in the IDE extensively, there is clearly no api for a query to the IDE to return open files, only those both open and “in focus” in a tab.