Skip to content

AlexTkDev/MacOSCleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

126 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

macOS Cleaner

macOS Cleaner

License: Custom Non-Commercial Platform: macOS Language: Swift 6 UI: SwiftUI Build: XcodeGen Version: 2.0.0

🧹 Free up disk space by cleaning caches, temp files, app leftovers, and more. Review candidates first, confirm what to remove, and recover from Trash when you need to.


Screenshots

πŸ“· View all screenshots


Features

🧠 Apple Intelligence β€” Native local AI explanations powered by FoundationModels (requires macOS 26.0+). Operates fully offline on supported Apple Silicon Macs. Explains files, caches, running processes, and startup agents to help you decide what is safe to remove. Prompts are optimized in English for higher model reasoning, with explanations output in your preferred UI language (English, Русский, Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°, EspaΓ±ol). Fully toggleable in settings, with real-time model status tracking.

🌍 Fully Localized β€” English, Русский, Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°, EspaΓ±ol. All UI, errors, logs, and system info translated dynamically. Dates and byte counts format automatically for your language.

Dashboard πŸ“Š β€” redesigned with native macOS aesthetics: controlBackgroundColor, rounded cards, and SF Symbols. Disk usage chart, system info (model, CPU, RAM, macOS version), cleanup history and stats.

Smart Cleanup πŸ” β€” scans 54 categories with 450+ built-in cleaning paths:

  • App Caches β€” Google, Spotify, JetBrains, opencode, browsers (Safari, Chrome, Firefox, Edge, Brave, Vivaldi, Arc), messengers (Telegram, Discord, Slack, Signal, WeChat, Teams)
  • Package Managers β€” Homebrew, npm, yarn, pnpm, CocoaPods
  • Dev Tools β€” Xcode DerivedData, iOS Simulators (old runtimes too), Android SDK + Studio caches, Gradle/Maven, Flutter/Dart, language caches (Go, Rust, Python, Node.js, Ruby, Java, Julia, Elixir, Haskell, Swift PM, R, Maven, pnpm-store, Yarn, Poetry, Cargo git, SwiftPM repos, Bazel)
  • IDE Caches β€” Cursor, VS Code (incl. Insiders), Windsurf, Zed, JetBrains, Nova, Sublime Text, Atom, Eclipse, opencode, Claude, ChatGPT, Gemini, Perplexity, GitHub Desktop, Slack, Discord, Figma, Notion, Postman, Insomnia, Linear, Tower, TablePlus + dynamic Electron cache discovery
  • Browser Sub-Caches β€” Firefox Profiles/*/cache2, Safari LocalStorage/Databases, Chrome Code Cache/GPUCache/Service Worker/GrShaderCache, Edge/Brave/Arc Code Cache
  • System Caches β€” QuickLook ThumbnailsAgent, fonts, Spotlight, Siri, CloudKit, TimeMachine, icons
  • Docker β€” container and image cleanup
  • App Containers β€” sandboxed caches in Containers + Group Containers
  • Dotfile Caches β€” AI CLI tools (opencode, Claude, Gemini, Codex, Aider), dev tools (npm logs, Terraform, Helm, Bazel, ccache, vcpkg)
  • Scattered Junk β€” .DS_Store, __MACOSX, stray logs, Windows metadata (Thumbs.db, desktop.ini), broken symlinks
  • Orphaned Remnants β€” known leftovers from removed apps via KnownResidualCatalog
  • Orphaned Files β€” leftovers from uninstalled apps in HTTPStorages, WebKit, Cookies, /Users/Shared
  • Old IDE Versions β€” cleans system caches for VS Code, Cursor, Windsurf, Zed, Sublime Text, Eclipse, Atom; detects and removes leftover JetBrains cache/log directories for no-longer-installed products; cleans old Android Studio version caches (keeps latest); removes stale CachedData subdirectories for VS Code, Cursor, Windsurf (keeps latest version)
  • Large Files β€” old DMG/pkg/iso/zip installers, node_modules (recursive), iPhone backups, IPSW firmware
  • Dynamic Cache Discovery β€” auto-discovers large reverse-DNS caches in ~/Library/Caches; Apple caches (com.apple.*) at β‰₯ 5 MB, others at β‰₯ 20 MB
  • Time Machine Snapshots β€” local APFS snapshots (macOS recreates them automatically)
  • iOS Backups β€” re-downloadable from iCloud
  • Mail Downloads β€” cached email attachments (all Mail accounts)
  • Saved Application State β€” window/session state (recreated on app launch)
  • Crash Reports β€” old crash logs and diagnostic files
  • AssetsV2 / iWork Templates β€” Pages/Numbers/Keynote templates (~800 MB, re-downloaded on demand)
  • iCloud CloudKit Cache β€” metadata cache (rebuilt automatically)
  • SwiftPM Cache β€” build/download cache (rebuilt on next build)
  • Carthage Cache β€” dependency cache and spec repos
  • Steam Cache β€” app cache, shader cache, depot cache, logs
  • Teams Cache β€” Electron caches (Cache, Code Cache, GPUCache, IndexedDB)
  • Adobe Caches β€” application and media caches
  • Chrome Extra Caches β€” GrShaderCache, disk cache, code cache, GPU cache, service workers
  • Launch Agents β€” user-level LaunchAgents in ~/Library/LaunchAgents
  • Launch Daemons β€” system-level LaunchDaemons (sudo)
  • Privileged Helpers β€” system helper tools (sudo)
  • Package Receipts β€” pkgutil receipt databases
  • Internet Plug-Ins β€” legacy browser plug-ins
  • Shared File Lists β€” Finder sidebar / recent items lists
  • iCloud Cloud Documents β€” iCloud document cache (opt-in)
  • User Logs β€” system and user-level logs (~/Library/Logs, /Library/Logs)
  • Photos Library Cache β€” Photos.app library cache
  • Voice Memos β€” Voice Memos recordings (opt-in)
  • GarageBand / Logic β€” project files and caches (opt-in)
  • iMovie / Final Cut β€” render files and libraries (opt-in)
  • Garmin / Fitbit β€” device sync caches
  • Old Backups β€” stale .backup files in Home, Desktop, Documents, Downloads
  • DNS Cache Flush β€” flushes DNS resolver cache (command, sudo)
  • Font Cache β€” rebuilds font databases (command, sudo)
  • Sleep Image β€” removes /var/vm/sleepimage (command, sudo, opt-in)
  • Duplicate Files β€” sha256 duplicate detection in ~/Documents, ~/Desktop, ~/Downloads, ~/Pictures, ~/Movies
  • Unused Apps β€” apps not launched in 180+ days (scan-only)

Cleanup tasks run in parallel across all available cores for maximum speed. All categories are always scanned. Dev-related ones show a purple "DEV" badge. Risk badges (Safe / Moderate / Dangerous / Protected) appear after scan β€” you pick what to delete, then confirm.

Cleanup Options β€” toggles before scan:

  • Clean .DS_Store files β€” removes Finder metadata from directories (off by default)
  • Clean Maven repository β€” removes Maven cached dependencies from ~/.m2/repository (off by default)
  • Clean Go module cache β€” removes Go package caches from GOMODCACHE (off by default)
  • Clean .dart_tool in projects β€” scans and cleans Flutter/Dart development builds in common project locations (off by default)
  • Clean iCloud Documents β€” includes iCloud document cache (off by default)
  • Clean Voice Memos β€” includes Voice Memos recordings (off by default)
  • Clean GarageBand / Logic β€” includes project files and caches (off by default)
  • Clean iMovie / Final Cut β€” includes render files and libraries (off by default)
  • Clean Sleep Image β€” removes hibernation image file (off by default)

Disk Space Analyzer πŸ“ β€” scan any custom folder to browse its subdirectories and files sorted by size. Features categorized breakdowns (Videos, Audio, Photos, Apps, Documents, Archives) and lets you reveal items in Finder or move them to the Trash directly from the app.

Process Manager βš™οΈ β€” redesigned with modern macOS styling. Lists running processes in Flat or Grouped views. Sorts by CPU, memory, name, or threads. Supports terminating/force-killing individual processes, multiple selection, or entire groups. Critical system processes (kernel_task, launchd, WindowServer) are protected automatically. Custom user Whitelists and Blacklists let you prevent accidental termination of specific apps or quickly close blacklisted ones.

Startup Services πŸš€ β€” redesigned with modern macOS styling. Scans LaunchAgents and LaunchDaemons from both user-level (~/Library) and system-level (/Library) directories. Categorizes them automatically into My Services (User), Third-party, and System services. Allows you to load/unload or stop active services (asking for permissions via AppleScript when necessary), and configure custom vendor prefixes (System Vendors) to protect specific services from accidental modification.

App Uninstaller πŸ—‘οΈ β€” drag and drop any .app bundle directly or select from the list. Finds installed apps, scans up to 5 levels deep for residual files using 30 types of evidence (Bundle ID, Team ID, Spotlight, Plist contents, known catalog paths, and more). Shows total reclaimable space and real-time scan progress. Tailored rules for popular apps including Docker, Parallels, Adobe CC, MS Office, Discord, Figma, JetBrains, browsers, and more.

  • Scan Modes (Safe / Balanced) β€” choose between Safe mode (depth 3, exact matches only, no Spotlight, highest confidence files) and Balanced mode (depth 5, full deep scan including Spotlight and fuzzy matching) to tailor uninstallation aggressiveness
  • Background Deep Scanning β€” apps are scanned thoroughly in the background; the UI updates in real time as each app's total size is finalized
  • Evidence-Based Forensics β€” each candidate file is scored against 30 evidence types: identity, code signing, system integration, metadata, content analysis, graph relationships, and Launch Services registration
  • Confidence Tiers β€” .guaranteed (critical evidence), .veryLikely, .possible, or .ignore
  • Developer Components β€” detects and offers to clean Android SDK, Gradle/Maven, Xcode DerivedData, iOS Simulators, Flutter pub-cache, Docker containers, and Homebrew artifacts
  • Reveal in Finder β€” quick action to show any related file or folder in Finder before deleting
  • Why this file? β€” each related file includes an evidence breakdown with localized explanations. Tap any file to see exactly why it was associated with the app
  • Post-Uninstall Verification β€” re-scan confirms cleanup completeness; snapshots stored for rollback

Smart Updates πŸ”„ β€” automatic, lightweight background check for new versions on startup directly via GitHub Releases. Get gently notified when a new update is ready, without background daemons, persistent tracking, or extra dependencies.

Settings β€” rebuilt with native macOS Form styles to match System Settings. Light/dark/system theme, languages (English, Русский, Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°, EspaΓ±ol), notifications, scan-on-startup, Trash behavior (Empty Trash During Cleanup, Bypass Trash on Uninstall, Empty Trash Immediately), Apple Intelligence toggle, custom System Vendors, and more.


How It Works

Runs on Apple Silicon (M1–M5) with full parallelism β€” cleanup categories execute concurrently across all available cores. File scanning is done with a stack-based iterator that batches work and deduplicates inodes. Size calculations are cached to avoid redundant work. Cleanup paths are embedded as static Swift arrays (EmbeddedCleanupPaths + GeneratedCleanupPaths) β€” no runtime JSON parsing.


Safety πŸ›‘οΈ

  • Disk Space and App Uninstaller move files to Trash via trashItem(at:) β€” recoverable by default
  • Smart Cleanup removes selected cache and temporary data after confirmation
  • SafetyManager blocks access to /System, /usr, /bin, ~/.ssh, and other critical paths
  • ProcessSafetyPolicy protects system-critical processes from termination
  • Permanent deletion and automatic Trash emptying are opt-in and clearly marked in the UI
  • Apps are closed before cleanup (graceful terminate β†’ force-kill after 3s)
  • Full Disk Access is requested at startup

Tech Stack

  • Swift 6 β€” actors, async/await, structured task groups
  • SwiftUI β€” @Observable, NavigationSplitView, Charts
  • Build β€” XcodeGen, whole-module optimization, -O Swift flag
  • Logging β€” OSLog with structured subsystems
  • Architecture β€” feature-oriented folders, component-based cleanup

Build from Source

Requirements: macOS 26.0+, Xcode 18+, XcodeGen

cd MacOSCleaner
xcodegen
open MacOSCleaner.xcodeproj

Use ⌘R to run, ⌘U to test, or Product β†’ Archive to create a distributable app.


Troubleshooting

⚠️ Fix damaged app attributes (if macOS asks you to move app to trash):

sudo xattr -r -c /path/to/MacOSCleaner.app

Logs: open Console.app β†’ filter by subsystem input.MacOSCleaner.


Feedback

Found a bug or have an idea? Open an issue β€” contributions are welcome.


License

Source-available Personal Use Only License β€” free to use and study for personal, non-commercial purposes. Commercial use, redistribution, and derivative works require explicit permission. See LICENSE for details.