# Battery Optimizer for Raycast

URL: https://www.raycast.com/Qetesh/battery-optimizer

> Set a battery charge limit on your Mac to protect battery health, using bclm or batt, with a menu bar toggle and battery status view.

- Install: raycast://extensions/Qetesh/battery-optimizer
- Author: [Qetesh](https://www.raycast.com/Qetesh)
- Installs: 3,433
- Platforms: macOS
- Categories: System
- Updated: 2026-11-20
- Source: https://github.com/raycast/extensions/tree/e38232e713cc42a58cac81b8d3af9261fd1624e5/extensions/battery-optimizer/

## Commands

- **Battery Optimizer**: Set battery charging limit to prevent overcharging
- **Reset Battery Optimizer**: Allow charging to continue to 100%
- **Get Battery Threshold**: Check the current battery charging limit
- **Battery Status View (batt)**: Detailed view of battery status and charging settings using batt
- **Battery Optimizer Menu Bar**: Show the current battery charging threshold and enable/disable the Battery Optimizer in the menu bar

## README

### Battery Optimizer

Protect battery health by limiting the charging capacity.

This extension supports both `bclm` and `batt` command-line tools to limit battery charging on Mac computers:

- `bclm`: For macOS versions before macOS 15 (Sequoia), using the System Management Controller (SMC)
- `batt`: For macOS 15+ (Sequoia) and newer, using the modern battery control API

The purpose of limiting the battery's max charge is to prolong battery health and to prevent damage to the battery. Various sources show that the optimal charge range for operation of lithium-ion batteries is between 40% and 80%, commonly referred to as the 40-80 rule. This project is especially helpful to people who leave their Macs on the charger all day, every day.

#### Usage
 - `Battery Optimizer` command will limit charging above 80%.
 - `Reset Battery Optimizer` command will allow charging to continue to 100%.
 - `Get Battery Threshold` command will check the current battery charging limit.
   ![battery-optimizer-1.png](https://github.com/raycast/extensions/raw/e38232e713cc42a58cac81b8d3af9261fd1624e5/extensions/battery-optimizer//media/battery-optimizer-1.png)
 - `Battery Optimizer Menu Bar` shows the current battery charging threshold and enable/disable the Battery Optimizer in the menu bar.

#### Preferences
 - Select your preferred battery management tool (BCLM or batt) based on your macOS version
   - For macOS versions before 15.0 (Sequoia), use BCLM
   - For macOS 15.0 (Sequoia) and later, use batt
 - Provide custom paths to the battery tool executables if needed
 - Configure whether battery optimization settings persist through extension's preferences screen
![battery-optimizer-3.png](https://github.com/raycast/extensions/raw/e38232e713cc42a58cac81b8d3af9261fd1624e5/extensions/battery-optimizer//media/battery-optimizer-3.png)

#### Tool-Specific Notes

##### BCLM
- For Apple silicon machines, only the values 80 and 100 are supported and firmware >= 13.0 is required
- For Intel machines, when writing values, macOS charges slightly beyond the set value (~3%)
- When charging while system is shut down or sleeping, the charging can go beyond set value more than average 3%
- Not compatible with macOS 15+ due to removal of the CHWA SMC key

##### batt
- Fully compatible with macOS 15+ (Sequoia)
- Supports limiting charging to any value between 0-100%
- Provides more detailed battery status information

Note that in order to write values, both tools require root/administrator privileges. This is not required for reading values.

#### Installation Requirements

To use this extension, you'll need to install either BCLM or batt based on your macOS version:

- BCLM: `brew install bclm` or visit [https://github.com/zackelia/bclm](https://github.com/zackelia/bclm)
- batt: `brew install batt` or visit [https://github.com/charlie0129/batt](https://github.com/charlie0129/batt) for installation instructions

### Acknowledgments
- [BCLM](https://github.com/zackelia/bclm) - macOS command-line utility to limit max battery charge.
- [batt](https://github.com/charlie0129/batt) - macOS utility for battery limit management.
- [battery-batt-optimizer](https://github.com/VatsalSy/battery-batt-control) - standalone Raycast extension that only supports batt.
