# Organize

> Run the auto-tidy script to sort stray files from Desktop, Downloads, and home root into organized folders. Reports what was moved and shows remaining state. Use when user says 'organize', 'tidy up', 'sort my files', 'clean desktop', 'clean downloads', or 'organize my files'. Do NOT use for deleting files or emptying trash.

- Skill: `gridlock-nyc/organize` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gridlock-nyc/organize`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gridlock-nyc/organize/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: GRIDLOCK-NYC (https://skillmd.com/u/gridlock-nyc)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gridlock-nyc/organize

---


# Organize

Sort stray files from ~/Desktop, ~/Downloads, and ~/ into organized subfolders using the existing auto-tidy script.

## Important

- This skill invokes `~/.local/bin/auto-tidy.sh` — all sorting rules live there, not here
- Never modify or duplicate the sorting logic; just call the script
- The script moves files older than 30 min in Downloads, older than 24h on Desktop, and immediately from home root
- Name collisions are handled safely by the script (appends timestamp)

## Instructions

### Step 1: Snapshot before state

Use Bash to capture file counts before running the script:

```
echo "=== DESKTOP ===" && ls -1 ~/Desktop 2>/dev/null | head -30 && echo "---" && echo "=== DOWNLOADS (loose files) ===" && find ~/Downloads -maxdepth 1 -type f | head -30 && echo "---" && echo "=== HOME ROOT (loose files) ===" && find ~/ -maxdepth 1 -type f -not -name '.*' | head -30
```

If all three locations are empty of loose files, report "Nothing to organize — Desktop, Downloads, and home root are clean." and stop.

### Step 2: Run auto-tidy

Use Bash to run the script and capture new log entries:

```
# Mark log position before run
LOG="$HOME/.local/log/auto-tidy.log"
BEFORE=$(wc -l < "$LOG" 2>/dev/null || echo 0)

# Run the script
bash ~/.local/bin/auto-tidy.sh

# Show only new log lines (what just moved)
AFTER=$(wc -l < "$LOG" 2>/dev/null || echo 0)
if [ "$AFTER" -gt "$BEFORE" ]; then
  tail -n +$((BEFORE + 1)) "$LOG"
else
  echo "No files were moved (all files may be too recent)."
fi
```

### Step 3: Report results

Output a concise summary in this format:

```
ORGANIZE — [timestamp]

MOVED:
  * filename → ~/Downloads/subfolder/
  * filename → ~/Documents/work/
  ...

SKIPPED (too recent):
  * [count] files in Downloads (< 30 min old)
  * [count] files on Desktop (< 24h old)

AFTER:
  Desktop: [count] files remaining
  Downloads: [count] loose files remaining
  Home root: [count] loose files remaining
```

- Parse the MOVED lines from the log output in Step 2
- For skipped files, compare before counts with moved counts
- Keep the report short — just filenames and destinations, no full paths for source files

### Step 4: Flag anything unusual

If any of these are true, add a warning:

- More than 20 files moved in one run → "Large batch — consider checking destinations"
- Files moved from home root → "Home root files moved to ~/Documents/work/ — verify these aren't project files"
- Name collisions occurred (timestamp appended) → "Name collisions detected — timestamped copies created"

## Error Handling

1. **Script not found**: "~/.local/bin/auto-tidy.sh not found. Cannot organize without it."
2. **Permission denied**: "Permission denied running auto-tidy.sh. Check: chmod +x ~/.local/bin/auto-tidy.sh"
3. **Log file missing**: Script creates it automatically — not an error, just means first run.

