What they did
After moving to a new Samsung foldable and restoring all his apps from an older phone, Malik saw the battery last less than it should. He suspected the hundreds of restored apps. He turned on USB debugging, plugged the phone into his PC and asked Claude Code to pull battery history over ADB, find the real drain and fix it. The agent dumped about 60 MB of diagnostics (batterystats, usage stats, network stats, alarms, jobs, Bluetooth, telephony and Samsung's daily battery tables) to files and parsed them with small scripts rather than reading them whole. It normalised CPU time per process, checked who held the microphone and wakelocks, measured Bluetooth scanning per app and compared unused apps against Android's standby buckets. The ground rules were read-only first, record every original value, and ask before deleting anything or touching SIMs, health tracking or accounts. Fixes were ADB settings changes, background and mobile-data restrictions, Samsung Routines and a Tasker profile that pauses the work profile outside office hours.
How it went
The baseline was about 103% of a charge per day, with 2.5% an hour lost while the screen was off. The bloat theory was mostly wrong: 222 of 315 apps were unused, but Android had already parked 202 of them. The real drains were a car-key app's Bluetooth service stuck in a loop at about 50 CPU-minutes a day, Samsung Health's snore detection holding the mic in the afternoon, constant Bluetooth scanning, a permanently roaming second SIM, cloned app profiles and about 10 GB of swap. Turning off RAM Plus cut swap to 4 GB and a photo cleanup freed 18 GB. He gives no re-measured battery figure after the fixes.
Worth knowing
Several fixes are Samsung-only, and some need care: the network-mode picker mislabelled its options, so he checked over ADB, and switching a SIM off can make bank OTP texts expire. adb install puts an app into every profile unless you pass --user 0. Only one agent should drive the screen at a time.