
What it is
Stamina is a native menu bar app for Apple silicon Macs on macOS 15 or later. It holds the battery at a charge limit, shows which apps are draining it, and builds a report of when the battery drains and how it gets charged. The app is 9 MB. Everything runs on the Mac, with no account and no usage data sent anywhere.
The free version has the charge limit, live power, health, cycle count and temperature, top apps by energy, Low Power Mode automation and alerts. Pro adds insights with one-tap fixes, the Battery Report, time-left and health predictions, heat protection, calibration, scheduled top-ups, widgets and Shortcuts actions. Licenses are Ed25519-signed keys.
How it works
- Reading. Battery data comes from
AppleSmartBatteryin IOKit and SMC reads. Energy per app comes from IOReport counters and per-processproc_pid_rusage, plus power assertions and display brightness. - Charge control. A small root helper, registered with
SMAppService, writes the SMC keys. The policy that decides what to write is a pure function with a fixed order: unplugged, safety floor, calibration, heat, discharge, top-up, native limit, then the limit and resting range. - Staying light. It samples every second only while the popover is open and about once a minute otherwise, and it reacts to power-source notifications. At idle it uses roughly 25 MB of memory and about 0% CPU.
The repo also has a diagnostics CLI for the SMC, IOReport and the helper, and a tool that renders UI states to PNG without Xcode.
Stack
Swift 6, SwiftUI, IOKit, SMC, IOReport, XPC, SMAppService, WidgetKit, App Intents, Sparkle. The website is static and hosted on Vercel.