cd /news/ai-tools/i-built-a-sloth-that-cleans-my-downl… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-153294] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=↑ positive

I built a sloth that cleans my Downloads folder β€” meet slothsort πŸ¦₯

Developer sonawaneutkarsh built slothsort, a Python CLI that sorts messy folders like Downloads into category folders using Gemma running locally through Ollama, with no API keys and no filenames leaving the machine. The tool defaults to a dry-run preview, requires --yes to apply moves, writes a manifest so --undo can revert a run, and falls back to deterministic extension rules when no model is reachable. A demo run sorted 12 files into 9 folders in offline mode, and the project ships with 19 unit tests covering fallback, collision handling, and the apply/undo round-trip.

by read3 min views1 publishedOct 19, 2026

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

slothsort is a small Python CLI that tidies a messy folder for you. Point it at your Downloads directory β€” you know the one, with Q3-budget-final-FINAL.xlsx living next to screenshot 2026-10-19.png and an installer from 2024 β€” and it sorts everything into tidy category folders: Documents, Images, Videos, Audio, Archives, Installers, Code, and friends.

The twist: the sorting decisions are made by Gemma, running locally through Ollama. No accounts, no API keys, no filenames leaving your machine. And because sloths plan for every contingency, there's an honest offline fallback β€” when no model is reachable, deterministic extension rules do the sorting instead of an error message.

Repo: https://github.com/sonawaneutkarsh/slothsort

Here's a real run β€” offline mode, on a folder of 12 genuinely messy files:

$ python3 -m slothsort /tmp/messy-desk --offline
slothsort would move 12 file(s):

  [Archives]
    backup-2024.zip
    font-pack.zip
  [Audio]
    podcast-ep12.mp3
  [Documents]
    meeting-notes.txt
    todo.md
  [Images]
    grandma-recipe-scan.jpg
    screenshot 2026-10-19.png
  [Installers]
    installer-v2.4.1.exe
  [Other]
    app-debug.log
  [Presentations]
    slides-pitch-deck.pptx
  [Spreadsheets]
    Q3-budget-final-FINAL.xlsx
  [Videos]
    vacation-clip.mov

Nothing moved (dry run). Re-run with --yes to apply, or --undo to revert the last run.

That's the whole pitch: one command, zero decisions, twelve files filed. The dry run is the default β€” slothsort shows you the plan and moves nothing until you say --yes. Changed your mind afterward? --undo puts every file back exactly where it was.

With Ollama running (ollama pull gemma3, then drop the --offline flag), filenames the rules don't recognize get classified by the model instead β€” app-debug.log stops landing in Other and gets filed where it actually belongs.

The architecture is deliberately boring, in the good way:

--recursive descends but never re-sorts folders it already created).localhost:11434 β€” Ollama, plain HTTP, stdlib only. Default model is gemma3. The model must reply with --yes. Laziness, but make it safe. a.pdf becomes a (2).pdf, never overwritten), and every run writes a .slothsort-manifest.json so --undo reverses the whole thing. The full test suite (19 tests, python -m unittest discover -s tests) covers the extension bands, model-reply validation, fallback behavior, plan building, collision handling, the apply/undo round-trip, the CLI, and the Ollama HTTP layer with mocks β€” no server needed to verify.

The challenge asked for the lazy payoff, so here are the numbers from the demo above: 12 files β†’ 9 folders, 1 command, 0 decisions made, 0 files deleted, and a one-command undo if I don't like where anything landed. The dreaded "I'll organize Downloads this weekend" task now takes eleven seconds, most of which is reading the preview.

This project only makes sense because the AI is open:

--model llama3.2 and you're done β€” no code changes, no renegotiating with a vendor. The deterministic core (extension rules, preview, collision handling, undo) stays identical no matter which weights you plug in. A closed model could file your PDFs. It couldn't do any of the three things above. That's the whole argument.

A --watch mode that tidies new downloads as they land, content sniffing (so app-debug.log is classified by what's inside it, not its name), and per-folder rules you can teach it once ("always put screenshots in Images/Screenshots"). All doable without touching the core.

Built October 19, 2026 for the Hacktoberfest Week 3 DEV Challenge ("Slow and Steady"). Tags: #devchallenge #hf26challenge

── more in #ai-tools 4 stories Β· sorted by recency
── more on @slothsort 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/i-built-a-sloth-that…] indexed:0 read:3min 2026-10-19 Β· β€”