SpaceKeeper

Keep your Mac's disk free.

SpaceKeeper removes data that rebuilds itself, optimises your screenshots and recordings, and cleans at once when free space runs low.

For developers on macOS. Runs locally; the engine is one zsh script with no dependencies.

12.8 GB free of 245 GB Below 15 GB, cleaning
    An example emergency pass. Sizes are illustrative; yours depend on what is on your disk.

    What it cleans

    Only data that rebuilds itself. Each module uses the tool's own clean command where there is one, and every module has a dry run.

    Package caches

    uv, pip, npm, Yarn, pnpm, Homebrew and Go caches, through each tool's own clean command.

    caches

    Xcode DerivedData

    DerivedData folders that have not been written in the last 2 hours.

    derived-data

    Simulator data

    Erases the data of shut-down simulators over 200 MB. Booted simulators are never erased.

    simulators

    Build output

    Git-ignored build/, .build/, out/, DerivedData and test_output folders in your code folder.

    build-dirs

    Merged worktrees

    Removes clean, fully merged Git worktrees after three hours without a HEAD change. Branches and release worktrees are kept.

    worktrees

    Docker leftovers

    Build cache, stopped containers and unused images. Volumes are never pruned.

    docker

    Gradle, in emergencies

    ~/.gradle/caches, only in an emergency pass, when free space is already low.

    gradle

    Idle simulators, if you opt in

    Shuts down booted simulators that no process is using and that have had no writes for 30 minutes.

    sim-shutdown

    What it never touches

    These rules hold for every pass. No flag relaxes them.

    • Anything written in the last 2 hours
    • Booted simulators
    • Files tracked by git: build folders must be git-ignored
    • Unmerged or dirty worktrees, and *-release worktrees
    • Docker volumes

    The guard

    A launchd agent runs a cleanup pass every 10 minutes. It also checks free space every 2 minutes, and when it drops below 15 GB it runs an emergency pass straight away, which adds the Gradle cache.

    You don't have to remember to clean, and a long UI test run or Docker build is caught within minutes of free space running low.

    ~/.config/spacekeeper/config
    LOW_GIB=15        # emergency pass below this
    INTERVAL=600      # seconds between passes
    CHECK=120         # seconds between checks
    IDLE_MIN=120      # never touch recent writes
    CODE_DIR="$HOME/code"
    AUTO_SIM_SHUTDOWN=0
    SIM_IDLE_MIN=30

    Screenshots and recordings, optimised

    SpaceKeeper uses Clop to optimise images and videos. Setup installs Clop if it's missing and points it at your media folders, so new captures are optimised as they arrive.

    Run spacekeeper media to optimise what is already there, or pass your own paths.

    Three ways to use it

    All three call the same engine and show its output. None of them has its own cleanup logic.

    CLI and TUI

    Run spacekeeper for a dashboard in the terminal, or use the commands directly. Every command has --json.

    spacekeeper status
    spacekeeper clean --dry-run
    spacekeeper sims shutdown-idle

    Mac menu bar app

    Free space in the menu bar, with a window for cleaning, simulators, media and the log.

    Raycast extension

    Disk Status in the menu bar, Clean Disk with a dry run, Simulators, and Optimise Media.

    Install

    Download SpaceKeeper for Mac directly from Piper, or install the Mac App Store edition once it is live. Unzip the direct build and move it to Applications.

    Get SpaceKeeper

    The direct Mac app includes the cleanup engine, background guard and Clop integration. Start with a dry run to inspect what a cleanup would remove.

    Project hygiene for app builds

    Builds and UI tests are what refill the disk. Paste these rules into an app repository's AGENTS.md so builds clean up after themselves.