jackson2w/claude-code-skills / macos-pre-erase-audit
macos-pre-erase-audit
VerifiedThis skill should be used before a Mac is erased, traded in, sold or handed down, to check over SSH what would be lost — whether iCloud Drive (incl. Desktop & Documents), iCloud Photos, Messages in iCloud, Notes and Voice Memos are fully synced, and what lives only locally (Trash, Downloads, app data, keys, credentials). Also covers the fleet cleanup after. Trigger phrases include "trade in my mac", "erase my mac", "before I wipe", "anything I should back up", "sell my mac mini", "is everything in icloud", "photos not uploaded", "decommission a mac".
Pre-erase audit of a Mac (read-only, over SSH)
Done 2026-11-11 on Will's M1 Mac mini (macOS 27.2) before trade-in. All reads; no osascript (it pops
an Automation prompt on the Mac's screen and hangs). Remote shell may be zsh: use /usr/bin/log.
- Space map:
df -h /System/Volumes/Data;du -sh ~/* ~/.[!.]* | sort -h, then drill into the big ones (~/Library/{Application Support,Containers,Group Containers,Messages,Photos}). - iCloud Drive:
brctl status→ "caught-up", last-sync time, andDesktop & Documents: current=YES.xattr ~/Desktopshowscom.apple.icloud.desktopwhen synced. Downloads is NOT part of Desktop & Documents. - Photos: read-only
sqlite3 "file:$LIB/database/Photos.sqlite?mode=ro":select ZCLOUDLOCALSTATE, ZSAVEDASSETTYPE, count(*) from ZASSET where ZTRASHEDSTATE=0 group by 1,2. State 1 = uploaded. Un-uploaded rows with ZSAVEDASSETTYPE 12 imported bycom.apple.MobileSMS(ZADDITIONALASSETATTRIBUTES.ZIMPORTEDBYBUNDLEIDENTIFIER) are Messages "Shared with You" items: covered by Messages, not lost. - Messages:
defaults read com.apple.madrid | grep CloudKit→CloudKitSyncingEnabled = 1and a recentCloudKitSyncDate. - Notes:
NoteStore.sqlite(group.com.apple.notes):select ZACCOUNTTYPE, ZNAME from ZICCLOUDSYNCINGOBJECT where ZACCOUNTTYPE is not null→ only iCloud means no "On My Mac" notes. - Voice Memos: count
.m4aingroup.com.apple.VoiceMemos.shared/Recordingsvs rows inCloudRecordings.db(ZCLOUDRECORDING); have the user spot-check the oldest on the phone. - Mail: no
~/Library/Mail/V10/Mailboxes= no local mailboxes. - Local-only leftovers to show the user:
~/.Trash(names only),~/Downloads,~/.ssh(private keys?), app configs like Raycast (~/.config/raycast; export in-app), credential files (compare a hash with the vault copy, never print:tr -d '\n' < f | shasum -a 256 | cut -c1-12). - Before erase (user): sign out of iCloud (Find My / Activation Lock), unlink Signal/WhatsApp/ Dropbox, unpair Bluetooth, then Erase All Content and Settings (FileVault on = crypto erase).
- Fleet cleanup after: Pi-hole records (
pihole-dns-hosts.yml, LAN + tailnet IP), Tailscale device (tailscale-devices.sh delete <id> --yes), UniFi:cmd/stamgr {"cmd":"forget-sta","macs":[…]}for EVERY record of the machine (wired, Wi-Fi, old private-MAC entries: searchrest/userby name/hostname). UniFi re-creates a bare record for a recently seen MAC at once: harmless, no reservation. Then grep repos for the hostname/IPs and update memory.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |