A macOS utility that detects when you're in a Slack huddle (voice/video call) by monitoring system audio state and power assertions.
To the Slack team if you are reading this: Please make this easier to detect m'kay?
- 🎯 Accurate Detection: Monitors multiple system indicators to reliably detect huddle start and end
- 🔄 Auto-Calibration: Learns your baseline state and adapts thresholds
- 📊 Smart End Detection: Three methods to ensure huddle end is properly detected
- 🚀 Real-time Monitoring: Updates every 3 seconds with current status
- 📈 Dynamic Thresholds: Adjusts detection based on peak scores and trends
- 📱 MenuBar Integration: Optional native macOS menubar app for visual status indicator
- macOS (tested on macOS 14.x)
- Python 3.6+
- Slack desktop app
- sudo access (for audio system monitoring)
- Swift 5.9+ (for menubar app)
- Clone or download the repository:
git clone https://github.com/yourusername/slack-huddle-detection.git
cd slack-huddle-detection- No additional Python packages required - uses only standard library
Run the detector with sudo privileges:
sudo python3 slack-huddle-detector-optimized.pyFor a visual indicator in your macOS menubar:
-
Build and start the menubar app:
cd HuddleIndicator swift build -c release ./.build/release/HuddleIndicator &
-
Start the Python detector:
sudo python3 slack-huddle-detector-optimized.py
The detector will:
- Request sudo access (needed for audio system monitoring)
- Calibrate baseline (takes 6 seconds)
- Begin monitoring for huddles
- Display real-time status with indicators
- Update menubar icon automatically
🎧 Slack Huddle Detector - Optimized
==================================================
📊 Calibrating baseline (NOT in huddle)...
✅ Baseline score: 10
Monitoring for huddles...
Start threshold: 35
End: 70% drop from peak OR return to baseline+10
💤 No huddle | Score: 10→ | Monitoring... | Base:10 | 17:15:23
🟢 HUDDLE STARTED - 17:15:45
Score: 65 (baseline: 10)
• Audio power: 1
• Slack assertions: 3
• Audio units: 1
🎙️ IN HUDDLE | Score: 65→ | PWR:3 | AU:1 | Peak:65 | 17:15:48
🔴 HUDDLE ENDED - 17:18:32
Score: 42 (peak was 65)
New baseline: 42
The detector monitors several macOS system indicators:
- Power Assertions: Slack creates audio power assertions during huddles
- Audio Units: AudioToolbox units are instantiated for audio processing
- HAL Plugins: Hardware Abstraction Layer plugins for audio I/O
- Audio File Descriptors: Open file handles to audio devices
- IORegistry Clients: Audio engine client connections
- CoreAudio Connections: Direct connections to CoreAudio daemon
Huddle Start Detection:
- Score exceeds baseline + 25 points (minimum 50)
- Requires 2 consecutive detections for confirmation
Huddle End Detection (any of):
- Score drops to 70% of peak huddle score
- Score returns within 10 points of baseline
- Strong downward trend detected
| Indicator | Points | Description |
|---|---|---|
| Audio Power Assertions | 25 | System-level audio power management |
| Slack Assertions | 20-60 | Slack-specific power assertions (capped) |
| Audio Units | 15-30 | Audio processing units (capped) |
| HAL Plugins | 10 | Hardware audio plugins |
| Audio FDs | 5 | File descriptors above baseline |
| IO Clients | 10 | IORegistry audio clients |
| CoreAudio | 10 | CoreAudio daemon connections |
- 🎙️ IN HUDDLE: Currently in a Slack huddle
- 💤 No huddle: Not in a huddle
- ↑↓→ Trend arrows: Score movement direction
- PWR: Power assertion count
- AU: Audio unit count
- FD: File descriptor count
- Peak: Highest score during current huddle
- Base: Current baseline score
- ⚪️ (white circle): Not in huddle - visible on dark menubar
- 🎙️ (microphone): Currently in a Slack huddle
- ❌ (red X): Python detector not running
- Click icon: Shows detailed popup with metrics and connection status
The detector needs sudo to access audio system information. This is safe and only reads system state.
- Ensure you're not in a huddle during calibration
- The detector adapts its baseline after each huddle
- May trigger briefly when testing audio in Slack settings
- The detector uses multiple methods to detect end
- If issues persist, try restarting the detector
- Score should drop significantly when huddle ends
- Normal if you have other audio applications running
- The detector uses relative changes, not absolute values
- Baseline updates after each huddle for adaptation
The detector uses macOS system frameworks to monitor audio state:
- IOKit/IORegistry for audio device state
- Power Management for assertions
- CoreAudio for audio session state
- File descriptors for audio device access
No network traffic monitoring or process memory inspection is performed.
slack-huddle-detector-optimized.py- Main Python detector (recommended)HuddleIndicator/- Swift menubar app for visual status indicatorfailed attempts/- Various experimental approaches and debug toolsslack-huddle-analyzer.py- Network connection analyzerslack-huddle-iokit-fixed.py- IOKit-based detector (alternative)slack-huddle-simple.py- Simple network-based detector- Various other debug and analysis tools
MIT License - See LICENSE file for details
Contributions welcome! Please test changes thoroughly on macOS with Slack desktop app.
Developed through extensive testing and analysis of Slack's behavior on macOS during huddles.