// Overview

Developer machines accumulate tens of gigabytes of hidden caches, build artifacts, and stale dependencies. Xcode DerivedData alone can reach 50GB+. Docker images pile up. Old node_modules linger in forgotten projects.

Sweepr scans all of it across 24 scanner modules, shows you exactly what's there, and lets you clean it safely — nothing is ever deleted without explicit confirmation. It also monitors system health from a persistent menubar widget.

// Architecture

SwiftUI Views
ViewModels
Scanner Protocol
24 Scanner Modules
Shell / File Services
SwiftData
|
CryptoKit (SHA-256)
|
Swift Charts

Every scanner conforms to a shared Scanner protocol with async scanning and a simulation-first cleanup flow. The architecture uses Swift 6 strict concurrency throughout, with MVVM view models managing state across the app.

// Scanner Modules

  • Xcode — DerivedData, Archives, Device Support, Simulators, Caches, Docs
  • Android Studio — Gradle caches, AVD emulators, SDK components, IDE caches
  • Docker — Dangling images, stopped containers, unused volumes, build cache, VM disk
  • Package Managers — Homebrew, npm, Yarn, pnpm, CocoaPods, Carthage, Swift PM, pip, Cargo, Maven, Composer
  • IDEs — JetBrains (IntelliJ, GoLand, PyCharm), VS Code extensions
  • Python Environments — virtual environments (.venv, venv)

// Key Features

  • App Uninstaller with related file detection via bundle ID heuristic search
  • Duplicate Finder with two-pass detection (size grouping + SHA-256 hashing)
  • Large File Finder with configurable threshold
  • Disk Usage Browser — recursive analysis like ncdu with interactive treemap
  • System Health dashboard — memory, security, battery, uptime, shell startup time
  • Quick-Clean profiles and custom cleanup presets
  • Full audit trail with CSV export
  • Menubar widget with persistent disk-free indicator

// Safety Model

Every cleanup follows the same flow: Scan → Preview → Confirm → Clean. Files go to Trash by default, never permanent delete. Protected paths like ~/.ssh, Keychains, and Mail are blocked from deletion. Every action is recorded in a full audit trail.

// Challenges & Solutions

Challenge: Scanning dozens of directories across the filesystem without blocking the UI or consuming excessive memory on large developer machines.

Solution: All 24 scanners run as concurrent async tasks with progress callbacks. File hashing for duplicate detection uses chunked CryptoKit reads to keep memory flat. The Scanner protocol enforces Sendable conformance for safe concurrency under Swift 6.

Challenge: Building an interactive treemap visualization for disk usage with drill-down into nested directories.

Solution: Implemented a custom Canvas-based treemap renderer that computes squarified layouts recursively. Click interactions trigger re-layout at the selected node level, with animated transitions between depth levels.