DEV Community

Nam Tran
Nam Tran

Posted on

Automate Your Mac Cleanup: Introducing DiskCleanKit 4.0 with Scheduled Scans, Alerts & URL Schemes

DiskCleanKit 4.0 brings powerful automation features to Mac cleanup - scheduled scans, low disk space alerts, and URL schemes for Terminal/Shortcuts integration. Perfect for developers who want hands-free Mac maintenance.


The Problem: Manual Cleanup Doesn't Scale

As developers, our Macs accumulate junk at an alarming rate:

  • Xcode derived data eating 50GB+ silently
  • npm/node_modules scattered across projects
  • Docker images you forgot to prune
  • Simulator caches from iOS development
  • Build artifacts from various IDEs

Most of us remember to clean up only when that dreaded "Disk Full" notification appears - usually at the worst possible time (mid-compile, anyone?).

What if your Mac could maintain itself?

Introducing DiskCleanKit 4.0 Automation

After months of development and community feedback, I'm excited to announce DiskCleanKit 4.0 - now with comprehensive automation support.

What's New in 4.0

  1. Scheduled Scans & Auto-Clean - Set it and forget it
  2. Low Disk Space Alerts - Get warned before it's critical
  3. Auto Startup - Always monitoring in the background
  4. URL Schemes - Full Terminal & Shortcuts integration
  5. Finder Integration - Right-click context menu actions

Let's dive into each feature.

DiskCleanKit 4.0 dashboard


1. Scheduled Scans: Your Mac on Autopilot

Configure automatic scans on your preferred schedule:

Frequency Best For
Daily Active developers (recommended)
Weekly Light users
2 Weekly Moderate use
Monthly Minimal maintenance

Setup

  1. Open DiskCleanKit → Preferences → Automation
  2. Enable "Scheduled Scan"
  3. Choose frequency and scan type (Quick Clean, Deep Scan, or One-Touch)
  4. Optionally enable "Auto Clean After Scan"

Now your Mac cleans itself while you focus on coding.


2. Low Disk Space Alerts: Never Get Caught Off Guard

Set a threshold and receive notifications before your disk fills up:

Recommended thresholds:
- 256GB SSD → Alert at 10GB remaining
- 512GB SSD → Alert at 20GB remaining
- 1TB+ SSD  → Alert at 50GB remaining
Enter fullscreen mode Exit fullscreen mode

This gives you time to clean up before Xcode refuses to build or Docker can't pull images.


3. URL Schemes: The Developer's Power Feature

This is where it gets interesting. DiskCleanKit 4.0 supports URL schemes for complete automation control.

Available Schemes

diskcleankit://onetouch     # One-Touch Clean mode
diskcleankit://quickclean   # Quick Clean scan
diskcleankit://deepscan     # Deep Scan
diskcleankit://duplicates   # Duplicate Finder
diskcleankit://uninstaller  # App Uninstaller
Enter fullscreen mode Exit fullscreen mode

Parameters

Parameter Description
autoscan=true Start scanning immediately
autoclean=true Auto-clean after scan

Terminal Examples

# Quick cleanup before a big build
open "diskcleankit://quickclean?autoscan=true&autoclean=true"

# Full deep scan with auto-clean
open "diskcleankit://deepscan?autoscan=true&autoclean=true"

# One-touch mode - scan and clean everything
open "diskcleankit://onetouch?autoscan=true&autoclean=true"
Enter fullscreen mode Exit fullscreen mode

Real-World Automation Recipes

Recipe 1: Pre-Build Cleanup Script

Add this to your build scripts to ensure you always have space:

#!/bin/bash
# pre-build-cleanup.sh

# Check available space (in GB)
available=$(df -g / | awk 'NR==2 {print $4}')

if [ "$available" -lt 20 ]; then
    echo "Low disk space detected. Running cleanup..."
    open "diskcleankit://quickclean?autoscan=true&autoclean=true"
    sleep 30  # Wait for cleanup
fi

# Continue with build
xcodebuild ...
Enter fullscreen mode Exit fullscreen mode

Recipe 2: macOS Shortcuts Automation

Create a Shortcut that runs cleanup every time you close Xcode:

  1. Open Shortcuts app
  2. Go to Automation tab
  3. Create automation: "When Xcode closes"
  4. Add action: Run Shell Script
  5. Enter: open "diskcleankit://quickclean?autoscan=true&autoclean=true"

Recipe 3: Cron Job for Nightly Cleanup

# Add to crontab (crontab -e)
# Run deep scan every night at 2 AM
0 2 * * * open "diskcleankit://deepscan?autoscan=true&autoclean=true"
Enter fullscreen mode Exit fullscreen mode

Recipe 4: Alfred/Raycast Integration

Create a workflow/script command:

# Quick Clean shortcut
open "diskcleankit://onetouch?autoscan=true&autoclean=true"
Enter fullscreen mode Exit fullscreen mode

Now trigger a full cleanup with a keyboard shortcut.

Recipe 5: Git Hook - Clean Before Large Operations

#!/bin/bash
# .git/hooks/pre-rebase

# Ensure enough space before rebase
open "diskcleankit://quickclean?autoscan=true&autoclean=true"
sleep 10
Enter fullscreen mode Exit fullscreen mode

Finder Integration: Clean Files Where You Find Them

DiskCleanKit 4.0 also adds right-click context menu options directly in Finder:

  • Quick Clean Folder - Clean junk in any folder
  • Scan for Duplicates - Find duplicates within a folder
  • Find Large Files - Identify space hogs
  • Analyze Storage - See what's using space

Enable Finder Integration

  1. System Settings → Login Items & Extensions
  2. Find DiskCleanKit → File Provider
  3. Enable it

Now right-click any folder to access cleanup options instantly.


What DiskCleanKit Cleans

For those wondering what actually gets cleaned:

System Junk

  • System caches and logs
  • Temporary files
  • Broken symlinks
  • Old iOS backups

Developer-Specific

  • Xcode derived data & archives
  • CocoaPods cache
  • Carthage build folder
  • npm/yarn cache
  • pip cache
  • Homebrew cache
  • Docker unused images (manual)

Application Caches

  • Browser caches (Safari, Chrome, Firefox)
  • App caches and temp files
  • Mail downloads
  • Old app support files

Privacy & Security

A note on privacy since I know developers care about this:

  • No data collection - Everything stays on your Mac
  • No account required - Works completely offline
  • No analytics - We don't track what you clean
  • Sandboxed - Mac App Store approved, follows Apple's security guidelines
  • Transparent - Always shows what will be deleted before cleaning

Getting Started

DiskCleanKit 4.0 is available now on the Mac App Store.

Download: DiskCleanKit on Mac App Store

Website: diskcleankit.com

Quick Start for Developers

  1. Install from Mac App Store
  2. Run your first scan (One-Touch mode recommended)
  3. Enable Automation in Preferences
  4. Set up your preferred URL scheme workflows
  5. Enjoy a self-maintaining Mac

Conclusion

DiskCleanKit 4.0 transforms Mac cleanup from a manual chore into an automated background task. Whether you prefer scheduled scans, Terminal commands, or Shortcuts integration, there's an automation method that fits your workflow.

No more "Disk Full" surprises. No more manual cleanup sessions. Just a Mac that maintains itself while you focus on what matters - writing code.


What automation workflows would you create? Drop a comment below or reach out on Twitter. I'm always looking for ways to make DiskCleanKit more useful for developers.


Top comments (0)