DEV Community

NIRAJ THAPA
NIRAJ THAPA

Posted on

# SlothSort: a local-first file organizer for people who would rather not sort files

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.

SlothSort cover image

What I Built

My Downloads folder tends to collect files faster than I feel like organizing them. SlothSort is a small Python command-line tool that sorts files into folders such as Documents, Images, Videos, Audio, Code, and Archives.

Point it at a folder to preview a cleanup or organize the files in one pass. It can also watch a folder and sort new files after they finish downloading. It skips hidden and temporary files, avoids overwriting duplicate names, and never opens file contents.

Demo

SlothSort is a local command-line app, not a hosted web page. Try it from a terminal:

python main.py ~/Downloads --dry-run
python main.py ~/Downloads --once
python main.py ~/Downloads --watch
Enter fullscreen mode Exit fullscreen mode

The first command previews proposed moves without changing files. The second organizes the folder once; the third watches for new files. Ollama is optional: when it is unavailable, SlothSort falls back to filename and extension rules.

Code

View the SlothSort source on GitHub

How I Built It

SlothSort is written in Python. It sends a filename (not file contents) to a local Ollama server for classification, using gemma3:4b by default. If Ollama is unavailable or does not return a recognized category, filename and extension rules provide a fallback.

Folder watcher or one-time scan
             |
             v
 Filename-only classification
       /             \
 local Ollama     filename rules
       \             /
             v
   preview or move file
Enter fullscreen mode Exit fullscreen mode

The local model call is made to http://localhost:11434; there is no hosted AI API in the app. The dry-run option makes it possible to inspect planned destinations before moving anything.

To set up the project, install the Python dependencies with pip install -r requirements.txt. For local model classification, install Ollama and run ollama pull gemma3:4b; otherwise the built-in rules still work.

Why Does Open Innovation Matter?

Open-weight models and local inference make this kind of utility practical without sending filenames to a hosted AI service. I can run the organizer on my own machine, inspect how it classifies files, and keep the fallback behavior useful even when the model is not running.

My Agent Session

I do not have a shareable agent-session link to include.

The Lazy Payoff

Instead of manually making folders and dragging each file into place, I can preview or run one command. I have not measured a time-saved figure yet, so I will not claim a number.

Top comments (0)