File Organizer
by @newageinvestments25-byte
Scan, deduplicate, and organize files in a directory by type, generating a dry-run plan before optionally moving files without deleting anything.
clawhub install nai-file-organizerπ About This Skill
name: file-organizer description: Scan, deduplicate, and organize files in a directory (Downloads, Desktop, etc.). Use when asked to: clean up downloads, organize files, find duplicates, declutter desktop, sort files by type, move files into folders, remove duplicate files, create a file inventory, or tidy up a folder. Conservative by default β always shows a plan before moving anything. NEVER deletes files.
File Organizer
Scans a target directory, categorizes files by type, finds duplicates, and generates (or executes) a cleanup plan. Dry-run by default β always shows what will happen before doing it.
Scripts
All scripts live in scripts/. Run with python3. No third-party dependencies.
| Script | Purpose |
|--------|---------|
| scan.py | Walk a directory, output JSON inventory |
| find_duplicates.py | Find duplicate files by content hash |
| organize.py | Generate and optionally execute a move plan |
| manifest.py | Produce a markdown before/after manifest |
Category mappings (extension β folder) are in references/categories.md. Read it if asked about supported file types or to customize mappings.
Typical Workflow
1. Scan the directory
python3 scripts/scan.py ~/Downloads --output /tmp/scan.json
Add --hash to pre-compute hashes (needed for duplicate detection without a separate pass).
2. Find duplicates (optional)
python3 scripts/find_duplicates.py /tmp/scan.json --output /tmp/dupes.json
Or scan and deduplicate in one step:
python3 scripts/find_duplicates.py --directory ~/Downloads
3. Generate organization plan (dry run)
python3 scripts/organize.py /tmp/scan.json --output /tmp/plan.json
Or scan + plan in one step:
python3 scripts/organize.py --directory ~/Downloads
Key flags:
--dest ~/Downloads/Organized β custom destination (default: /Organized/ )--flat β don't preserve subdirectory structure--dry-run β default, shows plan without moving anything--execute β actually move files (prompts for confirmation)--execute --yes β skip confirmation prompt4. Execute the plan
python3 scripts/organize.py /tmp/scan.json --execute
or skip the prompt:
python3 scripts/organize.py /tmp/scan.json --execute --yes
5. Generate manifest
# From plan JSON
python3 scripts/manifest.py --plan /tmp/plan.json --output /tmp/manifest.mdBefore/after comparison (run scan.py twice)
python3 scripts/manifest.py --before /tmp/before.json --after /tmp/after.json --output /tmp/diff.mdSimple inventory
python3 scripts/manifest.py --scan /tmp/scan.json --output /tmp/inventory.md
Safety Rules
organize.py never deletes files β only moves them--execute must be explicit--yes).dotfiles) are skipped by default; use --include-hidden to include themCommon Scenarios
"Clean up my Downloads folder" β Run scan + organize dry-run, show the plan summary, ask user to confirm before executing.
"Find duplicate files in my Desktop"
β Run find_duplicates.py --directory ~/Desktop, report groups sorted by wasted space.
"Organize my files and save a report" β Run scan β organize (dry-run) β confirm β organize (execute) β manifest to markdown.
"What file types are supported?"
β Read references/categories.md and summarize the category mappings.
Output Locations
Default destination for organized files:
Subfolders are created per category: Images/, Documents/, Videos/, etc.
Files with unrecognized extensions go to Other/.