Keep your AI assistant awake and responsive with automatic periodic nudges! No more frozen conversations or stalled responses.
CursorAFK is a system tray application that prevents AI assistants (like Claude, ChatGPT, Cursor, etc.) from going idle by automatically sending periodic "nudges" to keep the conversation active. Perfect for long research sessions, automated workflows, or when you need your AI to stay responsive while you're away.
- 🎯 Visual Area Selection: Click and drag to select exactly where your chat input is located
- 🟢 Smart Status Icons:
- 🔴 Red = No area selected
- 🟡 Yellow = Area selected, inactive
- 🟢 Green = Active and nudging
- ⏰ Automatic Nudging: Sends a keystroke every 90 seconds to keep your AI assistant active
- 🖥️ System Tray Integration: Runs quietly in the background
- 🎮 Easy Controls: Right-click menu for all operations
- Windows 10/11
- Python 3.7 or higher
- pip (Python package installer)
-
Clone this repository
git clone https://github.com/yourusername/cursorafk.git cd cursorafk -
Install dependencies
pip install -r requirements.txt
-
Run the application
python cursorafk.py
python cursorafk.py- Look for a red square icon in your system tray (bottom-right corner)
- The red color means no chat area has been selected yet
- Open your AI assistant (Claude, ChatGPT, Cursor, etc.) in a window
- Make sure the chat interface is visible and accessible
- Right-click the red tray icon
- Click "Select Chat Area"
- Your screen will dim with a semi-transparent overlay
- Click and drag to draw a rectangle around your chat input box
- The rectangle will turn green when you release the mouse
- Press ENTER to confirm or ESC to cancel
- The tray icon turns yellow (area selected, but not active yet)
- Right-click the yellow tray icon
- Click "Start Autonomous Mode"
- The icon turns green - you're now active!
- Every 90 seconds, CursorAFK will:
- Click your selected chat area
- Type the letter "g"
- Press Enter
- Green icon = Active nudging
- Check console output for nudge confirmations
- Right-click anytime to:
- Stop autonomous mode
- Change chat area
- Exit application
Edit cursorafk.py line with self.stop_event.wait(90) and change 90 to your desired seconds.
Edit the pyautogui.write('g') line to send different text.
"No chat area selected" error
- Make sure you've completed Step 3 (selecting the chat area)
- The tray icon should be yellow or green, not red
Nudges not working
- Verify your selected area covers the chat input box
- Try reselecting the area if the interface has moved
- Ensure the AI assistant window isn't minimized
Can't see the tray icon
- Check if it's hidden in the system tray overflow
- Click the "^" arrow in the system tray to show hidden icons
Selection overlay not appearing
- Make sure no other applications are in fullscreen mode
- Try running as administrator if needed
Run with console output visible to see detailed logs:
python cursorafk.pyKeep the terminal window open to monitor nudge activity.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built to keep Claude, Cursor and other AI assistants active and responsive
- Inspired by the need for uninterrupted AI conversations
- Thanks to the Python community for excellent libraries like
pystrayandpyautogui
If CursorAFK helps keep your AI conversations flowing, give it a star! It helps others discover this tool and keeps AI assistants everywhere happy and responsive.
Made with ❤️ for the AI community