6# File Organizer (Claude Code - PARA Method)
7
8Organizes files using the PARA methodology with bash commands. Intelligent categorization and audit trails.
9
10## What is PARA?
11
12| # | Category | Contains | Lifespan |
13|---|----------|----------|----------|
14| 0 | Inbox | New files awaiting processing | Temporary |
15| 1 | Projects | Active work with deadlines | Short-term |
16| 2 | Areas | Ongoing responsibilities | Long-term |
17| 3 | Resources | Reference materials by topic | Evergreen |
18| 4 | Archive | Inactive/completed items | Preserved |
19
20## Workflow
21
22```
23Phase 1: Discovery → ls, find, file commands to scan and assess
24Phase 2: Analysis → Read file contents for poor names (use Read tool for PDFs)
25Phase 3: Triage → Create categorization table, flag sensitive/scam files
26Phase 4: Preparation → mkdir -p to create PARA structure, get approval
27Phase 5: Execution → mv commands with logging
28Phase 6: Cleanup → Remove empty folders, delete temp files
29Phase 7: Completion → Generate summary, verify PARA folder roots are clean
30```
31
32### 0-Review Staging Workflow
33
34For large batches of poorly-named files, use a staging folder:
35
36```bash
37# Create staging folder for files needing content analysis
38mkdir -p ~/Downloads/0-Review
39
40# Move cryptic/poorly-named files to review
41mv ~/Downloads/U0BPA6*.pdf ~/Downloads/0-Review/
42mv ~/Downloads/[0-9][0-9][0-9][0-9][0-9].pdf ~/Downloads/0-Review/
43
44# Analyze each file, then move to proper PARA location
45# Remove staging folder when empty
46rmdir ~/Downloads/0-Review
47```
48
49## Quick Start
50
51```bash
52# 1. Create PARA folder structure
53mkdir -p ~/Downloads/{0-Inbox/_REVIEW,1-Projects/{Work,Personal},2-Areas/{Finance,Health,Legal,Career},3-Resources/{Media/{Images,Videos,Audio,Screenshots},Tools/{Installers,Utilities},Learning/{Articles,Books,Courses}},4-Archive/{Completed-Projects,Past-Years},_ORG}
54
55# 2. Scan target directory
56find ~/Downloads -maxdepth 1 -type f | wc -l
57ls -la ~/Downloads | head -50
58
59# 3. Move files (log each operation)
60mv "~/Downloads/file.pdf" "~/Downloads/2-Areas/Finance/"
61```
62
63## PARA Folder Structure
64
65```bash
66# One-liner to create full PARA structure
67mkdir -p ~/Downloads/{0-Inbox/_REVIEW,1-Projects/{Work,Personal},2-Areas/{Finance,Health,Legal,Career,Home},3-Resources/{Media/{Images,Videos,Audio,Screenshots},Tools/{Installers,Utilities},Learning/{Articles,Books,Courses},Templates},4-Archive/{Completed-Projects,Past-Areas,Old-Resources},_ORG}
68```
69
70Visual structure:
71```
72Target-Directory/
73├── 0-Inbox/ # New files land here first
74│ └── _REVIEW/
75├── 1-Projects/ # Active work with deadlines
76│ ├── Work/
77│ └── Personal/
78├── 2-Areas/ # Ongoing responsibilities
79│ ├── Finance/
80│ ├── Health/
81│ ├── Legal/
82│ └── Career/
83├── 3-Resources/ # Reference materials
84│ ├── Media/
85│ ├── Tools/
86│ └── Learning/
87├── 4-Archive/ # Inactive items
88│ └── Completed-Projects/
89└── _ORG/ # Tracking files
90```
91
92## Inbox Review Workflow
93
94### Daily Review (5 min)
95
96```bash
97# List inbox contents
98ls -la ~/Downloads/0-Inbox/
99
100# For each file, determine PARA destination:
101# Actionable with deadline? → 1-Projects
102# Ongoing responsibility? → 2-Areas
103# Reference material? → 3-Resources
104# Completed/inactive? → 4-Archive
105```
106
107### Weekly Review (15 min)
108
109```bash
110# 1. Check for remaining inbox items
111ls ~/Downloads/0-Inbox/
112
113# 2. Find completed projects (no recent modifications)
114find ~/Downloads/1-Projects -maxdepth 2 -type d -mtime +30
115
116# 3. Archive completed projects
117mv ~/Downloads/1-Projects/old-project ~/Downloads/4-Archive/Completed-Projects/
118```
119
120## File Naming Convention
121
122Format: [DATE]_[CODE]_[description].[ext]
123
124```bash
125# Examples
126mv "Document.pdf" "2025-01_FIN_tax-statement.pdf"
127mv "IMG_1234.jpg" "2025-01_REF_vacation-photo.jpg"
128mv "Screenshot 2025-01-13.png" "2025-01-13_PROJ_meeting-notes.png"
129```
130
131### PARA Category Codes
132
133| Code | Category | Destination |
134|------|----------|-------------|
135| PROJ | Projects | 1-Projects/ |
136| FIN | Finance | 2-Areas/Finance/ |
137| HEALTH | Health | 2-Areas/Health/ |
138| LEGAL | Legal | 2-Areas/Legal/ |
139| REF | Reference | 3-Resources/ |
140| LEARN | Learning | 3-Resources/Learning/ |
141
142## Content Analysis (Bash)
143
144For poorly-named files, extract content to determine proper naming:
145
146```bash
147# PDFs - extract text
148pdftotext "Document.pdf" - | head -50
149
150# If pdftotext unavailable, try:
151strings "Document.pdf" | head -100
152
153# Images - check EXIF data
154file "IMG_1234.jpg"
155exiftool "IMG_1234.jpg" 2>/dev/null | grep -E "Date|Title|Description"
156
157# Office docs - unzip and read
158unzip -p "document.docx" word/document.xml | head -100
159```
160
161## Files to Analyze
162
163Trigger content analysis for:
164
165```bash
166# Generic names
167ls ~/Downloads | grep -iE "^(document|untitled|copy of|new )"
168
169# Camera defaults
170ls ~/Downloads | grep -iE "^(IMG_|DSC_|DCIM|scan[0-9])"
171
172# Screenshots
173ls ~/Downloads | grep -iE "^(screenshot|screen shot|capture)"
174
175# Numbered duplicates
176ls ~/Downloads | grep -E "\([0-9]+\)\."
177
178# Random alphanumeric strings (auto-generated filenames)
179ls ~/Downloads | grep -iE "^[A-Z0-9]{16,}\.[a-z]+$"
180
181# Numeric-only filenames (e.g., 65440.pdf)
182ls ~/Downloads | grep -E "^[0-9]+\.[a-z]+$"
183
184# Scan prefixes with timestamps
185ls ~/Downloads | grep -iE "^scan_.*[0-9]{4}-[0-9]{2}-[0-9]{2}"
186
187# Gmail exports
188ls ~/Downloads | grep -iE "^Gmail.*\.pdf$"
189```
190
191## Auto-Categorization by Type
192
193```bash
194# Move images to Resources/Media
195find ~/Downloads/0-Inbox -maxdepth 1 \( -name "*.jpg" -o -name "*.png" -o -name "*.gif" \) -exec mv {} ~/Downloads/3-Resources/Media/Images/ \;
196
197# Move installers to Resources/Tools
198find ~/Downloads/0-Inbox -maxdepth 1 \( -name "*.dmg" -o -name "*.exe" -o -name "*.pkg" \) -exec mv {} ~/Downloads/3-Resources/Tools/Installers/ \;
199
200# Move PDFs with financial keywords to Areas/Finance
201for f in ~/Downloads/0-Inbox/*.pdf; do
202 if pdftotext "$f" - 2>/dev/null | grep -qiE "invoice|receipt|statement|tax"; then
203 mv "$f" ~/Downloads/2-Areas/Finance/
204 fi
205done
206```
207
208## Logging Template
209
210Create _ORG/_LOG.md:
211
212```bash
213cat > ~/Downloads/_ORG/_LOG.md << 'EOF'
214# Organization Log (PARA Method)
215**Started**: $(date '+%Y-%m-%d %H:%M')
216
217## Operations
218| Time | Action | File | From | To (PARA) |
219|------|--------|------|------|-----------|
220EOF
221
222# Log each move
223echo "| $(date '+%H:%M') | MOVE | file.pdf | 0-Inbox | 2-Areas/Finance/ |" >> ~/Downloads/_ORG/_LOG.md
224```
225
226## Safety Rules
227
2281. **Never delete** - only move to 0-Inbox/_REVIEW if uncertain
2292. **Log everything** - append to _LOG.md before each mv
2303. **Approval checkpoints** - pause and confirm before bulk moves
2314. **Preserve dates** - use mv (not cp+rm) to keep timestamps
2325. **Sensitive files** - flag anything in 2-Areas/{Finance,Health,Legal}
233
234## Security & Scam Detection
235
236Flag and quarantine potential scam/phishing files:
237
238```bash
239# Common scam patterns in PDFs (fake invoices, tech support scams)
240# Keywords to search: "Norton", "McAfee", "Microsoft Support",
241# "Your account", "Payment required", "Call immediately"
242
243# Check PDF content for scam indicators
244for f in ~/Downloads/*.pdf; do
245 if pdftotext "$f" - 2>/dev/null | grep -qiE "norton|mcafee|geek squad|call.*1-[0-9]{3}"; then
246 echo "⚠️ POTENTIAL SCAM: $f"
247 mv "$f" ~/Downloads/0-Inbox/_REVIEW/
248 fi
249done
250```
251
252**Scam indicators:**
253- Random alphanumeric filename (e.g., U0BPA6IUWL6FUQRUHYCZ.pdf)
254- Fake invoice from security software companies
255- "Call this number" with toll-free numbers
256- Urgent payment demands
257
258**Action:** Move to _REVIEW folder, flag for user, recommend DELETE
259
260## Sensitive Document Handling
261
262Flag and secure sensitive documents:
263
264```bash
265# Tax documents (W-2, 1099, tax returns)
266ls ~/Downloads | grep -iE "(w-2|w2|1099|tax.*(return|form))"
267
268# Documents with SSN patterns
269grep -l "[0-9]\{3\}-[0-9]\{2\}-[0-9]\{4\}" ~/Downloads/*.pdf 2>/dev/null
270
271# Financial statements
272ls ~/Downloads | grep -iE "(statement|account.*summary|routing.*number)"
273```
274
275**Sensitive file types:**
276| Type | Flag | Destination |
277|------|------|-------------|
278| W-2, 1099, Tax forms | ⚠️ SENSITIVE | 2-Areas/Finance/Tax/ |
279| Contracts with signatures | ⚠️ LEGAL | 2-Areas/Legal/ |
280| Medical records | ⚠️ HEALTH | 2-Areas/Health/ |
281| Password/credential files | ⚠️ SECURE | Encrypted storage |
282
283**Action:** Flag in categorization table, confirm with user before moving
284
285## Duplicate Detection
286
287```bash
288# Find duplicates by name pattern
289ls ~/Downloads/0-Inbox | grep -E "\([0-9]+\)\." | while read f; do
290 original="${f/ ([0-9])/}"
291 echo "Duplicate: $f -> Original: $original"
292done
293
294# Find duplicates by content (md5)
295find ~/Downloads -maxdepth 1 -type f -exec md5sum {} \; | sort | uniq -d -w32
296```
297
298## Large File Handling
299
300```bash
301# Find files > 100MB
302find ~/Downloads -maxdepth 1 -type f -size +100M -exec ls -lh {} \;
303
304# Large media files typically go to Resources
305find ~/Downloads/0-Inbox -maxdepth 1 -size +100M \( -name "*.mp4" -o -name "*.mov" \) -exec mv {} ~/Downloads/3-Resources/Media/Videos/ \;
306```
307
308## Session Resume
309
310If interrupted, check last operation:
311
312```bash
313tail -5 ~/Downloads/_ORG/_LOG.md
314```
315
316## Temp File Cleanup
317
318Remove common junk files before organizing:
319
320```bash
321# Office temp files (~$...)
322find ~/Downloads -name "~\$*" -delete
323
324# macOS metadata
325find ~/Downloads -name ".DS_Store" -delete
326find ~/Downloads -name "._*" -delete
327
328# Empty files
329find ~/Downloads -maxdepth 1 -type f -empty -delete
330```
331
332## PARA Root-Level Audit
333
334After initial organization, check for loose files at PARA folder roots:
335
336```bash
337# Files should be in subfolders, not at PARA root level
338echo "=== 2-Areas root files (should be in subfolders) ==="
339find ~/Downloads/2-Areas -maxdepth 1 -type f ! -name ".DS_Store"
340
341echo "=== 3-Resources root files ==="
342find ~/Downloads/3-Resources -maxdepth 1 -type f ! -name ".DS_Store"
343
344echo "=== 4-Archive root files ==="
345find ~/Downloads/4-Archive -maxdepth 1 -type f ! -name ".DS_Store"
346```
347
348## Empty Folder Cleanup
349
350After processing, remove empty staging folders:
351
352```bash
353# Remove empty review/staging folders
354rmdir ~/Downloads/0-Review 2>/dev/null
355rmdir ~/Downloads/0-Inbox/_REVIEW 2>/dev/null
356
357# Find and remove empty subdirectories
358find ~/Downloads -type d -empty -delete
359```
360
361## Categorization Table Format
362
363Present recommendations in a clear table before executing:
364
365```markdown
366### 🚫 DELETE (scam/junk)
367| File | Reason |
368|------|--------|
369| U0BPA6...pdf | SCAM - Fake Norton invoice |
370
371### ⚠️ SENSITIVE → 2-Areas/Finance
372| File | Content |
373|------|---------|
374| 65440.pdf | W-2 Tax Form 2024 |
375
376### 📁 4-Archive
377| File | Suggested Rename |
378|------|------------------|
379| old-project.pdf | 2023-01_PROJ_project-name.pdf |
380
381### 📚 3-Resources
382| File | Destination |
383|------|-------------|
384| manual.pdf | 3-Resources/Tools/ |
385```
386
387**Emoji flags:**
388- 🚫 DELETE - Scam, junk, or duplicate
389- ⚠️ SENSITIVE - Tax, legal, medical, credentials
390- 📁 ARCHIVE - Old/completed items
391- 📚 RESOURCES - Reference materials
392- 📂 AREAS - Ongoing responsibilities
393- 📝 PROJECTS - Active work
394
395## Reference Files
396
397- **references/config.md**: Customize PARA structure and detection keywords
398- **references/templates.md**: Tracking file templates
399