Script to Keep Slack Active: Why Most Stopped Working, What Works
Most scripts that promise to keep Slack active no longer work through the API: it cannot force a user to active, and bot tokens have their own presence. OS keypress scripts do keep the Slack desktop app active while the screen is unlocked. How to test any script with users.getPresence.
On this page
Most scripts that promise to keep Slack active do not work today, for three reasons from Slack's own docs. First, users.setPresence accepts only auto and away; there is no way to force a user to active. Second, a bot token has its own presence, so a bot script cannot keep your dot green. Third, scripts that press keys or move the mouse at the operating-system level count for the Slack desktop app wherever the input lands (Slack desktop 4.52.178 code, checked 7 Oct 2026), while the screen is unlocked. What still works is a script that acts as your own Slack client from a session, the way the web app does, and keeps producing activity.
Slack Green runs that kind of session on its own side during the working hours you pick, so nothing runs on your computer and the laptop can be shut. If you want to run it yourself, the self-hosted CLI runs the same engine on your own machine with your tokens on your own disk.
Why most keep-Slack-active scripts stopped working
| Approach | Works today? | Why |
|---|---|---|
users.setPresence with active | No | Only auto or away are accepted |
| Bot token tricks | No | A bot has its own presence |
| OS keypress or mouse script | Yes, desktop app, while unlocked | The desktop app reads the system idle time |
| Userscript in the Slack tab | Fragile | Breaks on updates, tab discarding, screen lock |
| Session client from a server | Yes | Acts as your own client |
Slack's developer docs define presence plainly: a user is active if they have at least one client connected and are not marked away, and after 10 minutes with no activity Slack marks them away automatically. Many old GitHub scripts set presence=auto and assumed that meant green. auto only removes a manual away; without activity you are still away 10 minutes later. Details and code are in our Slack presence API guide.
OS-level scripts: PowerShell, AutoHotkey, Python pyautogui
Scripts that press F15 or nudge the mouse keep Windows or macOS awake, and keep Microsoft Teams green, because those watch the whole computer. Slack does not. The Slack desktop app counts it wherever it lands (Slack desktop 4.52.178 code, checked 7 Oct 2026), as long as the screen is unlocked and the lid open. The PowerShell versions, and what they do for Teams, are in keep a Windows PC awake with PowerShell; the same limits apply to mouse jigglers. Copy-ready Teams versions are in PowerShell script to keep Teams active. Code for a Python, AutoHotkey, Arduino or Raspberry Pi Pico version is in DIY mouse jiggler.
Userscripts in the Slack browser tab
A Tampermonkey-style script can fire events inside app.slack.com so the tab sees activity. It works only while that tab stays loaded and the computer stays awake, and a Slack web update can break it overnight. Browser memory savers can unload the tab; see keep Slack active in the browser. Browser extensions built on this idea have also been removed from the Chrome Web Store; see Slack Chrome extensions.
Never appear "away" on Slack again
Cloud-based. No downloads. Works 24/7 even when your laptop is off.
Session-based scripts: what still works
A client that signs in as you, with the same session the web app uses (the xoxc token and d cookie), counts as a connected client and can keep producing activity from any machine, with your laptop closed. That is how the web app itself stays active. How those tokens work, and the security trade-off of storing them anywhere, is in Slack xoxc and xoxd tokens. Tokens end when you sign out or your workspace's session duration expires, so any script needs to notice authentication errors.
Building and maintaining this yourself means handling reconnects, token expiry, schedules and time zones. The self-hosted CLI is that engine packaged for your own Mac, Linux box or server.
How to test any keep-active script
- Start the script and leave the computer alone. Lock it too.
- Wait 11 minutes, past Slack's 10-minute idle window.
- Ask Slack about yourself with a user token:
curl -s -H "Authorization: Bearer $SLACK_USER_TOKEN" https://slack.com/api/users.getPresence
"presence": "active" with "auto_away": false means it works. "auto_away": true means Slack saw no activity.Is a keep-active script allowed?
Slack's terms and your employer's policy both apply, and a script that signs in as you appears in your access logs. What an employer can see is covered in whether a presence tool can get you caught and can Slack be used to monitor employees.
FAQ
Is there a script to keep Slack always active?
Only session-based ones still work reliably. API calls cannot force active, and OS scripts only help with Slack in focus.
Why does my Slack keep-active GitHub script not work anymore?
It probably calls users.setPresence, which accepts only auto or away, or uses a bot token, which has its own presence.
Can a Python script keep Slack active?
A pyautogui script works with any window focused, while the screen is unlocked. A session-based client can, with the trade-offs above.
Does a PowerShell script keep Slack active?
No, unless Slack is the focused window. It does keep Windows and usually Teams active.
How do I check if I am active on Slack from a script?
Call users.getPresence without a user ID and read presence and auto_away.
Stop Jiggling Your Mouse.
Join hundreds of remote workers who never worry about their Slack status. Set it up once, stay green forever.
Related Articles
Slack Daily Standup Without a Paid Bot: /remind, Workflow Builder and a Script
We set up a weekday 9:30 standup in a free Slack workspace three ways: a /remind reminder, Workflow Builder, and a short script that posts the questions and collects the thread replies.
Slack Tabs Under a Channel Name: What Each One Is and How to Edit Them
We added, renamed, moved, hid and deleted the tabs under a channel name in Slack web on the Free plan, and compared them with the tabs in a DM.
Leave Multiple Slack Channels at Once: 4 Ways Timed, Plus a Script
Slack has no bulk leave button. We made 12 test channels and left them with the sidebar menu, the channel browser, /leave and a 30-line script, and timed each way.