/adb-ops:free-spacefrom adb-ops
Scans Android phone storage over ADB to identify space usage by apps, caches, downloads, and user files. Suggests deletable items with reasons, lets user pick via feedback form, then deletes only selected items and reports space recovered.
Ships in adb-ops. 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.
Find what is filling the phone, suggest deletions, delete only what the user picks. Nothing is deleted before the user has answered.
Every decision worth repeating is a rule in <workspace>/free-space/rules.json; every run is a
line in <workspace>/free-space/runs.jsonl (<workspace>: scripts/workspace.py, which follows
skills/_shared/workspace.md). When the user says "free up space again" / "rerun free-space":
OUT=$(mktemp -d); D=<skill-dir>/scripts
uv run --no-project python -I $D/storage-scan.py "$OUT" --serial "$S" # prints rule_matches, rule_bytes
uv run --no-project python -I $D/free-space-apply.py "$OUT" --serial "$S" --rules --dry-run
Show the dry-run list and total in one message, get one yes, then run the same command without
--dry-run. Open the form (step 3) only if the user wants to look at what's new; items the
rules cover are tagged "standing rule", keep matches are left out.
rules.json:
{"remove": [{"match": "path:Android/data/org.telegram.messenger/files/Telegram/Telegram Video*",
"reason": "Telegram re-downloads on open", "added": "2026-12-01"}],
"keep": [{"match": "path:Content/*", "reason": "my own media"}]}
match is an fnmatch glob on the item id with /storage/emulated/0/ stripped: path:<rel>,
file:<rel>, app:<package>, cache:all. After a form round, add a rule for each Remove/Keep
that will recur (re-downloadable media, caches, folders the user always keeps); one-offs (an old
model, a single video) stay out. Tell the user which rules you added. Settings changed in an app
to stop the growth go in the run's notes.
adb devices must show the phone as device. If not, use skill wireless-adb or usb-adb.
With more than one device, pass -s <serial> everywhere (below: $S).
OUT=$(mktemp -d)
uv run --no-project python -I <skill-dir>/scripts/storage-scan.py "$OUT" --serial "$S" [--min-mb 100]
(python3 <script> ... works too; stdlib only.) It prints a one-line JSON summary and writes:
report.json: free/total, diskstats categories, every app's APK/data/cache size and last-used
date, folder sizes, files over --min-mb, downloads over 5 MB.items.json: a feedback-panel form, one item per deletable thing, grouped:
App caches (one item: pm trim-caches), App files in shared storage (/sdcard/Android/{data,media}/<pkg>/...),
Folders, Files over N MB, Downloads, Apps (uninstall, third-party only).
Every item carries its delete command in hidden meta._remove.suggestions.json: heuristic picks with reasons: all app caches; folders named cache/thumbnails/tmp;
installers and archives in Download older than 30 days; apps not opened for 90+ days
(Remove); apps with no recorded use (Ask me).How it measures (so you can trust or question the numbers):
| What | Source |
|---|---|
| Free / total, category totals | dumpsys diskstats |
| Per-app APK, data, cache | dumpsys diskstats arrays Package Names / App Sizes / App Data Sizes / Cache Sizes |
| Last used | latest lastTimeUsed per package in dumpsys usagestats (1970 = never) |
| Folder sizes | du -k -d 5 run separately per top-level folder and per Android/<data|media|obb>/<pkg> |
| Large files, downloads | find /storage/emulated/0/ -type f -size +NM -exec stat |
Gotchas found while building this (Android 14, OnePlus Nord 3, 2026-12-01):
/storage/emulated/0/, not /sdcard: /sdcard is a symlink and find /sdcard returns nothing.du over the whole tree stops silently partway through Android/data (permission-denied
folders such as com.sygic.aura/files/offline_maps), so everything after it, including
Android/media, was missing. The script runs du per folder for that reason./sdcard/Android/data|media/<pkg>, so
the same bytes can appear both under the app and under App files. Never add the groups up.pm trim-caches clears every app's cache at once.In chat, give a short summary: free/total, and the 5-10 biggest consumers with a one-line
recommendation each (e.g. "Telegram's auto-downloaded videos, 44.6 GB: delete the folder, Telegram
re-downloads on demand"). Look into anything unfamiliar before recommending it; add your own
judgement to suggestions.json (format {id: "reason"} or {id: {"choice": "ask", "reason": "..."}}),
e.g. folders that are clearly re-downloadable media, or obsolete app versions.
If feedback-panel is on PATH (the feedback plugin), open the form:
feedback-panel new "$OUT/items.json" --template remove-keep-ask --suggest "$OUT/suggestions.json" --name android-free-space
Tell the user the item count and to press Submit, then wait (feedback-panel wait <session>
in the background). Without feedback-panel, show the top candidates as a numbered table and ask
which to remove.
uv run --no-project python -I <skill-dir>/scripts/free-space-apply.py "$OUT" --serial "$S" --feedback <session> [--dry-run]
# or --ids <id> ... for items agreed in chat
It runs each chosen item's meta._remove, writes the form outcomes, and logs the run (free space
before/after, every item) to runs.jsonl. If you run adb yourself in a shell loop, give it
</dev/null: adb shell reads stdin and a while read loop stops after the first item.
pm uninstall --user 0 <pkg>, and append a line to <workspace>/bloatware-log.jsonl as
skill remove-bloatware describes (see skills/_shared/workspace.md).DCIM, Pictures or other personal media, Documents, or a whole
Android/data/<pkg> folder unless the user chose that exact item. A user folder item whose
detail says "excluding the subfolders listed separately" only deletes the files directly in it.Re-read dumpsys diskstats | grep Data-Free and report free space before and after, and the
biggest wins. Some apps (Telegram, podcast players) re-download content automatically: tell the
user which setting to change in the app if that's the cause (e.g. Telegram > Settings > Data and
Storage > Storage Usage > keep media; auto-download). Close the form with feedback done <session>, then update
rules.json (see Quick rerun).
Telegram (tested 2026-12-01, Telegram for Android, via mobile-mcp): Settings > Data and Storage >
Automatic media download has three switches, "When using mobile data", "When connected to Wi-Fi"
and "When roaming"; each shows "Disabled" once off. Media under
Android/data/org.telegram.messenger/files/Telegram/ is safe to delete: chats keep a placeholder
and re-download on tap.
After pm trim-caches, diskstats' "App Cache Size" can keep reporting the old total for a while
(4.9 GB before and after, 2026-12-01): judge it by Data-Free, not that figure.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
15 skills in this plugin
/app-auditExport the full list of apps on an Android phone over ADB (name, version, installer, install date, last used, size, special access such as accessibility, device admin or install-unknown-apps) and find apps not opened in a long time, then let the user pick which to uninstall in a feedback form (Remove / Keep for now / Ask me). Keep and remove answers are remembered, so the next audit only asks about new candidates. Use on "unused apps", "what apps haven't I used", "export my app list", "app inventory", "which apps can I delete"./bloatware-logView, search, and summarise the bloatware operations log at <workspace>/bloatware-log.jsonl. Use when the user asks "what bloatware did I remove", "show my debloat history", "what did I disable on this phone", or wants to audit past package operations before restoring something./complementary-pluginsList and install plugins that complement adb-ops: digital-evidence, tasker-adb. Use on "what goes with this plugin", "related plugins"./device-statusReport the status of Android devices connected via ADB — serial, manufacturer, model, Android version, battery, storage, and whether the device matches the onboarded profile in <workspace>/profile.yaml. Use when the user asks "is my phone connected", "what phone is this", or before any other adb-ops operation to confirm the right device is in scope./import-mediaImport media (photos, videos, voice memos, downloads) from the connected Android device to the local computer using saved mappings from <workspace>/mappings.yaml. Supports "import new since last run" (incremental) or full sync. Use when the user says "import my photos", "pull new videos from my phone", or references a mapping label like "import camera-photos"./onboardFirst-run onboarding for the adb-ops plugin. Interview the user about the Android device connected via ADB — model, Android version, rooted status — then collect folder mappings (phone path to local path, with labels and use cases). Writes profile and mappings to the adb-ops workspace at <workspace>/. Use this before any other adb-ops skill, or whenever the user wants to add a new phone folder mapping.adb-ops@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin adb-ops