File Clean
Commands
- •
/fileclean <directory>— Scan and rename files in specified directory - •
/fileclean ~/Downloads— Common use: clean up Downloads folder - •
/fileclean --dry-run <directory>— Show rename plan without executing
Procedure
Phase 1: Scan
- •List all files in target directory
- •Identify files with unhelpful names (IMG_, Screenshot, Document*, unnamed*, random hashes)
- •Read file metadata (creation date, type, size)
- •For text/doc files, read first few lines to understand content
Phase 2: Plan
Generate rename plan:
- •Current name -> Proposed name
- •Format: descriptive-name.MMDDYYYY.ext
- •The descriptive name comes from file content, type, or context
- •The date is the file's creation or modification date
- •Preserve original extension
Phase 3: Present
Show the full rename plan as a table:
| Current | Proposed | Reason |
|---|---|---|
| IMG_4521.png | office-whiteboard-notes.02142026.png | Photo of whiteboard |
| Document (3).pdf | mastercard-sow-draft.02102026.pdf | SOW document content |
Phase 4: Confirm
Wait for user approval. Allow user to:
- •Accept all
- •Modify specific renames
- •Skip specific files
- •Cancel entirely
Phase 5: Execute
Rename files using safe operations (copy then verify then remove original). Report results.
Safety Rules
- •NEVER delete any files — rename only
- •NEVER overwrite existing files — add suffix if name collision
- •Always show plan and get confirmation first
- •Preserve file extensions exactly
- •Keep original permissions and metadata