Your laptop, onaround the clock.

BatteryGuard protects your battery from wear by holding it between 50 and 80% charge.

Download for Mac

Free · Version 1.0.2 · 3.5 MBApple silicon · macOS 13 or later

Install from Terminal

What always on does to the battery

  1. To stay on around the clock, a MacBook never leaves its charger. The battery sits at 100% for weeks.

  2. Lithium batteries kept full and warm lose capacity faster.

  3. With a limit, charging stops lower. The Mac stays on, running on its adapter.

What always on does to the battery

To stay on around the clock, a MacBook never leaves its charger. The battery sits at 100% for weeks.

Lithium batteries kept full and warm lose capacity faster.

With a limit, charging stops lower. The Mac stays on, running on its adapter.

Try it yourself.

This is the panel you open from the menu bar. Drag the marker on the battery anywhere from 50 to 80%, in steps of 5.

Charging

Stops at 60%. Resumes at 58%.

In the demo these buttons do nothing.

Drag the marker or use the arrow keys

From 50 to 80%. Drag the marker or use the arrow keys to change it.

A MacBook is a good machine to leave on at home. It's quiet and draws little power. It also has a battery of its own, for a power cut or for the day you take it with you.

That battery just shouldn't sit at 100% for months.

Everything else stays the same. What you leave running keeps running.

The chemistry, in short.

A lithium battery ages with every cycle, as you use it. It also ages with time, even when it sits still. A Mac that's always plugged in does very few cycles. What counts is time, and the charge level it spends that time at.

More charge, higher voltage

The fuller a lithium cell, the higher its voltage. At a high charge, a film on the graphite anode (the SEI layer) grows faster and uses up lithium. Above 4.1 volts per cell, in the heat, the electrolyte also oxidises at the cathode. These reactions are slow, and they carry on even when the Mac isn't drawing on the battery.

What the battery loses

Capacity, which means less runtime once you unplug. And its internal resistance goes up, so it handles peak demand less well. Neither comes back.

One year in storage

Battery University estimates how much capacity a lithium cell can recover after a year in storage. At 25 °C, a cell kept at 40% keeps 96%; kept at 100%, it keeps 80%. In the heat the gap gets wider.

Why 50 to 80

Less charge means less voltage and less stress on the cell. But on the day you unplug, you want some runtime left. 50% is the level Apple recommends for storing a battery long term, partly because one left empty risks a deep discharge. 80% is the lowest setting of the Charge Limit Apple added in macOS 26.4, and Apple too tries to cut the time a Mac spends fully charged. In between, you pick.

Capacity left after one year in storage

Laboratory estimates on generic lithium cells (Battery University, BU-808, table 3). Not a forecast for your Mac.

Estimated cycles by end-of-charge voltage
Charged toCyclesStored energy
4.20 V300-500100%
4.06 V600-1,00081%
3.92 V1,200-2,00065%

Estimates for generic cells (Battery University, BU-808, table 4). Cells with higher charge voltages may differ.

For the Mac that never switches off.

  • agent running · 03:12

    Your agents, on at home

    Claude Code and similar tools need a computer that stays on. If yours is a MacBook, leave them running and the battery holds at your limit.

  • Up 41 days

    A home server

    An old MacBook makes a quiet server for backups and automations. If it stays plugged in for years, it needs a limit.

  • External display connected

    Desk with an external display

    Lid closed, monitor on, cable always in. Plenty of MacBooks spend every working day like this.

  • Exporting · 62%

    Long renders and exports

    Hours of rendering heat the Mac up. Heat and a full charge together are the worst case for a battery.

  • Mon to Fri · 9 to 6

    The office Mac

    Same desk, same charger, every working day. Set the limit once and forget about it.

Three steps. One is macOS asking.

BatteryGuard isn't signed with an Apple Developer ID, so macOS stops it the first time. You allow it once and it doesn't ask again.

  1. Drag to Applications

    Open the disk image and drag BatteryGuard into the Applications folder.

  2. Open Anyway

    Go to System Settings > Privacy & Security and click Open Anyway at the bottom. Then confirm with Open. It may ask twice, for the disk image and for the app.

  3. Turn on the limit

    Open BatteryGuard from the menu bar and click Turn on charge limit. Your administrator password installs the background service, once.

Or install from Terminal

The script downloads BatteryGuard, checks its SHA256 and copies it to Applications. macOS doesn't block files downloaded from Terminal, so you skip step 2.

curl -fsSL https://github.com/alessiocardelli/batteryguard/releases/latest/download/install.sh | bash

Every line is public.

The background service has one job. Every five seconds it reads the battery level and switches charging off or on through the Mac's power controller. It makes no network connections. Turn off the limit and it removes itself, with charging back to normal.

Read the code on GitHubMIT licence

batteryguard-helper/main.swift

Questions

Install it in three steps.

The download has started on its own. Then two more steps.

  1. Download

    Downloading BatteryGuard-1.0.2.dmg

    Download didn't start? Download it here

  2. Open it and allow it

    Open the disk image and drag BatteryGuard into Applications. When macOS blocks it, go to System Settings > Privacy & Security and click Open Anyway. It may ask twice, for the disk image and for the app.

  3. Turn on the limit from the menu bar

    Click the BatteryGuard icon in the menu bar, then Turn on charge limit. Your administrator password is needed once.