Repository navigation
Duplicate File Finder
The Duplicate File Finder finds exact duplicate files within a chosen folder.
A master-detail split view (HSplitView) shows duplicate groups on one side and the files inside a selected group on the other. Select a file and press Space for a Quick Look preview; photo and high-resolution image previews are supported. Long paths are displayed with middle truncation to stay readable.
Duplicate files waste disk space silently. The finder locates them with certainty — only files that hash identically are reported as duplicates.
A staged pipeline avoids hashing every file in full:
- Collect files — walk the folder, skip excluded directories and extensions
- Size filtering — group files by byte size; only groups with 2+ files proceed (files under 50 KB are skipped)
- Header hash — hash the first 4 KB (SHA-256) of each candidate
- Full hash — stream the full content (SHA-256, 64 KB chunks) to confirm exact matches
Hashing runs in Swift actors for race-free parallelism.
System directories, the Library folder, VCS folders (.git, .svn), build artifacts (DerivedData, node_modules, Pods, .build), caches, app bundles, and dataless iCloud items are never scanned. Source code, fonts, databases, and localization files are excluded from results — they are never suggested for deletion. External volumes (/Volumes/...) are scanned only when explicitly selected by the user; volume roots, Time Machine backups, and OS metadata folders (.Spotlight-V100, .Trashes) stay blocked.
After a scan, one strategy can be applied via Smart Select:
| Strategy | Result |
|---|---|
| Keep Oldest Copies (default) | Keeps the oldest file by modification date |
| Keep Newest Copies | Keeps the newest file by modification date |
| Select All | Marks every copy for removal |
| Deselect All | Clears the selection |
You can always override the selection per file before deleting.
Selected files are moved to Trash (trashItem(at:)) by default; permanent removal (removeItem(at:)) is strictly opt-in. Only files inside the scanned folder and outside protected system paths are processed. The trash action requires confirmation.
The search field filters groups by file name or path.
Home · GitHub · Issues · Releases · Discussions
MacOSCleaner
Tools
System
Reference
Project