dev-disk-doctor
Scans Android emulator system images, AVD data, and NDKs; identifies unused system images and provides allowlisted removal actions while preserving images used by AVDs.
Detects Bun package caches and offers cleanup actions to reclaim disk space.
Scans CocoaPods caches and provides allowlisted cleanup actions.
Detects Cypress test browser downloads and offers cleanup actions.
Scans Docker Desktop disk image (Docker.raw), unused images, build cache, stopped containers, and volumes; provides allowlisted prune actions with dry-run and confirmation, warning about volumes.
Audits git worktrees across all repositories, identifying active, stale, dangling, locked, at-risk, or orphaned worktrees; can remove clean, unlocked, merged or fully pushed worktrees with confirmation.
Scans Gradle caches and offers cleanup actions to reclaim disk space.
Scans Homebrew caches and provides allowlisted cleanup actions.
Finds Hugging Face model caches and offers cleanup actions.
Scans iOS backups and reports disk usage; provides allowlisted cleanup actions.
Identifies npm package caches and provides cleanup actions to reclaim disk space.
Finds Ollama model storage and offers cleanup actions.
Detects old pnpm store versions and prunes the active store; offers cleanup actions for old versions.
Detects Puppeteer browser downloads and offers cleanup actions.
Scans Python virtual environments in workspaces, reports idle projects, and offers cleanup actions.
Finds PyTorch hub model caches and offers cleanup actions.
Scans Rust target/ directories in workspaces and offers cleanup actions.
Scans Xcode DerivedData, DeviceSupport, and simulators; provides allowlisted cleanup actions.
Detects Yarn caches and offers cleanup actions to reclaim disk space.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dev-disk-doctor
Why is my disk full? A read-only disk and git-worktree doctor for developer machines. It finds the space hogs (Docker, Android emulators, Xcode, node_modules, package caches, AI models, orphaned git worktrees), explains each one, and gives you a ready-to-run fix with a warning when one is needed.
Works as a CLI and as an MCP server, so an AI agent (Claude Code, Cursor, Codex…) can run it, show you the options, and ask before touching anything.
Built mainly for macOS. Xcode, the iOS Simulator, Android Studio (SDK, emulators, AVDs), Docker Desktop's disk image and
~/Librarycaches are what it is tuned for. Linux works for the cross-platform ones (Docker, package caches, models, projects, worktrees), and Windows is not supported. See Platform support.
npm install -g dev-disk-doctor
dev-disk-doctor # scan, read-only
dev-disk-doctor worktrees # how many git worktrees do I have, and which are leftovers?Install
You need Node.js 18 or newer. Nothing else to install.
npm install -g dev-disk-doctor # install the dev-disk-doctor command
dev-disk-doctor --version # check it workedUpdate:
npm install -g dev-disk-doctor@latestUninstall:
npm uninstall -g dev-disk-doctorTry it without installing:
npx dev-disk-doctor@latest.npxruns the tool from a temporary cache and leaves nodev-disk-doctorcommand behind, so usenpm install -gif you want the plain command. Keep the@latest: without it,npxmay reuse an older copy it cached earlier.If the shell says
dev-disk-doctor: command not foundafter installing, the folder npm puts global commands in is not on yourPATH.npm config get prefixshows it; add<prefix>/bintoPATH.
Install without npm (from a release bundle)
If your machine cannot reach the npm registry, or cannot find the package on it (a locked-down work laptop, a private registry mirror), install the bundle from the GitHub releases instead. It is the same package with its dependencies packed inside, so installing it makes no request to any npm registry. You only need Node.js 18 or newer.
# download the newest bundle (or pick a version on the releases page, or download it in a browser)
curl -fsSL -O https://github.com/pureartisan/dev-disk-doctor/releases/latest/download/dev-disk-doctor.tgz
npm install -g ./dev-disk-doctor.tgz # install the dev-disk-doctor command
dev-disk-doctor --version # check it workedPin a version: download
dev-disk-doctor-X.Y.Z.tgzfrom that release's assets instead, for examplehttps://github.com/pureartisan/dev-disk-doctor/releases/download/v0.4.0/dev-disk-doctor-0.4.0.tgz.Update: download the newest bundle and run the same
npm install -gagain.Uninstall:
npm uninstall -g dev-disk-doctorNo GitHub access either: download the
.tgzon another machine and copy it over (USB, shared drive). It is a single file of about 3.5 MB.Build a bundle yourself from a clone of this repo:
npm install && npm run bundlewritesrelease/dev-disk-doctor-X.Y.Z.tgz.MCP client: point it at the installed command instead of
npx:"command": "dev-disk-doctor", "args": ["mcp"](see Use it with an AI agent).
The examples below use the installed dev-disk-doctor command. If you did not install it, replace dev-disk-doctor with npx dev-disk-doctor@latest.
Related MCP server: mcp-local-sandbox-cleaner
Getting started
Scan (read-only, about a minute on a big disk):
dev-disk-doctorThe first time, it asks where your projects live (see Where it looks). You then get a ranked list. Each item says what it is, how big it is, how risky deleting it is, and, when the tool can run the fix, a ready-to-paste
run:line.Check the git worktrees (also read-only):
dev-disk-doctor worktreesFix one item at a time. Copy the
run:line from the scan. It shows what would happen and changes nothing:dev-disk-doctor fix "docker:build-cache#prune"Add
--yesto actually run it.Or clean every SAFE item in one go. Preview first, then add
--yes:dev-disk-doctor fix safe dev-disk-doctor fix safe --yesIt lists the warnings to read first (such as "quit Chrome"), runs the biggest items first, and carries on if one fails.
fix safenever touchesREVIEWitems. Or pick from a checklist. Rundev-disk-doctor fixwith no id in a terminal. Every SAFE item starts ticked and every REVIEW item unticked. Scroll with the arrow keys or the mouse wheel, tick or untick with space or a click, pressafor all,nfor none,sfor SAFE only andrto switch every REVIEW item on or off, then Enter. A summary lists the REVIEW items you ticked and the warnings, and nothing runs until you confirm it. Items that are instructions only, rated CAREFUL, or protected by macOS (like~/Library/Logs) are never offered.Or let an AI agent drive it; see Use it with an AI agent below.
Commands
Command | What it does |
| Scan for space hogs. Read-only. |
| Scroll through the last scan without scanning again (scans first if none is saved). Scroll with the arrow keys, space, |
| Audit git worktrees across all your repos. Read-only. |
| Show what one action would do. Add |
| In a terminal, pick what to clean from a scrollable checklist. Asks to confirm before anything runs. |
| The same for every SAFE item at once. Add |
| Show which workspace folders will be searched. |
| Remember a workspace folder for next time. |
| Forget a saved workspace folder. |
| Always figure the folders out, and stop asking. |
| Forget every saved choice and ask again next time. |
| List the cache folders you added yourself. |
| Add a cache folder the built-in list does not know. Takes |
| Forget one you added. |
| Start the MCP server on stdio, for AI agents. |
| List every command and option in the terminal. |
| Print the version. |
Options (they go after the command):
Option | What it does |
| Machine-readable output with a stable schema. |
| Workspace folder to search. Repeatable. Replaces the defaults for this run. |
| Ignore items smaller than this. Default 100. |
| Days idle before a project or worktree counts as stale. Default 30. |
| Run one detector: |
| Also sweep your whole home folder for unknown space hogs. Slow. |
| Show every finding instead of the top 25. |
| With |
| With |
| With |
| With |
| With |
| With |
| With |
| Plain output. |
Examples:
dev-disk-doctor --only docker --only xcode # just those two areas
dev-disk-doctor --min-size 500 --all # everything over 500 MB
dev-disk-doctor worktrees --stale-days 14 # worktrees idle for two weeks
dev-disk-doctor --json > scan.json # for scripts and agents
dev-disk-doctor show --from 26 --count 25 --no-pager # the second page of the last scanEvery text scan is saved to ~/.dev-disk-doctor/last-scan.json, together with a checksum of the options it ran with (folders, --min-size, --stale-days, --deep, --only, written in one canonical form, so the order or spelling of the same folders does not matter).
showlists the saved scan again instantly, whatever its age, as long as the options match. If you pass different options, it scans again.fixwith no id (the checklist) andfix safereuse the saved scan when it is under five minutes old and the options match, and say so. Anything older, or made with other options, is scanned again.--forcealways scans again.Before
fixruns anything from a scan that is over a minute old, it looks again at just the detectors behind the items you chose. An item that has gone, or become riskier since (a worktree that picked up uncommitted changes, say), is left out and listed.fix <id> --yesalways looks again at the one detector behind that id.A successful
fix --yesdeletes the saved scan, because its sizes are out of date by then. Sizes in a saved scan do not update on their own;show --forcescans again.
Nothing is deleted unless you run fix <id> --yes, fix safe --yes, or confirm the fix checklist. Actions marked CAREFUL are never run by the tool.
Where it looks for your projects
Projects, node_modules and git worktrees are searched in your workspace folders. You don't have to configure them:
Common names directly under your home folder are always used if they exist:
dev,code,src,projects,work,workspace,workspaces,Developer,repos,git,Sites.Any other visible folder directly under your home that contains a git repo or project within three levels is picked up too. So a company folder such as
~/acmeis found automatically, even though it has an arbitrary name.Also checked automatically, for worktrees: the places AI coding tools park them (
~/.codex/worktrees,~/.cursor/worktrees,~/.claude/worktrees,~/conductor), and.claude/worktreesinside any repo.Never searched by default:
~/Documents,~/Desktop,~/Downloads,~/Library,~/Applications, hidden folders, and cloud-sync folders (Dropbox, OneDrive, Google Drive, iCloud…), because they are slow and can trigger permission prompts.
See what it will use:
dev-disk-doctor rootsThe first time you run a scan in a terminal, it asks where to look: figure it out (and remember that), type your folders (and remember them), type folders for this run only, or skip. It never asks when you pass --root or --json, when output is piped, in the MCP server, or once a choice is saved. roots reset makes it ask again.
Override it when your code lives somewhere else (for example ~/Documents/GitHub or an external drive):
dev-disk-doctor --root ~/Documents/GitHub --root /Volumes/Work/code # this run only
dev-disk-doctor roots add ~/Documents/GitHub # remember it for every run
dev-disk-doctor roots remove ~/Documents/GitHub # forget it again
dev-disk-doctor roots auto # always figure it out, don't ask
dev-disk-doctor roots reset # forget every saved choiceSaved choices live in ~/.dev-disk-doctor/config, a small JSON file ({ "roots": ["/Users/you/Documents/GitHub"] }, plus "autoDiscover": true if you chose "figure it out") you can also edit by hand. The CLI and the MCP server both read it. Folders that no longer exist are skipped but stay in the file. Your home folder itself and / cannot be saved.
You can also set DEV_DISK_DOCTOR_ROOTS="$HOME/Documents/GitHub:/Volumes/Work/code" in your shell profile.
The first one that applies wins, and it turns auto-discovery off so only those folders are searched:
--root(or therootsargument of the MCP tools)DEV_DISK_DOCTOR_ROOTSfolders saved with
roots addauto-discovery
What it checks
Area | Examples |
Containers and VMs | Docker Desktop disk image ( |
Mobile | Android emulator system images (never one an AVD uses), AVD data, NDKs, Android build cache, Xcode DerivedData, DeviceSupport, simulators, Swift Package Manager, Carthage, CocoaPods, Kotlin/Native, Flutter pub cache |
JavaScript and frontend | npm, pnpm (old store versions too), Yarn, Bun, Deno, Corepack, node-gyp, Electron and electron-builder downloads, TypeScript type cache, Prisma engines, |
Python and data science | pip, uv, Poetry, Pipenv, PDM, conda, pre-commit, pyenv downloads, venvs, NLTK data |
JVM, Go, Rust, .NET, PHP, Ruby, Elixir | Gradle, Maven, Ivy, Coursier, SDKMAN downloads, Go modules and build cache, Cargo, sccache, ccache, Bazel, NuGet, Composer, Bundler, RVM, Hex |
AI and machine learning | Hugging Face, Ollama, LM Studio, PyTorch hub, Keras, Whisper, llama.cpp, GPT4All, KaggleHub, Chroma, Triton, Weights & Biases, DiffusionBee |
Infrastructure | Terraform plugin cache, Pulumi plugins, Helm, kubectl cache, mise and asdf downloads |
Editors and browsers | VS Code and Cursor caches and logs, JetBrains, Chrome, Firefox, Edge, Brave, Arc, plus the Playwright, Puppeteer, Cypress and Selenium downloads |
Git worktrees | Every linked worktree in every repo under your workspaces, including those made by Claude Code, Codex, Cursor and Conductor: active, stale, dangling, locked, at-risk, or orphaned |
System | Trash, big Downloads, logs, iOS backups, Time Machine local snapshots |
Anything else | Unrecognised folders in |
Every entry names the folder, why it is safe or not, and what deleting it costs (usually a re-download). Locations differ between macOS and Linux, so each tool is checked in every place it uses.
Caches the tool doesn't know about
Every developer has different tools, so a fixed list can never be complete. Three things fill the gaps:
Discovery, on every scan. It looks at each folder directly inside
~/.cache,~/.local/shareand~/Library/Caches(skippingcom.apple.*, which macOS manages) and lists the big ones no check explains. They are markedREVIEWand the only action is "see what is inside": the tool cannot vouch for what it does not recognise, so it never offers to delete them.--deep, which sweeps your whole home folder and breaks~/.cache,~/.config,~/.localand~/Librarydown one level so you can see which tool is responsible.Your own list. Once you know a folder is a cache, tell the tool, and it shows up in scans with a delete action:
dev-disk-doctor caches add ~/.cache/my-tool --label "My tool" --risk safe dev-disk-doctor caches # what you added dev-disk-doctor caches remove ~/.cache/my-tool--risk safemeans the owning tool rebuilds it, sofix safemay delete it. The default,review, keeps it out of batches. Entries are stored in~/.dev-disk-doctor/config("caches": [{ "path": "~/.cache/my-tool", "label": "My tool", "risk": "safe" }]) and go through the same guard as every delete: only inside your home folder, never the home folder itself orDocuments,Libraryand the other top-level folders, never a workspace folder.
Missing a common tool? A new entry in src/detectors/devcaches.ts is a few lines: a name, the folders, and a one-line reason.
Safe by design
Scanning never changes anything. No network, no telemetry.
Every finding has a risk level:
SAFE(regenerates on its own),REVIEW(probably fine, check first) orCAREFUL(could lose data, never run by the tool).fix <action-id>is a dry run unless you add--yes. Actions come from a fixed allowlist built by the scanners; the tool never executes free-form commands.Worktrees are offered for removal only when they are clean, unlocked, and merged or fully pushed. Dirty worktrees, unpushed commits and Docker volumes are reported with a warning and no apply path.
Unrecognised folders found by discovery or
--deephave no delete action. Only caches on the built-in list, or ones you added yourself, can be deleted.VM and container data (Colima, Lima, Podman, OrbStack, Rancher Desktop, Docker's disk image) is reported as
CAREFULwith advice, never deleted by the tool.It will not delete anything outside your home folder, your home folder itself, or
Documents,Desktop,Libraryand other top-level folders.
Use it with an AI agent (MCP)
Add to your MCP client config:
{
"mcpServers": {
"dev-disk-doctor": { "command": "npx", "args": ["-y", "dev-disk-doctor@latest", "mcp"] }
}
}Claude Code: claude mcp add dev-disk-doctor -- npx -y dev-disk-doctor@latest mcp
If you installed it globally you can point the client at the installed command instead: "command": "dev-disk-doctor", "args": ["mcp"].
Tool | What it does |
| Ranked findings with explanations, risk and available actions |
| All repos, all worktrees, which are stale, dangling, orphaned or at risk |
| Re-checks one finding |
| Runs one allowlisted action. Dry run unless |
No MCP? Give your agent the playbook in skills/dev-disk-doctor/SKILL.md and it can drive the CLI with --json.
Why does macOS say "Documents" is 230 GB?
macOS Storage settings has a category called Documents that is not your ~/Documents folder. It is everything macOS cannot file under Apps, Photos, Mail or System, which for a developer means ~/Library (Docker's disk image, Android SDK images, app data), ~/.cache, ~/.npm, model downloads and your code. Run dev-disk-doctor to see what is actually in there.
Common questions
How do I shrink
Docker.raw? Prune inside Docker (docker image prune -a,docker builder prune -a), then compact the disk image in Docker Desktop → Settings → Resources. The tool reports what is reclaimable and warns about volumes.How do I delete old Android system images? The scan lists every image under
~/Library/Android/sdk/system-images, marks the ones your emulators use, and gives a removal command for the rest.How do I find stale git worktrees?
dev-disk-doctor worktreeslists every linked worktree across your repos with its state and size. AI coding tools create many; some get orphaned.Is the pnpm store safe to delete? It is a cache. Old store versions (
v3,v10) that your installed pnpm does not use can go; the active one is pruned rather than deleted.
Platform support
dev-disk-doctor is built mainly for macOS, which is the primary target and gets the most checks (Xcode, the iOS Simulator, Android Studio, Docker Desktop's disk image, ~/Library caches). Linux works for the cross-platform checks (Docker, package caches, models, projects, worktrees), but expect fewer findings. Windows is not supported yet. Both macOS and Linux run in CI.
Development
npm install
npm test # builds, then runs the node:test suite
npm run scan # build and run against your machine
npm run bundle # build release/dev-disk-doctor-X.Y.Z.tgz, the install bundle with dependencies insideThe scanner core is in src/core, one file per area in src/detectors, the worktree audit in src/worktrees, and the MCP server in src/mcp.ts. See PLAN.md for the design.
Releasing (maintainers)
Pushing a v* tag stages the release on npm through GitHub Actions, and a maintainer approves it with 2FA. Setup, the release steps, how to verify a release and troubleshooting are in docs/RELEASING.md. Dependabot keeps dependencies current and merges minor and patch updates once CI passes; an optional daily job (also runnable by hand) cuts one patch release for runtime dependency updates (same doc).
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Live checks for agent-written code: missing packages, end-of-life versions, stale Actions, secrets.
Lets coding agents check their own code for leaked secrets, risky dependencies and AI-code mistakes
Run verified read-only code tools: quant diagnostics + agent-ops preflight, no source exposure.
Scan AI agent skills, MCP server packages and MCP configs before you install them. Static analysis.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to safely reclaim disk space by deleting build artifact directories like node_modules, .venv, and target, with strong guardrails to prevent accidental or malicious deletion.MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to audit and sweep away transient scratch directories, bloated test caches, and forgotten probe scripts in a workspace, with dry-run previews to guarantee nothing tracked or production-related is touched. It also detects zombie background dev servers still holding common ports like 3000, 5173, and 8000.31MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to scan a Mac for reclaimable disk space and safely move selected items to the Trash, with dry-run defaults, protected paths, and confirmation before permanent deletion.12MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to scan local disks for developer caches, large unused videos, and old logs, present candidates for approval, and move only approved items to the operating system trash so they can be restored while protecting system folders.434 PyPIMIT