Cursor Helper
Get notified when your Cursor AI tasks complete! 🎉
Cursor Helper is a lightweight VS Code/Cursor extension that monitors a flag file and triggers desktop notifications with optional sounds when your AI-assisted coding tasks finish.
✨ Features
- 🔔 Desktop Notifications: Get notified instantly when tasks complete
- 📊 Context Window Monitoring: Alerts when Cursor's context reaches capacity
- 🔊 Cross-Platform Sound: Plays completion sounds on macOS, Windows, and Linux
- ⚙️ Highly Configurable: Customize messages, sounds, and behavior
- 🔧 Extensible Architecture: Easy to add new notification types and watchers
- 📝 Detailed Logging: Optional output channel for debugging
- 🔒 Privacy First: Runs entirely locally, no telemetry or external calls
🚀 Quick Start
Installation
Option 1: From VSIX (Development/Testing)
npm install
npm run build
npm run package
Then install the generated .vsix
file via Extensions → Install from VSIX...
Option 2: From Source (Development)
git clone https://github.com/your-username/cursor-helper.git
cd cursor-helper
npm install
Press F5
in VS Code/Cursor to open Extension Development Host
Setup Cursor Rule (Automatic Notifications)
The easiest way to get automatic notifications:
- Press
Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux)
- Type:
Cursor Helper: Quick Setup (Copy Rule)
- Press Enter and follow the instructions
Or manually add this rule to Cursor Settings:
macOS/Linux:
When you complete a task, run this command to notify the user:
<!run:sh -lc "echo \"$(date) :: CURSOR_DONE\" > $HOME/.cursor-notify.flag">
Windows:
When you complete a task, run this command to notify the user:
<!run:powershell -command "$d=Get-Date; Set-Content -Path $env:USERPROFILE\.cursor-notify.flag -Value $d;">
Test It Works
- Press
Cmd+Shift+P
/ Ctrl+Shift+P
- Type:
Cursor Helper: Test Notification
- You should see a notification and hear a sound! 🎉
Setup Context Window Monitoring
Get alerted when Cursor's context window reaches capacity:
- Press
Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux)
- Type:
Cursor Helper: Setup Context Window Monitoring
- Press Enter and follow the instructions
- Paste the rule into your Cursor Settings alongside your existing rules
Or manually add this rule:
macOS/Linux:
When the context window usage exceeds 90%, run this command to alert the user:
<!run:sh -lc "echo \"$(date) :: CONTEXT_ALERT\" > $HOME/.cursor-context-alert.flag">
Windows:
When the context window usage exceeds 90%, run this command to alert the user:
<!run:powershell -command "$d=Get-Date; Set-Content -Path $env:USERPROFILE\.cursor-context-alert.flag -Value $d;">
You can adjust the threshold (default 90%) in the extension settings.
⚙️ Configuration
Setting |
Type |
Default |
Description |
cursorHelper.flagFile |
string |
~/.cursor-notify.flag |
Path to the flag file to watch |
cursorHelper.message |
string |
Cursor task complete |
Notification message to display |
cursorHelper.playSound |
boolean |
true |
Play a sound when tasks complete |
cursorHelper.customSoundPath |
string |
"" |
Path to custom sound file (empty = system default) |
cursorHelper.debounceMs |
number |
500 |
Debounce time for file change events (ms) |
cursorHelper.enableLogging |
boolean |
false |
Enable detailed logging to output channel |
cursorHelper.contextMonitoring.enabled |
boolean |
true |
Enable context window capacity monitoring |
cursorHelper.contextMonitoring.flagFile |
string |
~/.cursor-context-alert.flag |
Path to the context alert flag file |
cursorHelper.contextMonitoring.message |
string |
⚠️ Context window at capacity |
Message to display when context window is at capacity |
cursorHelper.contextMonitoring.threshold |
number |
90 |
Alert when context usage exceeds this percentage (0-100) |
Example Configuration
{
"cursorHelper.flagFile": "~/projects/.cursor-done",
"cursorHelper.message": "✅ AI task finished!",
"cursorHelper.playSound": true,
"cursorHelper.customSoundPath": "~/sounds/complete.wav",
"cursorHelper.debounceMs": 1000,
"cursorHelper.enableLogging": true
}
macOS (system sounds):
{
"cursorHelper.customSoundPath": "/System/Library/Sounds/Hero.aiff"
}
Windows (custom WAV):
{
"cursorHelper.customSoundPath": "C:\\Users\\YourName\\Music\\complete.wav"
}
Linux (custom sound):
{
"cursorHelper.customSoundPath": "/home/username/sounds/complete.wav"
}
🎯 Usage
Commands
Use the Command Palette (Cmd+Shift+P
/ Ctrl+Shift+P
):
- Cursor Helper: Quick Setup (Copy Rule) - Easy one-click setup with platform-specific rule
- Cursor Helper: Setup Context Window Monitoring - Setup alerts for context capacity
- Cursor Helper: Test Notification - Trigger a test notification
- Cursor Helper: Open Settings - Open extension settings
How It Works
Task Completion Notifications:
- You add the Cursor Rule (see Quick Start)
- When Cursor AI completes a task, the rule executes
- The rule updates the flag file with a timestamp
- Extension detects the file change
- You get a notification and sound! 🎉
Context Window Monitoring:
- Add the context monitoring rule to Cursor Settings
- When context usage exceeds your threshold (default 90%), Cursor triggers the rule
- The rule updates the context alert flag file
- Extension detects the alert
- You get notified to take action (e.g., start a new chat, summarize, etc.)
🔊 Sound Support
macOS
- Default: System sound (
/System/Library/Sounds/Glass.aiff
)
- Custom: Any
.aiff
or .wav
file via customSoundPath
- Uses built-in
afplay
command
Windows
- Default: Console beep (800Hz, 300ms)
- Custom:
.wav
files via PowerShell Media.SoundPlayer
Linux
- Attempts
paplay
(PulseAudio) → aplay
(ALSA) → terminal bell
- Custom support for
.wav
and .oga
files
- Install utilities:
sudo apt-get install pulseaudio-utils
or alsa-utils
🏗️ Architecture
The extension is built with extensibility in mind:
src/
├── core/
│ └── types.ts # Interfaces (IWatcher, INotifier, ISoundPlayer, ILogger)
├── config/
│ └── configManager.ts # Configuration management with hot-reload
├── watchers/
│ └── fileWatcher.ts # File watching with debouncing (extensible)
├── notifiers/
│ └── vscodeNotifier.ts # Notification handlers (extensible)
├── sound/
│ └── soundPlayer.ts # Cross-platform sound playback (extensible)
├── utils/
│ ├── logger.ts # Logging utilities
│ └── path.ts # Path utilities
└── extension.ts # Main entry point
Extensibility
All major components implement interfaces, making it easy to extend:
Add a New Watcher:
import { IWatcher, TaskCompleteEvent } from './core/types';
export class HttpWatcher implements IWatcher {
async start(): Promise<void> { /* ... */ }
stop(): void { /* ... */ }
isActive(): boolean { /* ... */ }
}
Add a New Notifier:
import { INotifier } from './core/types';
export class WebhookNotifier implements INotifier {
async notify(message: string): Promise<void> { /* ... */ }
}
Add a New Sound Player:
import { ISoundPlayer } from './core/types';
export class CustomSoundPlayer implements ISoundPlayer {
canPlay(): boolean { /* ... */ }
async play(soundPath?: string): Promise<void> { /* ... */ }
}
🐛 Troubleshooting
Notifications Not Appearing
Check flag file path:
# macOS/Linux
ls -la ~/.cursor-notify.flag
# Windows PowerShell
Test-Path $env:USERPROFILE\.cursor-notify.flag
Enable logging:
- Set
"cursorHelper.enableLogging": true
- View Output: View → Output → Cursor Helper
Test manually:
# macOS/Linux
echo "test" > ~/.cursor-notify.flag
# Windows
echo "test" > %USERPROFILE%\.cursor-notify.flag
Sound Not Playing
macOS:
# Check afplay
which afplay
afplay /System/Library/Sounds/Glass.aiff
Linux:
# Install sound utilities (Ubuntu/Debian)
sudo apt-get install pulseaudio-utils
# Or ALSA
sudo apt-get install alsa-utils
Windows: PowerShell should work by default
File Watcher Issues
- Network drives or cloud storage may not support file watching
- Try using a local path for the flag file
- Increase
debounceMs
if getting multiple notifications
🔧 Development
Building from Source
# Install dependencies
npm install
# Build
npm run build
# Watch mode (auto-rebuild on changes)
npm run watch
# Package for distribution
npm run package
Debugging
- Open the project in VS Code/Cursor
- Press
F5
to launch Extension Development Host
- Set breakpoints in TypeScript files
- Use Command Palette to test commands
- Check Output panel (View → Output → Cursor Helper) for logs
Testing
- Test Command:
Cursor Helper: Test Notification
- Manual Flag Update:
echo "test" > ~/.cursor-notify.flag
- Watch Mode: Run
npm run watch
and press F5
- VSIX Install:
npm run package
then install the .vsix
file
Project Structure
cursor-helper/
├── src/ # TypeScript source files
├── out/ # Compiled JavaScript (generated)
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── .vscode/ # VS Code debug configuration
│ ├── launch.json
│ └── tasks.json
└── README.md # This file
🤝 Contributing
Contributions are welcome! This extension is designed to be extensible.
Getting Started
- Fork and clone the repository
- Run
npm install
- Make changes in
src/
directory
- Run
npm run build
or npm run watch
- Press
F5
to test in Extension Development Host
Coding Standards
- Use TypeScript strict mode
- Prefer interfaces over types for extensibility
- Use async/await over callbacks
- Document public APIs with JSDoc comments
- Run
npm run lint
before committing
Areas for Contribution
- Add new watcher types (HTTP endpoints, log file tailing, process monitoring)
- Add new notification types (webhooks, rich notifications with buttons)
- Add new sound players or platform support
- Improve error handling and edge cases
- Add automated tests
- Improve documentation
Pull Request Process
- Update README.md if adding new features
- Ensure all tests pass and linting is clean
- Create a Pull Request with:
- Clear description of changes
- Screenshots/GIFs for UI changes
- Platform testing notes
📜 Changelog
[0.2.0] - 2025-10-01
Added:
- Context window capacity monitoring with configurable threshold
- Context watcher for monitoring context usage alerts
- Setup Context Window Monitoring command
- Context-specific configuration options (enabled, flagFile, message, threshold)
- Automatic alerts when context window reaches capacity
[0.1.0] - 2025-10-01
Added:
- Initial release of Cursor Helper extension
- File-based task completion detection via flag file
- Cross-platform desktop notifications
- Cross-platform sound playback (macOS/Windows/Linux)
- Configurable settings (flag file path, message, sound, debounce, logging)
- Quick Setup command with platform-specific rules
- Test Notification and Open Settings commands
- Extensible architecture with interfaces
- Hot-reload configuration support
- Output channel logging for debugging
🗺️ Roadmap
- [ ] Status bar integration with task status
- [ ] Multiple flag file support with labels
- [ ] Webhook notification mode
- [ ] Log file tailing mode
- [ ] Rich notifications with action buttons
- [ ] Rate limiting and cooldown
- [ ] Bundled default sounds
- [ ] E2E test suite
- [ ] VS Code Marketplace publication
📄 License
MIT License - see LICENSE file for details
🙏 Acknowledgments
Built for the Cursor AI community to enhance the AI-assisted coding experience.
Enjoy! 🎉 If you find this extension helpful, please star the repository and share it with others!