Check your laptop's battery health right inside VS Code — design capacity vs.
current full-charge capacity, cycle count, charging state, and a personalized
usage plan to help you get the most life out of your battery.
Works on Windows, macOS, and Linux.
Features
Health percentage with a color-coded bar (green / yellow / red)
Live battery details:
Current charge %
Charging state
Cycle count
Design capacity vs. current full-charge capacity
Best battery usage plan — personalized recommendations based on your
battery's actual health, cycle count, and current charge level (keep charge
between 20–80%, enable charge-limit mode, watch out for heat, and more)
Refresh the report anytime with one click
How to use
Install the extension.
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
Run Battery Health: Show Report.
Use Battery Health: Refresh Report (or the button in the report) to
re-read live data.
How it works
The extension reads real battery telemetry from your OS — it doesn't guess:
Platform
Data source
Windows
PowerShell + WMI battery classes, with powercfg /batteryreport as fallback
macOS
system_profiler SPPowerDataType (falls back to ioreg)
Linux
upower (falls back to /sys/class/power_supply)
Health % = current full-charge capacity ÷ original design capacity × 100
(on macOS this comes directly from the system's own "Maximum Capacity" figure).
Requirements
Windows: PowerShell (built in)
macOS: no extra tools needed
Linux: upower (preinstalled on most desktop distros; otherwise
sudo apt install upower)
Notes
On some machines the battery driver does not expose every field (e.g. cycle
count or design capacity). The report shows only what your hardware provides.
Desktop machines with no battery will show a friendly "no battery detected"
message instead of an error.