/battery-doctor:battery-doctorfrom battery-doctor
Find what drains an Android phone's battery, fix it, and show whether it got better. Connects to the phone over USB and investigates its own battery records: what woke it, which apps ran in the background or kept a sensor, Bluetooth scan or location request going, and how fast it drains with the screen off. Applies reversible fixes only after the user confirms each one, and compares each checkup with the last in an HTML report. Use when the user says their phone battery drains fast, dies early, drains overnight or while idle, gets hot, or asks for a battery checkup, a battery health check, what is using their battery, why it drains, or whether a change improved it. Android only; works on macOS, Windows and Linux.
Ships in battery-doctor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Check an Android phone's battery over a USB cable, explain what drains it in plain words, fix what the user agrees to, and show whether it got better on the next checkup.
Everything runs through one script. <skill-dir> is the folder this file is in:
node <skill-dir>/scripts/doctor.mjs <command>
It needs Node 18 or later and nothing else. If node is missing, tell the user to install it from https://nodejs.org and stop.
~/battery-doctor/. You (the assistant) read a summary that includes app names and usage times. Tell the user this in two sentences and continue unless they object.doctor.mjs apply. Never run your own adb commands that write, install, uninstall, disable, clear or reboot. The script allows three reversible actions and refuses the rest.Run status. Act on the line that starts with adb: and the line that starts with phone:.
| Output | What to do |
|---|---|
adb: NOT INSTALLED | Ask: "I need Google's Android connection tool (adb, about 15 MB, from Google's site, under the Android SDK terms). Download it?" On yes, run get-adb. |
phone: NOT FOUND | Run guide. It opens a picture guide in the user's browser that shows how to turn on USB debugging. Then read references/setup-phone.md and walk the user through it, one step at a time. Run status again after each step they finish. |
phone: ... is UNAUTHORIZED | Ask the user to unlock the phone and tap Allow on the "Allow USB debugging?" prompt. If they see no prompt, run guide and point them to its last section. |
phone: READY ... | Go to Step 2. |
If the output has a ## Plan block, read it before anything else. It says what the last session was testing, when the next checkup is due and what is still open. Tell the user in one or two lines and follow it: if the next checkup is due, go to Step 2. If it says the plan is older than the latest checkup, update it (Step 5).
Give the notice from Rule 1, then run check. It takes under a minute, prints a summary, saves the checkup and writes the report.
Read the whole output. If it contains PLAN before this checkup, judge the result against its Testing line first. If it contains CHANGED ON THE PHONE, tell the user what changed and ask whether they did it; each change is already logged and marked in the report, so do not run note for it. If it contains SAME CHARGE PERIOD, tell the user this checkup repeats the last one and when a new one will be useful. If it contains NOT ENOUGH DATA, tell the user why and when to come back: use the phone unplugged for most of a day, do not restart it, and run the checkup before charging. You can still tell them what the short checkup shows, clearly marked as incomplete.
findings.json into the checkup folder printed by check. Format and writing guidance: references/report.md. It carries a one-sentence headline, readable app names, and manual fixes for this phone's brand.report. It rebuilds the report and opens it in the browser. Tell the user where the file is.To interpret the numbers, read references/reading-results.md.
check output, most useful first. For each: what it does, and what it costs the user (the Cost: text). Mark each as "I can do this for you" (auto) or "you do this on the phone" (manual).references/brands.md.auto fix, run apply <action> <target> --yes, using the action and target from its fix id (restrict-background:com.example.app becomes apply restrict-background com.example.app --yes). Report the result line by line. If the output says verified on the phone: NO, say that the change may not have taken.manual fix, give the steps and wait until the user says it is done. Then run note "<what they did>", for example note "Put Maps into deep sleep", so the report marks it on the calendar. Do the same when the user says they changed something on the phone themselves, or reversed it.Details of each action and how to undo: references/fixes.md.
Tell the user: use the phone as usual for a day, keep it unplugged, do not restart it, and come back before charging. When they return, run check again. The output compares the new checkup with the previous one, and the report shows every checkup on a calendar with the changes marked.
Compare fairly. A period that includes a night drains slower than a daytime one. When the comparison has a Same hours of the day figure, give that one as the result and name the hours; otherwise say which kind of period each checkup covers when they differ.
Then write plan.json (format in references/report.md): what the next checkup tests, when and how to take it, what the user still has to decide, what is not explained yet, and which fixes they turned down and why. Run report so the report shows it. Update the plan after every check, and whenever the user decides something or changes the phone by hand.
changes to list them, then undo <id> or undo all. A note of a hand fix cannot be reversed by the script: give the user the steps to reverse it, then run note for the reversal.report.fixes to see what that number is in the latest checkup. If the title differs, the report is older than the latest checkup: say so and go by the fixes list. Confirm that exact change with the user (Rule 2), then follow Step 4.plan.check if the last checkup is older than the last change, otherwise read the comparison from the last check.Read each when you reach it; not all at once.
references/setup-phone.md: turning on USB debugging, computer setup per operating system, connection problems (Step 1)references/report.md: the findings.json and plan.json formats (Steps 3 and 5)references/reading-results.md: what each number means, the thresholds, how far to trust each source (Step 3)references/fixes.md: the three allowed changes, their costs, undo (Step 4)references/brands.md: where battery settings live on each phone brand (Step 4)assets/report-template.html (opens in a new tab)assets/setup-guide.html (opens in a new tab)references/brands.md (opens in a new tab)references/fixes.md (opens in a new tab)references/reading-results.md (opens in a new tab)references/report.md (opens in a new tab)references/setup-phone.md (opens in a new tab)scripts/doctor.mjs (opens in a new tab)scripts/lib/adb.mjs (opens in a new tab)scripts/lib/collect.mjs (opens in a new tab)scripts/lib/compare.mjs (opens in a new tab)scripts/lib/fixes.mjs (opens in a new tab)scripts/lib/parse.mjs (opens in a new tab)scripts/lib/plan.mjs (opens in a new tab)scripts/lib/report.mjs (opens in a new tab)scripts/lib/rules.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub arifszn/battery-doctor --plugin battery-doctor