Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 5 min read

DownloadsSloth: a local Gemma tool that tidies messy folders so you don't have to

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady What I Built My Downloads folder is a pile of IMG_20260720_214610.jpg, Screenshot 2025-09-04 at 23.11.13.png and sca

DownloadsSloth: a local Gemma tool that tidies messy folders so you don't have to

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

My Downloads folder is a pile of IMG_20260720_214610.jpg, Screenshot 2025-09-04 at 23.11.13.png and scan0003.pdf. I never sort it, because renaming and filing files by hand is boring and slow.

DownloadsSloth does the boring part. You point it at a folder, and Gemma 3 looks at each file and suggests a clearer name and a folder (Photos, Screenshots, Documents and so on). You see the whole plan, tick what you agree with, edit any name, and press one button. It copies the approved files into a new folder. Nothing is moved, renamed, overwritten or deleted, and there is an Undo button.

It runs entirely on my laptop. My files never leave the computer.

Demo

Screenshots from a real run on a copy of my Downloads folder:

Code

DownloadsSloth

What it is

DownloadsSloth is a local folder organizer that runs on your computer and helps tidy messy folders like Downloads or Desktop. It uses an open-weight local vision-language model (Gemma 3 4B via Ollama) to inspect messy filenames and image contents, proposes clear file names and categorized folders in a review table, and lets you safely copy approved items into an organized output directory with full undo capability.

The problem

Most people have folders packed with hundreds of files named IMG_1234.jpg, Screenshot 2026-03-01 at 10.30.00.png, doc.pdf, scan0003.pdf, and download (2).jpg. Sorting them manually is tedious: you have to open each file, figure out what it is, invent a sensible date and descriptive name, create category folders, and drag files one by one. Because it takes too much time, messy folders stay unsorted.

How it works

  1. Scan: You provide an absolute path toโ€ฆ

Setup: install Ollama, run ollama pull gemma3:4b, then npm install and npm start, and open http://127.0.0.1:3000.

The Lazy Payoff

What I measured, on a test folder of 44 files (images, PDFs, documents and spreadsheets copied from my own Downloads):

  • Gemma produced suggestions for all 44 files in 141 seconds, unattended.
  • After that, applying the approved changes took under a second for a batch.

What I did not measure: how long the same folder takes to sort by hand. I didn't time a manual run, so I won't claim a number. The saving is the typing and the opening of every file, and I can't say how big it is for you.

How I Built It

  • Model: Gemma 3 4B through Ollama. For images it sees a small preview; for PDFs, documents and spreadsheets it uses only the file name, type and date, because the tool does not read their contents.
  • Server: Node.js and Express, bound to 127.0.0.1 only. A background job processes files one at a time, with a progress bar and a Cancel button.
  • Structured output: Gemma returns JSON (new name, folder, reason, confidence), validated and retried once.
  • Built in stages: health check, read-only scan, suggestions, then apply and undo, testing each stage on a copy of my files before the next.

Safety Is Enforced in Code, Not Just the Prompt

A tool that touches your files has to be boring and careful, so these rules are in code:

  • The scan is read-only, only works inside my home folder, and refuses system folders, ~/Library and hidden folders. I tested /, /etc, ~/.ssh, a relative path, and a ../../.. escape, and all were refused.
  • The server re-scans the folder itself and never trusts file names sent from the browser. A path-traversal attempt (../../etc/passwd) is skipped as "not found".
  • Apply only copies into a new output folder, never overwrites (a repeated name becomes -2), checks the size of every copy, and refuses an output folder that is the source or inside it.
  • Undo removes only the copies the tool made, and only if their size still matches its log.
  • The model never picks the extension or the final folder. Code keeps the original extension, cleans the name, and forces the folder to a fixed list.
  • Low-confidence rows are unchecked by default.

What Went Wrong, and How I Fixed It

  • Everything came back "High" confidence, even PDFs the tool had judged only by name. I capped confidence in code: non-images are never above "medium".
  • It renamed files that were already clearly named. Now only meaningless names (IMG_..., Screenshot ..., scan0003, WhatsApp Image ...) are renamed. Clear names are kept and marked "kept".
  • Wrong dates: a file from the evening of Oct 18 was labelled Oct 17, because the date came from UTC. It now uses the date in the file name, or the local date.
  • Screenshots were called "portrait". They now go to a Screenshots folder.
  • doc.pdf became 2025-12-07-pdf.pdf. When the tool can't read a file's content, it now keeps the name and sends the file to Review instead of inventing one.

Why Does Open Innovation Matter?

  1. Privacy. These are the files people don't want to upload: bills, screenshots, rรฉsumรฉs and photos. A hosted model would receive every one of them.
  2. Cost. There is no per-file fee, so you can run it on a folder with thousands of files.
  3. Control. I could wrap the model in checks and swap it later. Several of the fixes above exist because the 4B model ignored rules written in the prompt, so I enforced them in code.

What It Does Not Do

  • The suggestions are guesses. A human reviews every change before anything is copied. One image was labelled "gangsters" with high confidence from the clothing in a still, which is not something a photo can prove.
  • Documents are judged by name only. The tool does not read the inside of PDFs, documents or spreadsheets.
  • It describes a picture, but doesn't know who is in it. I told it not to name people or characters.
  • Image analysis is macOS only, because the preview uses the built-in sips tool.
  • Small rough edges: an apply that copies zero files still creates an empty output folder, and characters like % in a name are turned into -.
  • I did not time a manual run, I have no first user yet, and I have not tested it on Windows or Linux.

AI Disclosure

I used Antigravity to help write the code, and a Claude assistant helped me plan the build, test it and write this post. The app itself runs on Gemma locally.

Prize Categories

Best Use of Gemma: Gemma 3 4B suggests names and folders from image previews and file names, entirely on the user's own computer.


๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.