Rules
Explicit [[rules]] in a .sift.toml always win over the active strategy for a matching file.
explicit rule ↓organize strategy ↓built-in behaviorFields
Section titled “Fields”[[rules]]name = "Trash tmp files" # optional — falls back to `pattern` for displaypattern = "*.tmp"action = "Trash" # Move, Trash, or Skipdestination = "Archives" # required for Move, invalid for Trash/Skippriority = 100 # higher runs firstenabled = truedescription = "Trash all .tmp files" # optional, for humans| Field | Required | Notes |
|---|---|---|
pattern |
yes | Glob matched against the filename. |
action |
yes | "Move", "Trash", or "Skip" — any other value is a config error at load time. |
destination |
only for Move |
A relative path beneath the target directory. |
priority |
yes | Integer. Higher runs first; ties keep file order. See Rule Priority. |
enabled |
no (defaults false) |
A rule must be explicitly enabled to ever match. |
name |
no | Display label; falls back to pattern if blank. |
description |
no | Free text, shown in explain/config check output. |
Actions
Section titled “Actions”| Action | Meaning |
|---|---|
Move |
Move to a relative destination beneath the target directory. |
Trash |
Send the matched file to the OS trash when applied. |
Skip |
Explicitly leave the file untouched. |
Destination safety
Section titled “Destination safety”A Move rule’s destination cannot escape the target directory: absolute paths, .., unsafe root components, and symlink escapes are all rejected — both when the config is loaded and again, independently, by the executor immediately before any mutation.
Same-name collisions
Section titled “Same-name collisions”A rule’s Move goes through the exact same collision handling as strategy-based moves (see Safety Model):
- an existing directory, symlink, or broken symlink at the destination always blocks the move outright;
- an existing regular file with byte-identical content makes the source a redundant duplicate — trashed, not moved;
- an existing regular file with different content still gets the source moved, just under a disambiguated name (
"name (1).ext").
Related
Section titled “Related”- Rule Priority — how multiple enabled rules matching the same file are resolved.
- .sift.toml — the full file shape rules live inside.
