Bring Cursor to Front
Automatically brings Cursor to the front when AI finishes responding.
Never miss when Cursor's AI completes a task! This extension uses Cursor Agent Hooks to detect when the AI agent stops, then brings the window to the foreground.
Features
- 🔔 Auto-Focus: Cursor automatically comes to front when AI finishes responding
- ⚡ One-Click Toggle: Enable or disable from the status bar or command palette
- 🖥️ Cross-Platform: Works on macOS, Windows, and Linux
- 🔧 Zero Configuration: Works out of the box
Usage
Toggle via Status Bar
Click the status bar item at the bottom right to toggle the feature on/off:
$(bell) Bring to Front: ON - Feature is enabled
$(bell-slash) Bring to Front: OFF - Feature is disabled
Toggle via Command Palette
Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and run:
Bring Cursor to Front: Toggle - Toggle on/off
Bring Cursor to Front: Enable - Enable the feature
Bring Cursor to Front: Disable - Disable the feature
After Toggling
Restart Cursor for changes to take effect. The extension modifies Cursor's hooks configuration, which requires a restart to be recognized.
| Platform |
Status |
Method |
| macOS |
✅ Ready |
AppleScript |
| Windows |
✅ Ready |
PowerShell + Win32 API |
| Linux |
✅ Ready |
wmctrl or xdotool |
Linux Requirements
Install wmctrl or xdotool:
# Ubuntu/Debian
sudo apt install wmctrl
# Fedora
sudo dnf install wmctrl
# Arch
sudo pacman -S wmctrl
How It Works
This extension manages Cursor's Agent Hooks feature, which allows running custom scripts at specific points in the agent's lifecycle.
When enabled, the extension:
- Installs a platform-specific script to
~/.cursor/scripts/
- Adds a
stop hook to ~/.cursor/hooks.json that runs the script when the AI finishes
When disabled, it removes the hook and script files.
Extension Settings
| Setting |
Type |
Default |
Description |
bringCursorToFront.enabled |
boolean |
true |
Enable/disable the feature |
Troubleshooting
Nothing happens when AI finishes
- Make sure you've restarted Cursor after enabling the extension
- Check that
~/.cursor/hooks.json exists and contains the hook
- On Linux, ensure
wmctrl or xdotool is installed
Linux: Window doesn't come to front
Some Linux desktop environments require additional configuration. Try installing both tools:
sudo apt install wmctrl xdotool
Windows: Script errors
If you see PowerShell execution policy errors, the extension uses -ExecutionPolicy Bypass to handle this. If issues persist, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Manual cleanup
If you need to manually remove the hooks:
- Delete
~/.cursor/scripts/bring_cursor_to_front.*
- Edit
~/.cursor/hooks.json and remove the bring_cursor_to_front entry
- Restart Cursor
Contributing
Issues and pull requests are welcome on GitHub.
License
MIT License - see LICENSE for details.