Drive Auto-Sort — no iCloud, the HDD sorts photos itself
Today it runs quietly every 5 minutes, with no screen, no notifications and nothing to press. Drop photos into Inbox, go do something else, and when you come back they're already in their folders.

Drop photos into a single Inbox folder and the Mac works out which ones are bank transfer slips, which are screenshots and which are cats, using the Vision framework that already ships with macOS. Photos travel from the iPhone to the hard drive at home over Tailscale: no cable, no port opened to the internet, no monthly fee.
The real pain point wasn't the storage fee
The starting brief was “I don't want to pay for iCloud.” But one more question, what am I actually paying for, reshaped the whole problem.
I already had a big enough, fully paid-for hard drive plugged into my Mac, but it was just a place to dump files, not a library where I can find things. What iCloud really sells isn't gigabytes. It's things landing in the right place without me doing anything.
Once the problem was framed this way, the most sensible-looking fix, “just drag the files onto the HDD,” turned out to be worse. It swaps a monthly fee for manual effort paid every time a file comes in.
The real cost is the labor of sorting, not the space
A subscription is paid once per billing cycle. Sorting by hand costs attention every time something arrives, and that's a cost nobody keeps paying for long.
A folder nobody sorts becomes a folder nobody opens
Moving files to the HDD without anything to sort them leaves one pile of thousands of files you can't search. In the end you don't dare delete them and never open them, which is worse than leaving them on the phone.
A file extension tells you it's a photo, not what the photo is
My existing sorter could only send .jpg to Photos and .pdf to Documents. That's enough for documents but not for photos: with thousands of photos in one folder, I still couldn't find last month's slip.
Every existing solution asks you to upload private photos to the cloud
The services that are genuinely good at photo search all run on the provider's servers. Financial slips and photos of home have to leave the machine before you get the convenience back.
Four options weighed honestly before deciding to build it myself
Three criteria: sort photos by what's in them · no ongoing cost · photos never leave the machine
| Option | Sorts by content | Cost | Why it was rejected / chosen |
|---|---|---|---|
| iCloud+ | Searchable, but doesn't organize folders | Monthly, forever | Photos live on Apple's servers · paying still doesn't give a folder structure I can reuse, and it's the very thing the brief wanted to avoid |
| Google Photos | Best search of the group | Monthly once over quota | All financial slips and private photos have to go up to Google's servers, a price I don't want to pay in a different sense |
| NAS + photo app | Yes, with extra plugins | Hardware + upkeep | It stays at home, but means buying a whole new set of hardware to solve a problem my existing HDD and Mac can already handle |
| Extend my existing sorter Chosen | Yes, with Vision built into macOS | None | Photos stay on the HDD I already have · an extension-based sorter already runs, it just needs one more layer that looks at the content |
The Vision framework already ships with macOS. It can classify images into 1,303 categories and read text in 30 languages, Thai included. It runs on the device, with no internet, no API key and no per-call cost. Everything needed was already on the machine; it only had to be wired up correctly.
To really replace iCloud, photos have to get from the phone to the hard drive on their own
However smart the sorter is, it means nothing if I have to plug the iPhone into the computer every time. The piece that makes the whole system a real cloud replacement is this path.
Plug in a cable and transfer every time
This is the old workflow that meant nobody actually did it. If you have to wait until you're home and find a cable, the photos just keep piling up on the phone.
Forward port 445 to the internet on the router
SMB is one of the most heavily scanned ports on the internet. Opening it directly for personal convenience is a bad trade, and it also needs dynamic DNS to keep up when the home IP changes.
Set up my own VPN into the house
The right result, but it means touching router settings, opening ports and managing keys and certificates myself. That's ongoing sysadmin work just to move photos.
A mesh VPN built on WireGuard that lets the iPhone and Mac talk directly over the tailnet's private IP, which stays the same no matter which network either device is on. No port forwarding, no dynamic DNS, not a single line of router config, and nothing exposed to the public internet.
- Port 445 never appears on the public internet — it listens on the tailnet only, which is entirely different from forwarding a port on the router
- Guest access is off — you have to log in with the machine's account; being on the tailnet alone isn't enough
- No
tailscale serveor funnel set up at all — not a single service is exposed outside the tailnet - HDD not plugged in = the share simply disappears — the sorter also exits quietly, as designed, with no errors to chase
Three files, each with a reason to be separate
They're not split to look systematic. macOS limitations forced the split.
wc -l and drive selftestdrive — bash
All the logic lives here · sort sorts files · offload moves things to the HDD and leaves a symlink behind · selftest checks itself before any change
drivesort — C, 8 lines
macOS won't grant Full Disk Access to a shell script, so a real binary is needed to hold the permission. Only this binary gets disk access, instead of granting it to /bin/bash system-wide.
imgclass — Swift
bash can't call system frameworks itself. This does one job: open Vision and print the raw result, either labels for what's in the photo or the text it can read.
How it works — 5 steps
From a file that just landed in Inbox to its destination folder, without anyone pressing anything
imgclass (on-device Vision, offline) — labels sorted from most to least confident, then drive maps them to folder names · Cat photo: Amber Kipp / UnsplashWake every 5 minutes
No real-time folder watching. This job doesn't need second-level speed, and waking on a schedule is cheaper than keeping a process running all the time.
Only pick up files untouched for over 1 minute
Skip recently modified files so a photo the phone is still uploading doesn't get moved half-finished into the wrong place.
First pass by extension
Photos · Videos · Documents · Design — unknown extensions aren't guessed; they stay in Inbox for a person to decide
Only photos go to Vision
Returns labels for what's in the photo, ordered by confidence · only if it looks like a screenshot does OCR run to read the text, since OCR is several times slower
Into a subfolder, or nowhere
Not confident = no guessing. It stays in Photos/ for a person to decide, the same rule as unknown extensions.
The order of the checks decides the result, not the model's accuracy
A photo always gets several labels at once. Which folder it ends up in depends on which question is asked first.
food, so there's no need to list menu items one by one — and it's checked before plants for the same reason as animals: a dish with a leaf garnish is still a food photoPhotos/ for a person to decideFor a black cat standing in front of a shrub, Vision returns animal mammal cat feline together, and because cats are checked before plants, the file lands in Photos/cat, not Photos/plant
Three things I only learned by measuring against real files
Each one was an assumption that sounded reasonable on paper and turned out wrong when measured
I assumed Vision would recognize slips because its list has a label called receipt
Tested on 60 real slips, the receipt label never came back once. 59 of them got document and screenshot, all the same, because real slips aren't paper receipts photographed with a camera. They're screen captures from banking apps, which look exactly like screenshots.
reference code, PromptPay and amount paid. Because OCR is much slower than image classification, it only runs on images already classified as screenshots.The word “fee” pulled stock purchase confirmations in as slips
When I built the list of words that mark a slip, I included the Thai word for fee because transfer slips often have it. Measured against 25 ordinary screenshots, 3 stock purchase confirmations were pulled in as slips because they also contain the word fee.
Among the 1,303 labels are words that look alike but mean different things
Vision's list includes hotdog prairie_dog eggplant cauliflower sunflower_seeds bobcat goldfish jellyfish. With substring matching, a hot dog photo becomes a dog photo, an eggplant becomes a plant, and an aquarium becomes dinner.
Measured against my own files, not a sample dataset
Folders I had already sorted by hand became a free answer key to check results against
drive sort moves everything into subfolders and Inbox is empty — the Finder window shows the actual result on disk| Test set | Count | Result |
|---|---|---|
| Hand-sorted slip folder | 67 photos | 53 as slip · 8 as screenshot · 1 unsorted — opening the 8 misses showed they were chats, TikTok clips and signatures that had actually been mixed into the folder, not slips |
| Hand-sorted screenshot folder | 5 photos | All correct, 5 of 5 |
| Ordinary screenshots outside the drive | 25 photos | None misclassified as a slip |
| Real Inbox, on the real run | 18 files | All 18 files matched the dry run before moving — cat 8 · slip 8 · plant 1 · screenshot 1 |
A sorter that occasionally gets things wrong is tolerable, since you'll find them when you open the folder. A tool that hides things in the wrong place is worse than no tool at all. So one rule held throughout the project: if it's not sure, it doesn't guess.
Scope I deliberately left out
What was cut matters more to the tool's reliability than what was added
- No guessing when unsure — a file staying where it is beats being moved somewhere its owner can't find
- No external services at all — financial slips and private photos shouldn't be uploaded anywhere in exchange for tidy folders
- No sorting logic in Swift — the classifier just prints raw output and the mapping to folder names lives in the script, so adding a category doesn't need a recompile
- A missing HDD isn't treated as a failure — the job ends quietly and tries again next round, with no warning every 5 minutes
- Already-sorted old files are left alone — it only handles new arrivals in Inbox; sorting the backlog is a call the owner should make
