[!TIP] Feb 17, 2026 UPDATE: Finally, after more than 5 years, macOS 26.4 and later supports charge limiting natively (adjustable from 80% to 100%), so
battis not needed if you are using macOS 26.4 or later. However,battwon't go anywhere so if you are on an older version of macOS or you want to set a charge limit lower than 80%, you can still usebatt.
Note: Use table of contents of quickly navigate to the section you want, e.g., Installation. 👆↗
batt is a tool to control battery charging on Apple Silicon MacBooks.
This article might be helpful. TL;DR: keep your battery at 80% or lower when plugged in, and discharge it as shallowly as feasible.
Previously, before optimized battery charging is introduced, MacBooks are known to suffer from battery swelling when they are kept at 100% all the time, especially the 2015s. Even with optimized battery charging, the effect is not optimal (described below).
batt can effectively alleviate this problem by limiting the battery charge level. It can be used to set a maximum charge level. For example, you can set it to 80%, and it will stop charging when the battery reaches 80%. Once it reaches the predefined level, your computer will use power from the wall only, leaving no strain on your battery.
Quick link to installation guide.
batt tried to keep as simple as possible. Charging limiting is the only thing to care about for most users:
However, if you are nerdy and want to dive into the details, it does have some advanced features for the computer nerds out there :)
It is free and opensource. It even comes with some features (like idle sleep preventions and pre-sleep stop charging) that are only available in paid counterparts. It comes with no ads, no tracking, no telemetry, no analytics, no bullshit. It is open source, so you can read the code and verify that it does what it says it does.
It is simple but well-thought. It only does charge limiting and does it well. For example, when using other free/unpaid tools, your MacBook will sometimes charge to 100% during sleep even if you set the limit to, like, 60%. batt have taken these edge cases into consideration and will behave as intended (in case you do encounter problems, please raise an issue so that we can solve it). Other features is intentionally limited to keep it simple. If you want some additional features, feel free to raise an issue, then we can discuss.
It is light-weight. No electron GUIs hogging your system resources like some other tools. You can use batt on the command-line, or use the native macOS menubar app if you prefer a GUI. The GUI is written using native macOS APIs, so it is light-weight and fast.
Yes, macOS have optimized battery charging. It will try to find out your charging and working schedule and prohibits charging above 80% for a couple of hours overnight. However, if you have an un-regular schedule, this will simply not work. Also, you lose predictability (which I value a lot) about your computer's behavior, i.e., by letting macOS decide for you, you, the one who knows your schedule the best, cannot control when to charge or when not to charge.
batt can make sure your computer does exactly what you want. You can set a maximum charge level, and it will stop charging when the battery reaches that level. Therefore, it is recommended to disable macOS's optimized charging when using batt.
| Firmware Version | GUI | CLI (Prebuilt) | CLI (Build from Source) |
|---|---|---|---|
6723.x.x |
❌ | ❌ | ⚠️ |
7429.x.x / 7459.x.x |
❌ | ⚠️ | ✅ |
8419.x.x / 8422.x.x |
⚠️ | ⚠️ | ✅ |
10151.x.x |
⚠️ | ⚠️ | ✅ |
11881.x.x |
✅ | ✅ | ✅ |
13822.x.x |
✅ | ✅ | ✅ |
| Other | ❓ | ❓ | ❓ |
[!NOTE] Firmware version is different from macOS version. You can check your firmware version by running
system_profiler SPHardwareDataType | grep -i firmwarein Terminal.
If you want to know which MacBooks I personally developed it on, I am using it on all my personal MacBooks every single day, including MacBook Air M1 2020 (A2337), MacBook Air M2 2022 (A2681), MacBook Pro 14' M1 Pro 2021 (A2442), MacBook Pro 16' M1 Max 2021 (A2485).
If you encounter any incompatibility, please raise an issue with your MacBook model and macOS version.
GUI version is a native macOS menubar app. It's not as feature-complete as the command-line version, but it is a good choice if you are not comfortable with the command-line. The command-line version is also included if you have the GUI version.
.dmg file from Releases and open it (right-click open if macOS says it's damaged)batt.app to Applicationssudo xattr -r -d com.apple.quarantine /Applications/batt.app.batt.app.batt. To do so, open System Settings -> Battery -> Battery Health -> i -> Turn OFF Optimized Battery Charging
[!TIP] There are 3rd-party GUI versions built around
battby some amazing opensource developers: 1. BattGUI by @clzoc
[!NOTE] Command-Line version is already included if you have installed the GUI version. You can run
battin Terminal to use it.
You have two choices to install the CLI version of batt:
You can choose either one. Please do not use both at the same time to avoid conflicts.
brew install battsudo brew services start battThank you, @Jerry1144, for bootstrapping the Homebrew formula.
bash <(curl -fsSL https://github.com/charlie0129/batt/raw/master/hack/install.sh). You may need to provide your login password (to control charging). This will download and install the latest stable version for you. Follow the on-screen instructions, then you can skip to step 5.Manual installation steps
chmod +x batt after extracting the archive) or build it yourself .$PATH, e.g., /usr/local/bin, so you can directly call batt on the command-line. In this case, the binary location will be /usr/local/bin/batt.Install daemon using sudo batt install. If you do not want to use sudo every time after installation, add the --allow-non-root-access flag: sudo batt install --allow-non-root-access. To uninstall: please refer to How to uninstall?
In case you have GateKeeper turned on, you will see something like "batt is can't be opened because it was not downloaded from the App Store" or "batt cannot be opened because the developer cannot be verified". If you don't see it, you can skip this step. To solve this, you can either 1. (recommended) Go to System Settings -> Privacy & Security --scroll-down--> Security -> Open Anyway; or 2. run sudo spctl --master-disable to disable GateKeeper entirely.
sudo batt status. If you see your battery status, you are good to go!batt will set a charge limit to 60%. For example, to set the charge limit to 80%, run sudo batt limit 80.batt. To do so, open System Settings -> Battery -> Battery Health -> i -> Turn OFF Optimized Battery Chargingbatt help to see all available commands. To see help for a specific command, run batt help <command>.batt disable or batt limit 100.Finally, if you find
batthelpful, stars ⭐️ are much appreciated!
Make sure your computer doesn't charge beyond what you said.
Setting the limit to 10-99 will enable the battery charge limit, limiting the maximum charge to somewhere around your setting. However, setting the limit to 100 will disable the battery charge limit.
By default, batt will set a 60% charge limit.
To customize charge limit, see batt limit. For example,to set the limit to 80%, run batt limit 80. To disable the limit, run batt disable or batt limit 100.
[!NOTE] This feature is CLI-only and is not available in the GUI version.
Cut or restore power from the wall. This has the same effect as unplugging/plugging the power adapter, even if the adapter is physically plugged in.
This is useful when you want to use your battery to lower the battery charge, but you don't want to unplug the power adapter.
NOTE: if you are using Clamshell mode (using a Mac laptop with an external monitor and the lid closed), cutting power will cause your Mac to go to sleep. This is a limitation of macOS. There are ways to prevent this, but it is not recommended for most users.
To enable/disable power adapter, see batt adapter. For example, to disable the power adapter, run sudo batt adapter disable. To enable the power adapter, run sudo batt adapter enable.
[!NOTE] This feature is CLI-only and is not available in the GUI version.
Check the current config, battery info, and charging status.
To do so, run sudo batt status.
These advanced features are not for most users. Using the default setting for these options should work the best.
Thanks @brookqin for implementing the initial version of this feature.
Automatically performs a full charging cycle to help calibrate reported battery percentage.
Phases: Idle → DischargeToThreshold → ChargeToFull → HoldAfterFull → DischargeAfterHold → RestoreAndFinish → Idle.
Flow: 1. Discharge below configured threshold (defaults to 15%). Charging is forced off. 2. Charge to 100%. Upper limit temporarily set to 100. 3. Hold at 100% for the configured duration (defaults to 120 minutes unless changed). 4. After hold, charging is disabled again and the battery is allowed to naturally discharge back down to the original upper limit snapshot. 5. Restore original upper/lower limits and adapter/charging states and return to Idle.
You can start, pause, resume, cancel via the GUI (Advanced → Auto Calibration) or CLI (batt calibration start|pause|resume|cancel|status) or HTTP API. Can