Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
The beforeReadFile hook doesn’t get invoked if the file being read is open in the UI.
Steps to Reproduce
- Open any project file in the UI and ask the agent to summarise its contents
- Close the file, start a new chat and ask the agent to summarise its contents
- Look at the Hooks Execution Logs, you will see that the hook was only invoked when the file was closed
Expected Behavior
The beforeReadFile hook is invoked when the read file tool is used, regardless of whether or not the file is open in the UI.
Operating System
MacOS
Version Information
Version: 3.3.30
VSCode Version: 1.105.1
Commit: 3dc559280adc5f931ade8e25c7b85393842acf30
Date: 2026-05-09T18:28:42.332Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
Does this stop you from using Cursor
No - Cursor works, but with this issue