DeclutterMe

DeclutterMe

A desktop app that sorts a messy folder into categorised subfolders in one click, with a watcher for auto-sorting and a 10-level undo.

Role
Solo developer
Year
2026
Stack
Electron.js · Node.js · JavaScript
DeclutterMe interface

Desktop folders decay the same way for everyone: downloads, screenshots and installers pile up until sorting them is a twenty-minute chore nobody starts. Most tools that fix this ask you to configure rules first, which is the same chore moved earlier. DeclutterMe ships with working defaults — over 100 extensions across 10 categories — so the first run needs no setup.

You pick a folder, press one button, and files are moved into category subfolders. Optional auto-mode runs a chokidar watcher that sorts new arrivals in the background, and everything is reversible through a 10-batch undo stack. Custom rules, per-category folder renaming and extension exclusions are all available but never required. It is an Electron app whose entire runtime dependency list is a single package, chokidar, with all filesystem work done through Node built-ins.

The interesting problem was making a background watcher safe. Naively sorting on every filesystem event moves files that are still being written — a half-downloaded archive gets filed and the download breaks. The watcher waits for writes to settle, then debounces further, so a batch of files is handled once, after all of them have finished landing.

Engineering notes

A watcher that waits for writes to finish

Chokidar awaitWriteFinish with a 2s stability threshold plus a 5s debounce means in-progress downloads are never moved mid-write, and a burst of files triggers one organize pass rather than one per file. Depth is pinned to 0 so it only ever touches the top level of the chosen folder.

Undo as a stack, and a dry run before that

Every organize pass pushes its move list onto a 10-deep stack, and undoing replays the batch in reverse using the recorded source paths. A dryRun flag runs the identical resolution logic while skipping the moves, so the preview cannot disagree with what actually happens.

Resolving Windows shortcuts to sort by what they point at

Shortcut files all share one extension, so extension matching would dump every shortcut in one folder. The app resolves each shortcut real target through the Windows scripting host and matches that path against known game launcher directories, splitting Games from Applications, with a platform guard so non-Windows builds skip it.

Renderer locked down

Node integration is disabled and context isolation enabled, with the renderer reaching the filesystem only through a contextBridge surface of named IPC calls. The UI cannot touch the filesystem directly even though the whole app is about moving files.

Built with

Electron.jsNode.jsJavaScriptChokidarDesktop AppAutomation