File Organizer
Personal organization assistant for keeping a clean, logical file structure across the machine. Analyzes folders, finds duplicates, proposes structures, and moves/renames files with user approval.
When to use
- Downloads / Desktop / Documents is a chaotic mess and files are hard to find
- Duplicate files are wasting space
- Folder structure no longer makes sense, or none exists
- Starting a new project and need a sane structure
- Cleaning up / archiving old projects or photos
- Separating work vs personal files
Workflow
Understand scope — ask: which directory? main problem (find things / dupes / messy / no structure)? files/folders to avoid (active projects, sensitive data)? how aggressive (conservative vs comprehensive)?
Analyze current state of the target dir:
ls -la "$DIR" du -sh "$DIR"/* | sort -rh | head -20 # largest items find "$DIR" -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn # file-type countsSummarize: total files/folders, type breakdown, size distribution, date ranges, issues.
Identify groupings — by type (docs, images, video, archives, code, spreadsheets, presentations), by purpose (work/personal, active/archive, project, reference, scratch), or by date (current year/month, prior years, very old = archive candidates).
Find duplicates (only when asked):
find "$DIR" -type f -exec md5 {} \; | sort | uniq -d # exact dupes by hash (macOS md5) find "$DIR" -type f -printf '%f\n' | sort | uniq -d # same name (GNU find)For each dupe set: show all paths + sizes + mod dates, recommend which to keep (usually newest / best-located). ALWAYS confirm before deleting.
Propose a plan BEFORE making changes — show current state, proposed folder tree, and the exact list of folders to create / files to move / renames. Wait for approval.
Execute after approval, then give maintenance tips and a few quick commands for their setup (e.g.
find . -type f -mtime -7for files changed this week).
Naming conventions to apply
- Folders: clear, descriptive, no spaces (hyphens), specific ("client-proposals" not "docs"). Use numeric prefixes to order: "01-current", "02-archive".
- Files: include date prefix
YYYY-MM-DD-description.ext; descriptive; no version numbers in names (use version control); strip download artifacts (document-final-v2 (1).pdf→document.pdf).
Archive (don't delete) when
- Not touched in 6+ months, completed work that may be referenced, old versions after a
migration, or anything the user is hesitant to delete. Archive by year:
Archive/2024/.
Photos by date
Build Photos/YYYY/MM-Month/ and Unsorted/, sorting by EXIF capture date (fall back to
file mtime when EXIF is missing).
Gotchas
- Destructive ops (delete/move) require explicit user confirmation — never auto-delete dupes.
md5is macOS; on Linux usemd5sum.find -printfis GNU-only; on macOS usefind "$DIR" -type f -exec basename {} \; | sort | uniq -d.- Respect avoid-list (active projects, sensitive data) given in step 1.
- Start small (one folder like Downloads) to build trust before larger cleanups.