mac-smb-automountlisted
Install: claude install-skill soulmachine/skills
# Auto-mount a Mac's SMB shares
Deploys `scripts/mount-smb-shares.sh` behind a LaunchAgent on the **client** Mac so the **server** Mac's shares sit at `/Volumes/<share>` after login and come back by themselves after sleep, network changes and server hiccups. Triggers: login, every 300 s, `/var/run/resolv.conf` changes, and every power-state change (`com.apple.powermanagement.systempowerstate`, the same event Time Machine's helper wakes on) so a wake from sleep remounts within seconds instead of waiting for the interval — which launchd stretches well past 5 min on battery. The script exits at once when the lid is closed, so dark wakes cost nothing. Both Macs signed into the same Apple ID is the normal case, and then no password exists anywhere in the setup.
## Facts every step rests on
- **Mounts happen at login, not boot.** NetFS needs the Aqua session (and, with FileVault, the unlocked login keychain), so the agent lives in `gui/<uid>`. A LaunchDaemon would mount as root, outside the user's namespace. With auto-login on and FileVault off, login follows boot unattended.
- **One hostname.** Address the server by its Tailscale MagicDNS name only. Tailscale takes the direct LAN path at home, so the same name works away with no switching logic.
- **NetFS, not `mount_smbfs`.** `/Volumes` is not user-writable; `osascript -e 'mount volume "smb://…"'` mounts there through the privileged agent and shows in Finder. It blocks **forever** when the server cannot authenticate the client