Restrict editing to files open in the IDE

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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)

Version: 1.7.46 (user setup)
VSCode Version: 1.99.3
Commit: b9e5948c1ad20443a5cecba6b84a3c9b99d62580
Date: 2025-10-14T01:21:46.830Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

I need a bit more context to help:

  • 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.

Thanks.

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.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.