# File Organizer

> Organizes files in a directory by sorting them into subdirectories based on file extension. Supports dry-run preview, custom rules via config file, and undo via move log. Use when the user asks to organize, sort, or clean up files in a directory. NOT for: renaming files, deduplication, or managing cloud storage.

- Skill: `aws-samples/file-organizer-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add aws-samples/file-organizer-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aws-samples/file-organizer-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: aws-samples (https://skillmd.com/u/aws-samples)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aws-samples/file-organizer-2

---


# File Organizer

Sorts files into subdirectories by extension. Supports dry-run mode, custom
rules, and undo.

## Usage

```bash
# Preview what would happen
python scripts/organize.py ~/Downloads --dry-run

# Organize files
python scripts/organize.py ~/Downloads

# Undo last organization
python scripts/organize.py ~/Downloads --undo
```

## Permissions

This skill needs access to the target directory only:

- `Read(<target_dir>/*)` — List files in the directory
- `Write(<target_dir>/*)` — Move files into subdirectories
- `Bash(python scripts/organize.py <target_dir> *)` — Run the organizer

