An AI-powered tool that scans your macOS Downloads folder and suggests which files can be safely deleted using GPT-4o-mini.
- 🔍 Scans your Downloads folder and collects file metadata
- 🤖 Uses GPT-4o-mini to intelligently analyze files and suggest deletions
- 📊 Provides detailed suggestions with confidence levels and reasoning
- 💾 Saves suggestions to a JSON file for review
- 📌 Remembers files marked as "keep" - files you want to keep won't be suggested again in future runs
- 👀 Option to view/open files before deleting to verify they're safe to remove
⚠️ Conservative approach - only suggests files that are likely safe to delete
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install Python dependencies:
pip install -r requirements.txt
-
Set up your OpenAI API key:
Create a
.envfile in the project root:cp .env.example .env
Then edit
.envand add your OpenAI API key:OPENAI_API_KEY=sk-your-actual-api-key-hereYou can get your API key from: https://platform.openai.com/api-keys
Make sure your virtual environment is activated:
source venv/bin/activateThen run the script:
python download_cleanup_agent.pyTo deactivate the virtual environment when done:
deactivateThe script will:
- Scan your Downloads folder
- Filter out files previously marked as "keep"
- Send file metadata to GPT-4o-mini for analysis
- Display suggestions organized by confidence level
- Allow you to select files for deletion and optionally open them for review
- Save suggestions to
Downloads/cleanup_suggestions.json - Optionally mark files as "keep" so they won't be suggested again
The agent considers several factors when making suggestions:
- File age: Old files (6+ months) are often safe to delete
- File type: Installers (.dmg, .pkg), temporary files, duplicates
- File size: Large files that haven't been accessed recently
- Naming patterns: Files with "Copy of", "Untitled", numbered duplicates
- Conservation: Keeps recent documents and important file types
The script provides:
- Summary statistics (total files, suggested deletions, space to free)
- Detailed suggestions grouped by confidence level (high/medium/low)
- Reasoning for each suggestion
- A JSON file with all suggestions for programmatic use
- Python 3.7+
- macOS (for Downloads folder path)
- OpenAI API key with access to GPT-4o-mini
MIT