SkillAgentSearch skills...

Batt

Control and limit battery charging on Apple Silicon MacBooks.

Install / Use

/learn @charlie0129/Batt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

[!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 batt is not needed if you are using macOS 26.4 or later. However, batt won'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 use batt.

Note: Use table of contents of quickly navigate to the section you want, e.g., Installation. 👆↗

batt

Go ChecksBuind Test BinaryGitHub Downloads

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

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

Features

batt tried to keep as simple as possible. Charging limiting is the only thing to care about for most users:

  • Limit battery charge, with a lower and upper bound, like ThinkPads. Docs

However, if you are nerdy and want to dive into the details, it does have some advanced features for the computer nerds out there :)

  • 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
  • It solves common sleep-related issues when controlling charging. Docs1 Docs2
  • Calibrate battery automatically. Docs

How is it different from XXX?

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.

But macOS have similar features built-in, is it?

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.

Compatibility Matrix

| 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 | ❓ | ❓ | ❓ |

  • ❌: Unsupported
  • ✅: Supported
  • ⚠️: Not verified, but expected to work.
  • ❓: Unknown, please raise an issue if you have tested it.

[!NOTE] Firmware version is different from macOS version. You can check your firmware version by running system_profiler SPHardwareDataType | grep -i firmware in 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.

Installation (GUI 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.

  1. Download .dmg file from Releases and open it (right-click open if macOS says it's damaged)
  2. Drag batt.app to Applications
  3. macOS may say it's damaged when you try to run it (it's NOT) and wants you to move it to trash. To fix it, run this in Terminal: sudo xattr -r -d com.apple.quarantine /Applications/batt.app.
  4. Run batt.app.
  5. Follow the MenuBar UI to install or upgrade.
  6. 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. Built-in charge limit also need to be disabled if you are on macOS 26.4 or later.
<img width="191" alt="SCR-20250624-lbmb-3" src="https://github.com/user-attachments/assets/4bef52d7-8483-49bd-b579-736b87c81a52" /> <img width="206" alt="SCR-20250624-lbmb-2" src="https://github.com/user-attachments/assets/f3731a00-d973-4d67-8b4a-d57595e3842f" /> <img width="450" alt="SCR-20250624-lbmb-4" src="https://github.com/user-attachments/assets/a9d3c2eb-5d41-400e-b042-b79f6e8decd0" />

[!TIP] There are 3rd-party GUI versions built around batt by some amazing opensource developers:

  1. BattGUI by @clzoc
  2. batt-helper by @zxw5775

Installation (Command-Line Version)

[!NOTE] Command-Line version is already included if you have installed the GUI version. You can run batt in Terminal to use it.

You have two choices to install the CLI version of batt:

  1. Homebrew (If you prefer a package manager) Docs
  2. Installation Script (Recommended) Docs

You can choose either one. Please do not use both at the same time to avoid conflicts.

Homebrew

  1. brew install batt
  2. sudo brew services start batt
  3. Please read Notes.

Thank you, @Jerry1144, for bootstrapping the Homebrew formula.

Installation Script

  1. (Optional) There is an installation script to help you quickly install batt (Internet connection required). Put this in your terminal: 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.
<details> <summary>Manual installation steps</summary>
  1. Get the binary. For stable and beta releases, you can find the download link in the release page. If you want development versions with the latest features and bug fixes, you can download prebuilt binaries from GitHub Actions (has a retention period of 3 months and you need to chmod +x batt after extracting the archive) or build it yourself .
  2. Put the binary somewhere safe. You don't want to move it after installation :). It is recommended to save it in your $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.
  3. 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?](#h
View on GitHub
GitHub Stars1.6k
CategoryDevelopment
Updated12h ago
Forks63

Languages

Go

Security Score

100/100

Audited on Apr 1, 2026

No findings