Skip to content

mayurchheta/mac-disk-health

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Disk Health

A single-command macOS disk and memory health analyzer that generates a beautiful interactive HTML report.

Built for Mac users who want to understand what's eating their storage and RAM — especially useful for Macs with limited disk space (128GB/256GB) or memory (8GB).

Screenshot Python License

Features

  • Health Score — 0-100 score based on disk usage, memory pressure, and cache bloat
  • Disk Usage Gauge — visual breakdown of storage with used/free/total
  • RAM Monitor — active, wired, compressed, inactive, and free memory breakdown
  • Memory Pressure — the real indicator of whether your Mac needs more RAM
  • Cache Scanner — finds and sizes all ~/Library/Caches directories
  • Downloads Analyzer — file type donut chart + subfolder sizes
  • Large File Finder — spots files >5MB in Downloads
  • App Data Viewer — Chrome, VS Code, Brave, Firefox, npm data sizes
  • Directory Explorer — browse Desktop, Documents, Downloads, Movies, Music, Pictures by size
  • node_modules Detector — finds bloated node_modules in project folders
  • One-click Actions — copy rm commands and open folder commands to clipboard

Install

curl -sL https://raw.githubusercontent.com/mayurchheta/mac-disk-health/main/install.sh | bash

This will:

  1. Clone the repo to ~/.mac-disk-health
  2. Create a disk-health command
  3. Run the first scan automatically

Usage

# Run a scan
disk-health

# Or run directly
python3 ~/.mac-disk-health/scanner.py

The report opens automatically in your default browser.

Output

Generates ~/Desktop/DiskReport.html — a fully self-contained HTML file with:

  • Dark theme with smooth animations
  • Tabbed interface (Overview, Memory, Explorer, Caches, Downloads, Large Files, App Data)
  • Interactive sort buttons
  • Copy-to-clipboard buttons for cleanup commands
  • Works offline — no external dependencies after generation

Requirements

  • macOS (tested on macOS Ventura/Sonoma/Sequoia)
  • Python 3.8+
  • No pip packages needed — uses only standard library

How It Works

The scanner collects data using native macOS commands:

  • df for disk usage
  • vm_stat for memory pages
  • memory_pressure for system memory pressure
  • sysctl for hardware info
  • du for directory sizes

All data stays local. Nothing is sent anywhere.

Troubleshooting

Report shows blank page?

  • Hard refresh: Cmd + Shift + R
  • Try opening in Safari (handles local file:// better than Chrome)

Permission errors?

  • Some system directories may be restricted. The scanner skips them gracefully.

Slow scan?

  • First scan may take 30-60 seconds if you have many files in Downloads.

License

MIT License — see LICENSE

Author

Made by Mayur Chheta

About

macOS disk & memory health analyzer - generates interactive HTML reports

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors