A comprehensive toolkit for diagnosing and resolving power management, thermal throttling, and system stability issues on Intel MacBooks.
After months of frustration with my MacBook Pro (2020, Intel), I finally snapped when I opened my bag to find my laptop had been running at full blast, burning through the battery and heating up dangerously—despite the lid being closed.
This wasn't an isolated incident. The symptoms had been building:
- WindowServer crashes during normal use
- Thermal throttling reducing CPU to 31% speed
- Battery drain while the Mac should have been sleeping
- Touch ID failures after wake from sleep
- iCloud sync consuming 150%+ CPU for hours
- Spotlight indexing hammering the system relentlessly
After an extensive debugging session, I discovered a cascade of interconnected issues—from a misconfigured SMC to phantom audio drivers holding sleep assertions. This repository documents everything I learned and provides tools to prevent these issues.
| Tool | Purpose |
|---|---|
sysutil |
Swiss-army knife for system diagnostics and fixes |
icloud-throttle.sh |
Persistent daemon to throttle runaway iCloud/Spotlight processes |
macos-setup.sh |
One-command setup script for fresh installations |
com.user.icloud-throttle.plist |
Launch daemon for automatic process throttling |
- Installation
- Quick Start
- The sysutil Command
- Root Causes Identified
- Detailed Findings
- Manual Fixes
- Troubleshooting Guide
- Contributing
- Licence
# Clone the repository
git clone https://github.com/yourusername/macos-power-toolkit.git
cd macos-power-toolkit
# Run the setup script
sudo ./macos-setup.sh# 1. Create bin directory
mkdir -p ~/bin
# 2. Copy scripts
cp sysutil ~/bin/
cp icloud-throttle.sh ~/bin/
chmod +x ~/bin/sysutil ~/bin/icloud-throttle.sh
# 3. Add to PATH
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# 4. Install launch daemon (requires sudo)
sudo cp com.user.icloud-throttle.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/com.user.icloud-throttle.plist- macOS 13+ (tested on macOS 26.2)
- Bash 4+ (install via Homebrew:
brew install bash) - Intel or Apple Silicon MacBook
Note: The scripts use
/usr/local/bin/bashby default. If your Bash is elsewhere, update the shebang in each script.
After installation, run a system health check:
sysutil statusThis shows:
- Thermal status (CPU throttling)
- System load
- Power source
- Active sleep blockers
- Top CPU processes
- Throttler daemon status
# Check if your Mac can sleep properly
sysutil sleep-check
# Fix Touch ID after sleep issues
sysutil touchid
# See what's blocking sleep
sysutil assertions
# Manually throttle iCloud/Spotlight
sysutil throttle
# Watch throttled processes live
sysutil monitor
# Check why your Mac woke up
sysutil wake-reasonA comprehensive utility for managing macOS power, processes, and diagnostics.
| Command | Description |
|---|---|
status |
Overall system health check |
top |
Top 15 CPU-consuming processes |
thermal |
Thermal status and CPU throttling level |
assertions |
All active sleep blockers/assertions |
throttle |
Manually throttle iCloud/Spotlight processes |
monitor |
Live monitoring of throttled processes |
touchid |
Reset Touch ID daemons |
sleep-check |
Verify sleep configuration is correct |
sleep-test |
Interactive sleep/wake cycle test |
icloud-reset |
Reset iCloud sync state (clears caches) |
icloud-status |
Show iCloud sync status |
spotlight on|off|status |
Control Spotlight indexing |
chime on|off|status |
Control charging chime (and wake on AC attach) |
audio |
Check audio-related sleep assertions |
battery |
Battery status and health |
wake-reason |
Show recent wake reasons |
pmset |
Current power management settings |
# Quick health check
sysutil status
# Before leaving Mac unattended on battery
sysutil sleep-check
# Fix Touch ID not working after sleep
sysutil touchid
# iCloud using too much CPU
sysutil throttle
sysutil monitor
# Mac keeps waking up
sysutil wake-reason
sysutil assertions
# Disable Spotlight temporarily
sysutil spotlight offThrough extensive debugging, I identified these root causes:
Symptom: Laptop doesn't sleep when lid is closed
Cause: AppleClamshellCausesSleep was set to No
Discovery:
ioreg -r -k AppleClamshellCausesSleep | grep AppleClamshellCausesSleep
# Returned: "AppleClamshellCausesSleep" = No ← THIS IS WRONGFix: SMC Reset (see Manual Fixes)
Symptom: Battery drains while Mac should be idle
Cause: WhatsApp holds PreventUserIdleSystemSleep even when not on a call:
WhatsApp: "cameracaptured-idleSleepPreventionForBWFigCaptureDevice"
Fix: Quit WhatsApp properly (Cmd+Q) before leaving Mac unattended
Symptom: coreaudiod holds sleep assertions for 22+ hours
Cause: Virtual audio drivers (BlackHole, Microsoft Teams Audio Device) create persistent audio contexts that hold PreventUserIdleSystemSleep assertions indefinitely, even when no audio is playing.
Fix: Remove unused virtual audio drivers:
# Remove BlackHole
sudo rm -rf /Library/Audio/Plug-Ins/HAL/BlackHole2ch.driver
# Remove Microsoft Teams Audio Device
sudo rm -rf /Library/Audio/Plug-Ins/HAL/MSTeamsAudioDevice.driver
# Restart audio subsystem
sudo killall coreaudiod
# Verify removal
ls -la /Library/Audio/Plug-Ins/HAL/Note: Microsoft Teams will still work fine for calls without its virtual audio device - it will use the built-in audio directly.
Symptom: fileproviderd at 150%+ CPU for hours
Cause: 67 orphaned containers from uninstalled apps
Fix: Reset iCloud sync state:
sysutil icloud-resetSymptom: Touch ID doesn't work after sleep/power events
Cause: Biometric daemons lose sync with Secure Enclave
Fix:
sysutil touchid
# or manually:
sudo killall biometrickitd BiomeAgent biomed TouchBarServerSymptom: Mac wakes up and plays charging chime when plugging in charger, even with lid closed
Cause: On some MacBook Pro models (including 2020 13"), the lid sensor (AppleACPILid) detects a phantom "lid event" when USB-C power is connected. This is a hardware/firmware behaviour that triggers WindowServer to create a UserIsActive assertion.
Evidence in logs:
WindowServer TurnedOn UserIsActive "com.apple.iohideventsystem.queue.tickle service:AppleACPILid"
Mitigation: This cannot be fully fixed in software, but you can:
- Disable the charging chime (Mac will still wake briefly but silently):
sysutil chime off-
Plug in charger before closing lid - avoids the wake entirely
-
Don't worry - the Mac will return to sleep within ~5 minutes automatically (unlike before when audio drivers kept it awake for 22+ hours)
Runaway browser tab (101% CPU)
↓
System overheats
↓
ThermalPressureLevelHeavy triggered
↓
CPU throttled to 31%
↓
Intel GPU driver stalls under thermal stress
↓
WindowServer hangs waiting for GPU
↓
Watchdog kills WindowServer
↓
System crash
WhatsApp running (even in background)
↓
Holds "cameracaptured" assertion
↓
PreventUserIdleSystemSleep = 1
↓
Mac ignores idle timeout
↓
Battery drains to 0%
↓
"Low Power Sleep" finally triggers (too late)
| Software | Issue | Impact |
|---|---|---|
| BlackHole 2ch | Phantom audio contexts | Battery drain |
| MSTeamsAudioDevice.driver | Holds sleep assertions for 22+ hours | Prevents sleep entirely |
| Adobe Acrobat DC | CGPDFService CPU spikes | Thermal issues |
| Adobe Creative Cloud | Finder sync overhead | CPU usage |
| Foxit PDF Editor | PDF rendering conflicts | CPU spikes |
| Weather Widget | Stuck at 72% CPU | Thermal issues |
| Sleep assertion holder | Battery drain | |
| Microsoft Teams | Audio driver loaded at boot | Sleep issues |
This is critical if your Mac doesn't sleep when the lid is closed.
- Shut down the Mac completely
- Press and hold Control + Option + Shift (left side) for 7 seconds
- While holding those keys, press and hold the Power button for 7 seconds
- Release all keys, wait a few seconds
- Press Power to turn on
Verify:
ioreg -r -k AppleClamshellCausesSleep | grep AppleClamshellCausesSleep
# Should return: "AppleClamshellCausesSleep" = Yes# Battery settings
sudo pmset -b sleep 15 # Sleep after 15 min idle
sudo pmset -b displaysleep 10 # Display sleep after 10 min
# AC power settings
sudo pmset -c sleep 0 # Never sleep with lid open on AC
sudo pmset -c displaysleep 10 # Display sleep after 10 min
# Both power sources
sudo pmset -a womp 0 # Disable Wake on Magic Packet
sudo pmset -a proximitywake 0 # Disable proximity wake
sudo pmset -a tcpkeepalive 0 # Disable TCP keepalive
sudo pmset -a powernap 0 # Disable Power Nap# List installed audio drivers
ls -la /Library/Audio/Plug-Ins/HAL/
# Remove BlackHole (if not needed)
sudo rm -rf /Library/Audio/Plug-Ins/HAL/BlackHole2ch.driver
# Restart audio system
sudo killall coreaudiod# Kill iCloud processes
killall -9 fileproviderd cloudd bird
# Clear sync caches
rm -rf ~/Library/Application\ Support/CloudDocs/session/
rm -rf ~/Library/Caches/CloudKit/
rm -rf ~/Library/Caches/com.apple.bird/# Check clamshell setting
ioreg -r -k AppleClamshellCausesSleep | grep AppleClamshellCausesSleep
# If it says "No", do an SMC reset (see above)# Check what's blocking sleep
sysutil assertions
# Look for PreventUserIdleSystemSleep or PreventSystemSleep
# Kill the offending app or processsysutil touchid# Check thermal status
sysutil thermal
# Check top CPU consumers
sysutil top
# Throttle iCloud/Spotlight if needed
sysutil throttle# Check status
sysutil icloud-status
# Throttle processes
sysutil throttle
# If still bad, reset sync state
sysutil icloud-resetsysutil wake-reasonmacos-power-toolkit/
├── README.md # This file
├── LICENSE # MIT licence
├── sysutil # Main utility script
├── icloud-throttle.sh # Throttle daemon script
├── com.user.icloud-throttle.plist # Launch daemon config
├── macos-setup.sh # Automated setup script
└── docs/
└── macos-power-management-guide.tex # LaTeX documentation
- Hardware: MacBook Pro 13" (2020, Intel)
- macOS: 26.2
- Chip: Intel Core i5 with Intel Iris Plus Graphics
- Bash: 5.x (via Homebrew)
The toolkit should work on:
- Intel MacBooks (2015–2020)
- Apple Silicon MacBooks (M1/M2/M3)
- macOS 13 Ventura and later
Contributions are welcome! If you've encountered similar issues or have improvements:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add new diagnostic') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
- Apple Silicon-specific diagnostics
- GUI wrapper for sysutil
- Integration with Homebrew
- Automated issue detection
- Menu bar status indicator
This project is licensed under the MIT Licence - see the LICENSE file for details.
- Apple's
pmsetdocumentation - The macOS power management community
These tools modify system settings and kill system processes. While they've been tested extensively on my own machine, use at your own risk. Always have a backup before making system changes.
This toolkit is not affiliated with or endorsed by Apple Inc.
If you find this useful or have questions:
- Open an issue on GitHub
- Star the repository if it helped you!
Because no laptop should cook itself in a bag.