Auto-Sort Mac Downloads by Source: The AutoShelf Way
Your Mac already records which website every download came from. AutoShelf turns that hidden metadata into rules, so each file lands in the right folder the moment it arrives. By the end of this piece you will know how source routing works, how to stack conditions into one precise rule, how to drive it from the terminal or an AI agent, and where it sits against Hazel and the other organizers.
OneTimePay.app
11 min read
Sort by Source URL
Rule active
If Where From contains a known domain, move the file to its folder.
stripe-invoice-0425.pdf
stripe.com
Finance
hero-export@2x.png
figma.com
Design
Xcode_16.2.dmg
developer.apple.com
Installers
q3-metrics.csv
github.com
Dev
Routed by origin, not file type
4 files filed
How do I automatically sort my Mac downloads by the website they came from?
Set a rule in a folder-watching app that reads each file’s saved where-from URL and moves it to a matching folder. macOS stores that URL in the file’s metadata, so a rule like “if source contains github.com, move to Dev” runs on every new download. AutoShelf does exactly this: free for one rule, a one-time $19.99 for unlimited, no subscription.
On this page
How do I automatically sort my Mac downloads by the website they came from?
In short
Set a rule in a folder-watching app that reads each download’s saved source URL and moves the file to a matching folder. macOS stores that URL in the file’s where-from metadata, so a rule like “if source contains github.com, move to Dev” runs automatically on every new download.
The where-from metadata your Mac already records
Every file you download carries a hidden note about where it came from. macOS writes the origin into an extended attribute Apple documents as kMDItemWhereFroms, the same field Spotlight indexes. You can see it yourself: select a download, press ⌘I for Get Info, and the More Info section shows a Where From line. Reading it by hand tells you the origin but automates nothing. That value is what a source rule keys on, which is why sorting by website is possible at all.
One detail matters for writing rules. A downloaded file usually stores two where-from URLs: the direct address of the file on its server, and the web page you clicked the link on. Community reference confirms both entries show up when you inspect the attribute. A well-built rule can match either, so a PDF served from a CDN still files under the site you were actually on when you grabbed it.
Sorting downloads by the website they came from
AutoShelf is a macOS app that watches a folder and moves files based on rules you set, and the download URL is one of the conditions it can read. You point it at ~/Downloads, write a rule that checks the source URL against a domain, and name the destination folder. From then on the app files matching downloads the instant they land, with no drag and no second app to open. The demo above shows the shape of it: four files, four origins, four destinations, decided by where each one came from.
What source-based auto-filing actually does to your Downloads folder
In short
Instead of one giant pile, each file lands where its origin belongs: invoices from your bank site go to Finance, design assets from Figma go to Work, and installers from developer sites go to Installers. The routing decision uses provenance, not just the file extension, so mixed file types still separate cleanly.
Routing by website vs routing by file type
Most auto-sort advice stops at the extension: send every .pdf to Documents, every .dmg to a junk drawer, every image to Pictures. That breaks down the moment two files share a type but belong in different places. A Stripe invoice and a design brief are both PDFs, yet one belongs in Finance and the other in a project folder. Extension rules cannot tell them apart. Source rules can, because they read the origin instead of the file name, so a PDF from your bank and a PDF from a client site take different routes even though macOS sees them as the same kind of file.
The practical effect is a Downloads folder that stops being a graveyard. Files do not accumulate waiting for a manual tidy, because each one is filed at the moment it arrives. You stop losing the invoice you downloaded last Tuesday under forty screenshots, because the invoice never sat in Downloads in the first place.
Where-from metadata in practice
Source routing is only as good as the metadata behind it, and there is one honest limit. The where-from URL is written when a browser downloads a file, so files you copy from another Mac, pull out of a zip archive, or create locally often carry no origin at all. A source-only rule quietly skips those. The fix is to pair the source condition with a fallback, so a file with no origin still gets caught by its type or the app that produced it. AutoShelf lets you stack exactly that kind of fallback, which the next sections build toward.
Sorting by which app downloaded the file, not just the site
In short
A rule can also key off the downloading app: files pulled by Safari go one place, Chrome another, Arc or Finder somewhere else. This helps when you keep work in one browser and personal browsing in another, letting the app that grabbed a file decide its destination automatically.
Why per-app routing beats extension-only rules
AutoShelf can route by which app downloaded a file, distinguishing Safari, Chrome, Arc, and Finder. That is a second provenance signal on top of the source URL, and it maps onto how people actually split their lives across browsers. If your job lives in one browser and everything else in another, the browser itself is a reliable proxy for “work” versus “personal,” and a per-app rule turns that habit into filing you never think about.
It is also the rarer capability. Source URL routing exists in a few organizers, but sorting by the app that did the downloading is uncommon: a MacRumors forum thread on the topic notes that no mainstream download manager advertises sorting by which browser or app fetched a file. That is the gap AutoShelf is built to fill, and it is why per-app routing shows up as its own column when the tools are compared later.
Build a multi-condition rule step by step
In short
Combine conditions so a single rule is precise: the source URL contains a domain, the file type is PDF, the size is over 1 MB, the age is under a day. AutoShelf lets you stack source, download app, type, size, age, and name in one rule, then move, rename, or delete the match.
A worked recipe: file client PDFs by client site
Watch the folder
Point AutoShelf at ~/Downloads. It watches in the background and evaluates every new file against your rules as it arrives.
Match the source
Add a condition: Source URL contains acme-client.com. This is the provenance test that separates this client’s files from everything else.
Narrow it down
Stack more conditions so the rule only fires on what you mean: File type is PDF, and Size is over 1 MB, so a stray favicon or tracking pixel never triggers it.
Choose the action
Set the action to Move to Clients/Acme, and optionally rename on the way in. The file is filed the moment it finishes downloading.
Each condition you add makes the rule stricter, not broader, so one well-built rule can be surgical. Because the same rule can also delete or rename, you can express intentions like “trash any DMG from this site older than a day” without a second pass or a separate tool.
Templates that give you a head start
You do not have to build from an empty rule. AutoShelf ships templates for the common jobs, including a Sort by Source URL template, plus recipes for cleaning Downloads, auto-deleting old DMGs, and tidying the Desktop. A template is a working rule you adjust rather than author, so the first useful sort is a couple of edits away rather than a blank canvas.
Start with one rule, free
Source routing is worth testing before you commit. AutoShelf’s free tier runs one rule, so you can set up a single source-based sort, watch it file real downloads correctly for a week, and only unlock unlimited rules once you know it fits how you work.
Who this fits, and who should look elsewhere
In short
It suits Mac users drowning in Downloads clutter who want deterministic rules, plus developers who script or automate. If you need to sort by what is inside a file, such as an invoice total or the contents of a photo, a content-aware AI organizer serves you better than provenance rules.
When rules win
Rules win whenever the right destination is predictable from where a file came from. The clearest fits:
Anyone whose Downloads folder is a dumping ground and who wants files filed the instant they land, not during a monthly cleanup that never happens.
A freelancer or consultant pulling assets and invoices from a handful of recurring client sites, where the site reliably maps to a project folder.
A developer who wants DMGs, datasets, and repo downloads routed by origin, and who would rather script the whole thing than click through a GUI.
Anyone who splits work and personal across two browsers and wants the browser that grabbed a file to decide where it goes.
When content-aware AI wins
Provenance rules route by source URL and downloading app, not by contents. If your sorting logic depends on what is inside a file, which client an invoice is for based on the total, what a screenshot actually shows, or the subject of a document, a content-aware AI organizer that reads PDF text and runs OCR is the better fit. It is also the honest boundary of a rules engine: AutoShelf is fast and deterministic precisely because it does not try to understand the file, only where it came from. Pick the tool by the job you actually have.
Driving the organizer from the terminal or an AI agent
In short
Power users can skip the GUI. A CLI creates rules, manages watched folders, and triggers actions from the shell, and an MCP server lets a local AI assistant like Claude or Codex read and edit your organization rules in plain language while the watcher keeps running in the background.
Creating and running rules from the shell
AutoShelf ships a CLI, so rules, watched folders, and actions are all reachable from the terminal. That matters for anyone who already lives in a shell: rules can live in version control, ship in a dotfiles repo, and be recreated on a new Mac with a script instead of a click-through. The watcher runs the same way whether you set it up in the GUI or the command line, so the CLI is a full second front end, not a limited afterthought.
Letting an AI agent maintain your rules over time
The newer piece is the MCP server. Model Context Protocol is the standard local AI assistants use to reach real tools, and AutoShelf exposes its rule management through it. In practice that means you can tell an assistant like Claude or Codex “stop filing newsletters into Work” or “add a rule for invoices from this new client,” and it edits the rules for you while the background watcher keeps sorting. Your organization system becomes something you can adjust in plain language, which is a genuinely different way to maintain rules than opening a preferences window every time your filing needs shift.
Watches
Folders, live
Sort by
Source · app · type
Conditions
Source, app, type, size, age, name
Actions
Move · rename · delete
Control
GUI · CLI · MCP
Requires
macOS 13+
How it compares to Hazel, File Arbor, and AI organizers
In short
Against the field, AutoShelf pairs source and per-app routing with CLI and MCP control at a lower one-time price than Hazel, and it offers a free single-rule tier. Hazel is more mature, File Arbor is cross-platform, and AI tools sort by file contents, so pick by the job you need done.
| App | Source URL routing | Per-app routing | CLI + MCP | Free tier | Price |
|---|---|---|---|---|---|
AutoShelf this one rules by origin | $19.99 one-time | ||||
Hazel the mature standard | $42 one-time | ||||
File Arbor cross-platform | $24.99 Pro · free tier | ||||
Sortio AI, by contents | Free + $14.99/mo | ||||
Automator built into macOS | Free |
The honest price picture
On price, AutoShelf comes out ahead of the tools that do the same job. It undercuts Hazel, the category’s mature standard, and adds a free single-rule tier that Hazel does not offer. The bars below line up the rule-based organizers by their one-time cost.
AutoShelf
$19.99
+ free 1-rule tier
File Arbor Pro
$24.99
Hazel
$42
One-time prices for rule-based Mac file organizers, approximate for the rivals. AutoShelf also runs one rule free; simpler one-shot tidiers like Folder Tidy cost less but do not watch folders or route by source.
Being fair means naming where AutoShelf does not win. If you only want a one-shot cleanup, a simpler tool like Folder Tidy costs a few dollars and is plenty, because it does not watch folders or read where files came from at all. Subscription AI organizers such as Sortio sort by what is inside a file, which rules cannot do, at an ongoing monthly cost rather than a single payment. And the free route exists: macOS Automator Folder Actions can auto-sort incoming downloads for nothing, though they are commonly limited to file-type rules and do not read website or downloading-app provenance.
Where each tool is genuinely stronger
Hazel earns its price with a long track record and a deep ecosystem; if maturity is what you value most and $42 with no free tier is fine, it is the safe pick. File Arbor is the answer if you need the same rule engine on Windows or Linux as well as macOS, a place where a Mac-only app cannot follow. AI organizers win the moment your sorting depends on file contents rather than origin. AutoShelf’s own ground is narrower and sharper: it is the tool that routes by source and by the app that downloaded a file, scriptable from a CLI, editable by an AI agent through MCP, at the lowest one-time price of the rule-based group, with one rule free to try first.
Frequently asked questions
Can I control a Mac file organizer from the terminal or let an AI agent manage the rules?
Yes. AutoShelf ships a CLI that creates rules, manages watched folders, and triggers actions from the shell, plus an MCP server that lets a local AI assistant like Claude or Codex read and edit your organization rules in plain language while the background watcher keeps running.
What one-time-purchase Mac file organizer has a free tier for a single rule?
AutoShelf is free for one rule and charges a one-time $19.99 for unlimited rules with no subscription. That single-rule free tier lets you set up one source-based sort, confirm it files downloads correctly, and pay once only if you need more rules.
Does sorting by website work if a file has no where-from data?
No. Routing by source needs the where-from URL macOS saves at download time. Files copied from another Mac, extracted from an archive, or created locally usually lack it, so pair a source rule with fallback conditions like file type or downloading app to catch those cases.
Should I use Hazel instead of AutoShelf?
Consider Hazel if you want the most mature, battle-tested option and do not mind paying $42 one-time with no free tier. AutoShelf undercuts it at $19.99, adds a free single-rule tier, per-app routing, and CLI plus MCP control, but Hazel has the longer track record.
Can any of these sort files by what is inside them, not just where they came from?
Provenance rules route by source URL and downloading app, not contents. If you need files sorted by internal text or image contents, a content-aware AI organizer that reads PDF text and runs OCR is the better fit for that specific job.
Is source-based sorting different from Finder Smart Folders or Folder Actions?
Yes. Smart Folders only display saved searches without moving anything, and Automator Folder Actions typically sort by file type. A dedicated organizer reads the where-from metadata and physically routes each file by the website or app it came from, which those native tools do not do out of the box.
Sources
- 1
Apple Developer: kMDItemWhereFroms metadata attribute
Apple’s own reference for the metadata key macOS uses to store where a downloaded file came from, the value every source rule reads.
- 2
Apple Support: Get info about a file or folder
Shows how to open Get Info and see a file’s Where From line yourself, proving the origin data exists before an app automates on it.
- 3
Apple StackExchange: Finding the URL of a downloaded file
Community reference showing mdls returns two where-from entries, the direct file URL and the page you clicked it from, which affects how source rules match.
AutoShelf
Your Mac, automatically organized.
once
macOS
More apps you buy once: browse the desktop