Back to Glossary
Software

Hazel Rules Examples

Hazel rules examples are sample condition-and-action recipes that describe how files in a watched folder should be renamed, moved, tagged, or archived. Each example pairs matching criteria — such as file kind, name pattern, date, or tag — with one or more actions that run when a file meets those criteria. They are widely referenced as a starting point for anyone building folder automation on macOS.

Looking for a tool?

Sortio does this for you

Describe how you want files organized in plain English. Sortio proposes the moves, you review the plan, then apply. Nothing moves until you approve it, and any sort can be undone.

Works on Mac and Windows
Preview every move before it happens
One-click undo on any sort
Last updated: 8/23/2026
Software

What Hazel Rules Examples means

Hazel is a macOS folder-automation utility, and "Hazel rules examples" refers to the library of sample recipes people share to show what a rule can do. A rule has two halves: conditions that decide whether a file matches, and actions that decide what happens to it. A typical example might read "if the extension is pdf and the name contains invoice, move to Documents/Invoices and rename with the date," or "if the file was added more than 30 days ago and is still in Downloads, move it to an archive folder." Because rules are stored per folder, most setups end up as a stack of rules attached to Downloads, Desktop, and a scanner output folder.

These examples matter because they encode the organizational logic most people carry in their heads. Downloads folders accumulate installers, receipts, screenshots, contracts, and half-finished drafts, and the sorting decisions are usually obvious to a human but tedious to perform by hand. Writing them down as rules turns a recurring chore into something the computer handles in the background.

Studying rule examples is also a good way to learn the vocabulary of file automation generally: match conditions, boolean grouping, pattern tokens for renaming, nested subfolder rules, and ordering. Those concepts carry over to other approaches, including AI-driven tools like Sortio, where the same intent is expressed as a written instruction rather than a set of dropdown menus. Understanding what a rule is trying to accomplish makes it far easier to describe that outcome in any system you choose.

Hazel Rules Examples in practice

Rule-based automation works on a watch-and-evaluate loop. The utility monitors a folder for changes, and when a file appears or is modified, it walks the folder's rule list from top to bottom. The first rule whose conditions all match fires its actions; depending on the configuration, evaluation may stop there or continue down the list. Conditions can inspect the filename, extension, kind, size, creation or modification date, source URL, Finder tag, or Spotlight comment, and some setups can look inside a document's text to match on its contents. Actions then move, copy, rename, tag, sort into a subfolder, run a shell script, or send the file to the trash. Rename actions typically use tokens — a date component, a matched substring, a counter — assembled into a filename pattern.

The practical consequence is that every organizational decision has to be anticipated in advance and expressed as an explicit condition. That works well for high-volume, predictable files: bank statements from one issuer, camera exports, or invoices that always share a naming convention. It works less well for the long tail, where filenames are inconsistent and a single rule can't capture the intent.

Sortio approaches the same problem from the other direction. Instead of building conditions, you write what you want in plain language — for example, "put tax documents from this year into a Taxes folder and group the rest by project" — and Sortio proposes an organization plan you can review before anything moves. You choose whether it sorts by filename and metadata alone or reads file contents, and optional renaming can apply a consistent naming convention at the same time. Content analysis only occurs when you explicitly enable the content sorting toggle. Sortio backs up files before making changes, so a sort can be reverted if the result isn't what you expected.

Where it goes wrong (and how to fix it)

Challenge:

Inconsistent filenames mean a condition that works for one vendor's invoices misses another's entirely, leaving gaps that require constant rule maintenance.

Solution:

Cover the predictable streams with explicit conditions, then hand the remainder to a tool that infers intent. Sortio can sort by content when you enable the content sorting toggle, which helps when the filename alone doesn't identify the document.

Challenge:

Long rule stacks become hard to reason about — a file lands somewhere unexpected and it isn't obvious which rule was responsible.

Solution:

Keep rules few and well-named, and check the activity log when something surprises you. Sortio records what it did to which files, so you can trace an outcome back to the sort that produced it.

Challenge:

Setups built around one platform's automation tool don't carry over when you move between machines or operating systems.

Solution:

Describe your organizational intent in a portable form — written instructions rather than platform-specific condition trees. Sortio runs on macOS 10.14+ and Windows 10/11, so the same prompt-based approach works across both.

Challenge:

Automation that reads document contents raises questions about where that data goes.

Solution:

Check how your tool handles file data. Sortio encrypts metadata in transit using TLS 1.2+ and at rest, and offers an offline mode; offline mode processes files locally on your device without cloud connectivity.

Benefits of Hazel Rules Examples

Turns repetitive filing decisions into background automation you configure once
Keeps high-traffic folders like Downloads and Desktop from accumulating unsorted clutter
Applies consistent naming conventions so files are easier to search and scan later
Documents your organizational logic in a form you can revisit and refine over time
Handles predictable, high-volume file streams — statements, exports, scans — without manual attention
With Sortio, covers the messy long tail that fixed rules miss by describing intent in plain language
Sortio previews the proposed organization and backs files up first, so changes stay reviewable and revertible
Smart Folders in Sortio keep a location organized on an ongoing basis without rebuilding condition lists

Getting Hazel Rules Examples right

1
Start with one folder and two or three rules, then expand once you trust the results
2
Order rules from most specific to most general so narrow matches fire before catch-alls
3
Test new rules against a copy of a folder before pointing them at files you care about
4
Prefer moving files to an archive folder over deleting them until the logic has proven itself
5
Use Sortio's preview to review a proposed organization plan before applying it, and revert if the outcome misses the mark
6
Revisit your setup periodically as the kinds of files you receive change

Putting this into practice with Sortio

You do not need to master hazel rules examples by hand. Sortio reads file names, metadata, and (when you enable the content toggle) document contents, then proposes an organization plan you approve before any file moves. One-click undo covers the rest.

Get Sortio for Mac or Windows

Frequently Asked Questions

What does a basic folder automation rule look like?

Most examples follow the same shape: a condition and an action. A common one is "if the extension is pdf and the name contains statement, move the file to Documents/Statements." Another frequent pattern archives anything in Downloads that hasn't been opened in 30 days. Once you recognize the condition-plus-action structure, nearly every published example becomes easy to adapt to your own folders.

Can I get the same results without writing rules by hand?

Yes. Sortio lets you describe the outcome in plain language instead of building condition lists — for example, asking it to group receipts by year and move project files into folders by client. It proposes a plan you can review before applying. AI-powered sorting learns from your preferences; results may vary by file type and complexity.

Do these automation tools look inside my files?

That depends on the tool and the setting. Filename and metadata matching never opens the file itself. In Sortio, content analysis only occurs when you explicitly enable the content sorting toggle — otherwise it works from filenames and metadata alone. If you prefer nothing to leave your machine, offline mode processes files locally on your device without cloud connectivity.

What happens if a rule moves a file to the wrong place?

With traditional rules, you generally have to find the file and move it back yourself, then adjust the condition that caused the mismatch. Sortio backs up files before making changes, so a sort can be reverted. Its activity log also records what moved where, which makes tracking down an unexpected result more straightforward.

Does Sortio work on Windows as well as macOS?

Sortio supports macOS 10.14 and later, plus Windows 10 and 11. Because organization is described in written instructions rather than platform-specific rule syntax, the same approach transfers between the two. You can also write your instructions in other languages, since Sortio interprets the prompt you provide.

How much does prompt-based file organization cost?

Sortio offers a free trial and paid plans; see the pricing page (/pricing) for current details. Every plan includes an AI allowance, and your usage is shown as a percentage inside the app so you can see where you stand at a glance.

Related Terms