{"slug": "i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort", "title": "I built a sloth that cleans my Downloads folder — meet slothsort 🦥", "summary": "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.", "body_md": "*This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 3 — Slow and Steady.*\n\n**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.\n\nThe 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.\n\nRepo: [https://github.com/sonawaneutkarsh/slothsort](https://github.com/sonawaneutkarsh/slothsort)\n\nHere's a real run — offline mode, on a folder of 12 genuinely messy files:\n\n``` bash\n$ python3 -m slothsort /tmp/messy-desk --offline\nslothsort would move 12 file(s):\n\n  [Archives]\n    backup-2024.zip\n    font-pack.zip\n  [Audio]\n    podcast-ep12.mp3\n  [Documents]\n    meeting-notes.txt\n    todo.md\n  [Images]\n    grandma-recipe-scan.jpg\n    screenshot 2026-10-19.png\n  [Installers]\n    installer-v2.4.1.exe\n  [Other]\n    app-debug.log\n  [Presentations]\n    slides-pitch-deck.pptx\n  [Spreadsheets]\n    Q3-budget-final-FINAL.xlsx\n  [Videos]\n    vacation-clip.mov\n\nNothing moved (dry run). Re-run with --yes to apply, or --undo to revert the last run.\n```\n\nThat'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.\n\nWith 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.\n\nThe architecture is deliberately boring, in the good way:\n\n`--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.\nThe 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.\n\nThe 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.\n\nThis project only makes sense *because* the AI is open:\n\n`--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.\nA closed model could file your PDFs. It couldn't do any of the three things above. That's the whole argument.\n\nA `--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.\n\n*Built October 19, 2026 for the Hacktoberfest Week 3 DEV Challenge (\"Slow and Steady\"). Tags: #devchallenge #hf26challenge*", "url": "https://wpnews.pro/news/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort", "canonical_source": "https://dev.to/utkarshsonawane67/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort-4nik", "published_at": "2026-10-19 22:10:01+00:00", "updated_at": "2026-10-19 22:15:00.002037+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "developer-tools", "ai-agents"], "entities": ["slothsort", "Ollama", "Gemma", "sonawaneutkarsh", "Hacktoberfest", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort", "markdown": "https://wpnews.pro/news/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort.md", "text": "https://wpnews.pro/news/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort.txt", "jsonld": "https://wpnews.pro/news/i-built-a-sloth-that-cleans-my-downloads-folder-meet-slothsort.jsonld"}}