SlothSort π¦₯ β An Offline AI File Organizer That Rewards Laziness
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady What I Built Most developers have a Downloads folder that looks like a digital landfill: dozens of document(1).pdf , Screenshot 2026-10-21.png , and camera uploads like IMG_20241019_142356.jpg . Organizing t

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission π¦₯
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
Most developers have a Downloads folder that looks like a digital landfill: dozens of document(1).pdf, Screenshot 2026-10-21.png, and camera uploads like IMG_20241019_142356.jpg.
Organizing them manually is tedious, and simple extension-moving scripts fail because they can't understand what a file actually contains.
In honor of International Sloth Day and this week's theme β Slow and Steady: build something with open-source AI that rewards laziness β I built SlothSort.
SlothSort is a lightweight CLI that uses a local open-weight model ( llama3.2 ) via Ollama to scan messy folders, understand file context, clean up names into readable kebab-case, and sort everything into category folders.
Here is a live terminal session running against a messy directory:
$ slothsort ~/Downloads --dedupe βββββββββββββββββ π¦₯ slothsort v1.0.0 βββββββββββββββββ β π /Users/deepa/Downloads β β βοΈ DRY-RUN Model: llama3.2 β’ Offline Inference β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ Taxonomy Breakdown ββββββββββββββββββββββ¬βββββββββββ¬βββββββββββββ¬βββββββββββββ¬βββββββββββββββββ β Category β Files β Size β Renamed β Inference β ββββββββββββββββββββββΌβββββββββββΌβββββββββββββΌβββββββββββββΌβββββββββββββββββ€ β π¦ Archives β 3 β 45.0 MB β 1 β 1/3 local β β π΅ Audio β 2 β 18.5 MB β 2 β rules β β π» Code β 5 β 0.2 MB β 2 β rules β β π Data β 3 β 1.1 MB β 3 β rules β β π¨ Design β 2 β 24.0 MB β 2 β rules β β π Documents β 7 β 2.8 MB β 6 β 1/7 local β β π Duplicates β 2 β 1.4 MB β 0 β dedupe β β πΌοΈ Images β 4 β 6.9 MB β 4 β rules β β βοΈ Installers β 2 β 157.9 MB β 2 β rules β β π¬ Videos β 1 β 240.0 MB β 1 β 1/1 local β ββββββββββββββββββββββΌβββββββββββΌβββββββββββββΌβββββββββββββΌβββββββββββββββββ€ β Total β 31 β 497.8 MB β 23 β β β ββββββββββββββββββββββ΄βββββββββββ΄βββββββββββββ΄βββββββββββββ΄βββββββββββββββββ ββ Proposed Directory Hierarchy βββββββββββββββββββββββββββββββββββββββββββββββ β π Downloads/ β β βββ π Documents/ (7 files) β β β βββ analytics_october_metrics.csv β analytics-october-metrics.csv β’ β β β β Financial data report β β β βββ budget_forecast_q4.xlsx β budget-forecast-q4.xlsx β’ standardized β β β β kebab-case β β β βββ final_report_FINAL_v3_USETHISONE.docx β β β β β final-report-final-v3-usethisone.docx β’ standardized kebab-case β β β βββ meeting_notes_oct.txt β meeting-notes-oct.txt β’ standardized β β β kebab-case β β βββ π Duplicates/ (2 files) β β β βββ document(2).pdf β Duplicates/document(2).pdf β’ duplicate of β β β β document(1).pdf β β β βββ IMG_20241020_083211.jpg β Duplicates/IMG_20241020_083211.jpg β’ β β β duplicate of IMG_20241019_142356.jpg β β βββ πΌοΈ Images/ (4 files) β β β βββ Screenshot 2026-10-21 000814.png β β β β β screenshot-2026-10-21-000814.png β’ standardized kebab-case β β β βββ wallpaper_4k_mountain.jpg β wallpaper-4k-mountain.jpg β’ β β β standardized kebab-case β β βββ βοΈ Installers/ (2 files) β β βββ ABDownloadManager_1.11.1_windows_x64.exe β β β β abdownloadmanager-1.11.1-windows-x64.exe β’ standardized kebab-case β β βββ VSCodeUserSetup-x64-1.92.0.exe β vscodeusersetup-x64-1.92.0.exe β’ β β standardized kebab-case β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ Next Step ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Dry-run preview complete. No files were modified on disk. β β β β To apply these changes, run: β β slothsort "~/Downloads" --execute --dedupe β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Enter fullscreen mode Exit fullscreen mode When you pass --execute, the moves happen atomically. If you ever change your mind:
$ slothsort undo ~/Downloads ββ Rollback Complete ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β Successfully restored 31 file(s) to original locations. β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Enter fullscreen mode Exit fullscreen mode Code The complete codebase, documentation, and automated test suite are open-sourced on GitHub:
slothsort/ βββ pyproject.toml # Modern Hatchling package configuration βββ README.md # Full documentation and command reference βββ LICENSE # MIT License βββ.slothsort.toml.example # Configuration template for user overrides βββ slothsort/ β βββ __init__.py # Version metadata β βββ config.py # Taxonomy mapping, model configurations, defaults β βββ scanner.py # Filtering, snippet extraction, SHA-256 duplicate hashing β βββ categorizer.py # Ollama JSON inference + Algorithmic Hallucination Guard β βββ organizer.py # Collision resolution (-1, -2), moves, atomic undo manifest β βββ cli.py # Rich terminal UI, diff tree, watch mode, commands βββ demo/ β βββ simulate_mess.py # Demo script to generate 31 realistic messy files βββ tests/ βββ test_scanner.py # Filtering, snippets, duplicate detection tests βββ test_safety.py # Hallucination guard & name preservation tests βββ test_parser.py # Resilient JSON parsing tests (lists, dicts, markdown) βββ test_organizer.py # Collision resolution & end-to-end rollback tests Enter fullscreen mode Exit fullscreen mode How I Built It SlothSort is built with Python 3.10+, Ollama, Meta Llama 3.2 (3B), Click, Rich, and Pydantic.
For personal file management, local open-source AI is fundamentally superior to closed cloud APIs:
I built SlothSort through an iterative agent pair-programming session with an AI coding assistant. The agent helped scaffold the initial Click/Rich CLI architecture, iterate on small-model prompt engineering with Ollama, and write the 12-test pytest suite that verified the algorithmic hallucination guard.
Manually sorting an 800-file Downloads folder usually takes 45 minutes of tedious drag-and-drop.
With SlothSort, it takes 5 seconds with one command β or zero effort if you leave --watch running in the background.