Skip to content

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 batt is not needed if the built-in range meets your needs. batt remains useful on older releases and when you want a limit below 80%. On macOS 27, batt can set native limits from 10% to 99% when direct SMC control is unavailable.

Batt Logo

Batt

Go Checks Build Test Binary GitHub Downloads

batt is a tool to control battery charging on Apple Silicon MacBooks.

Batt Screenshot

Why do you need this?

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 was 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 here)

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%.

Guides

Installation Compatibility Usage Building

Other

FAQ Comparison

Releases Homebrew GitHub

Features

batt tries to keep things as simple as possible. Charge limiting is the only thing to care about for most users:

  • Limit battery charge with an upper bound, plus a ThinkPad-style lower bound where supported (not in macOS 27 native mode). Docs
  • Charge to the limit or to 100% once, without changing the limit. Docs

However, if you are nerdy and want to dive into the details, it does have some advanced features for power users. These are shown only when the current Mac's SMC keys support them.

  • Control MagSafe LED (if present) according to charge status. Docs
  • Cut power from the wall (even if the adapter is physically plugged in) to use battery power. Docs
  • On firmware < 20xxx, it solves common sleep-related issues when controlling charging. Docs1 Docs2
  • Calibrate battery automatically. Docs

Installation

Note

This is a quick and short overview,

Full Installation Guide

Installing the GUI

Tip

It is highly recommended to disable macOS's optimized charging when using batt.
To do so, open System Settings -> Battery -> Battery Health -> i -> Turn OFF Optimized Battery Charging.
Disable the built-in charge limit when using direct SMC control. In native mode, batt manages that setting itself.

  • Download .dmg file from Releases and open it (right-click open if macOS says it's damaged)
  • Drag batt.app to Applications
  • macOS may say it's damaged when you try to run it. To fix it, run this in your Terminal:
    sudo xattr -r -d com.apple.quarantine /Applications/batt.app.
  • Run batt.app and follow the MenuBar UI to install or upgrade.

Screenshot GUI Setup

Installing the CLI

  brew install batt
  sudo brew services start batt
  curl -fsSL https://github.com/charlie0129/batt/raw/master/hack/install.sh

After installation run the following command to ensure that the installation succeeded:

batt help

Compatibility

Note

This is a quick and short overview,

Full Compatibility Guide

macOS Version GUI CLI (Prebuilt) CLI (Build from Source)
macOS 11 Big Sur ❌ ❌ ⚠️
macOS 12 Monterey ❌ ⚠️ ✅
macOS 13 Ventura ⚠️ ⚠️ ✅
macOS 14 Sonoma ⚠️ ⚠️ ✅
macOS 15 Sequoia ✅ ✅ ✅
macOS 26 Tahoe ✅ ✅ ✅
macOS 27 Golden Gate Beta 1–3 ✅ ✅ ✅
macOS 27 Golden Gate Beta 4+ ✅ ✅ ✅
Other ❓ ❓ ❓
  • ✅ Supported
  • ⚠️ Not verified, but expected to work
  • ❌ Unsupported
  • ❓ Unknown

Special Notes

  • macOS 27 Beta 1–3: Firmware-managed charge limits. Limits remain active during sleep.
  • macOS 27 Beta 4+: Native macOS charge limits from 10% to 99% by default. Upper limit only; macOS may drain the battery toward the limit while plugged in. Opt-in adapter mode adds a lower limit.

Adapter Mode

Enable with:

sudo batt adapter-mode enable
  • Supports charge limits from 10% to 100%.
  • Works only while batt is awake.
  • Disables Force Discharge and auto-calibration.
  • Supports the lower limit, which native mode does not.

For release compatibility, see the release page.

Usage

See the full usage Guide here

Building

Note

This is a quick and short overview,

Full Building Guide

Building the CLI

make

Building the GUI

make app

Architecture

You can think of batt like docker. It has a daemon that runs in the background, and a client (CLI or GUI) that communicates with the daemon. They communicate through unix domain socket as a way of IPC. The daemon does the actual heavy-lifting, and is responsible for controlling battery charging. The client is responsible for sending users' requirements to the daemon.

For example, when you run sudo batt limit 80, the client will send the requirement to the daemon, and the daemon will do its job to keep the charge limit to 80%.

The daemon selects a control backend from usable SMC keys and native services. The legacy backend continuously reads battery percentage and toggles charging itself. The firmware backend writes lower/upper limits and periodically reconciles them while Apple firmware enforces the range, including during sleep. The native backend keeps PowerUIAgent's upper target in sync; opt-in adapter mode toggles wall power. The same capability data is exposed to CLI and GUI clients so unsupported features are not offered.

Motivation

I created this tool simply because I am not satisfied with existing tools 😐.

I have written and used similar utils (to limit charging) on Intel MacBooks for years. Finally I got hands on an Apple Silicon MacBook (yes, 2 years after it was introduced 😅 and I just got my first one). The old BCLM way to limit charging doesn't work anymore. I was looking for a tool to limit charging on M1 MacBooks.

I have tried some alternatives, both closed source and open source, but I kept none of them. Some paid alternatives' licensing options are just too limited 🤔, a bit bloated, require periodic Internet connection (hmm?) and are closed source. It doesn't seem a good option for me. Some open source alternatives just don't handle edge cases well and I encountered issues regularly especially when sleeping (as of Apr 2023).

I want a simple tool that does just one thing, and does it well -- limiting charging, just like the Unix philosophy. It seems I don't have any options but to develop it myself. So I spent a weekend developing an MVP, so here we are! batt is here!

Acknowledgements

Contributors

Batt contributors

Star History

Star History Chart