Disk cleanup
Disk cleanup answers two questions in one tab: what takes space on this disk, and what of it can go. You see the disk split into Windows, programs, users and what can be freed, then categories with their sizes. Every category says what it is, whether it is safe to delete and how it is deleted. Nothing personal is ever selected in advance, and nothing is deleted before you confirm a list with sizes.
Open it
- Right-click a disk (in the sidebar or This PC) and choose Clean up disk…, or use the Clean up disk… button in the header of the disk map.
- Tools menu > Clean up disk…
- In the command palette (Ctrl+Shift+P): "Clean up disk…".
- From a script:
mo --cmd "tools.disk-cleanup=D:"(see Automation and scripting).
There is no default shortcut; you can assign one in Settings > Shortcuts. Cleanup works on local disks only.
The overview
The tab opens at once. Sizes first appear from the disk service (see Settings), marked as an estimate, and are then counted exactly in the background. F5 measures again. Categories are in groups:
| Group | What it holds |
|---|---|
| Safe to free | temporary data that programs create again |
| System (administrator) | items that Windows or MagnumOpus delete with administrator rights - shown only when you turn them on, see below |
| Check yourself | your files and projects - nothing is selected in advance |
| Information only | things that cannot be deleted, only made smaller or configured |
Select safe ticks the safe categories. Clean up selected… (or Del) opens the confirmation.
What it cleans up
Safe to free
| Category | What goes | How |
|---|---|---|
| Temporary files | %TEMP% - files older than a day that nobody has open, and the folders they leave empty | permanently |
| MagnumOpus cache | thumbnails, previews, folder sizes (the same items as Settings > Storage) | permanently; the part in use goes at the next start |
| Browser caches | cache only - Chrome, Edge, Brave, Vivaldi, Chromium, Opera and Firefox. Profiles, passwords, history and cookies stay. The cache of a running browser is left out. | permanently |
| Shader cache | DirectX, NVIDIA, AMD, Intel - games start a little slower the first time | permanently, files of a running game are skipped |
| Crash dumps and error reports | CrashDumps and Windows Error Reporting of this user | permanently |
| Windows thumbnails | the thumbnail cache of File Explorer | by Windows (the same handler as Disk Cleanup), no UAC |
| Recycle Bin | the Recycle Bin of this disk, with its contents and deletion dates in the detail | permanently - never selected in advance |
Check yourself
| Category | What it shows | How |
|---|---|---|
| Old downloads | items in Downloads that you have not opened for 90 days | detail: tick items, Move to Recycle Bin… |
| Large files | files from 1 GB outside Windows and Program Files - Find… goes through the disk in the background | detail, to the Recycle Bin |
| Duplicates | the same files in more places | Find duplicates… opens Find duplicates |
| Developer tool caches | npm, pip, Cargo, Gradle, NuGet, Yarn, Go - downloaded again when needed | permanently, item by item |
| Build output and dependencies | target, node_modules, .venv, bin / obj of your projects | permanently, project by project |
Old downloads and large files go to the Recycle Bin with Undo (Ctrl+Z); the space is freed after you empty it. Show in list opens them as a results tab with preview, so you can look before you decide.
Developer caches and project output are cleaned up item by item in the detail, nothing selected in advance. Projects are searched for in your profile, in the usual places (such as source\repos and Projects, and repositories from recent folders) and in folders you add yourself - Add folder… in the detail or Settings > Tools > Folders with projects (disk cleanup). The detail shows when each project last changed, so you can pick the ones you have not touched for a long time.
System items
Off by default. Turn them on in Settings > Tools > System items in disk cleanup; until then neither the tab nor mo cleanup shows or runs them. They are never selected in advance, and the whole cleanup needs a single UAC prompt.
| Category | How |
|---|---|
| Windows Update Cleanup | by Windows itself, the same handler as Disk Cleanup. Installed updates can no longer be uninstalled. It can take tens of minutes. |
| Delivery Optimization | by Windows itself |
| Windows temporary files | by MagnumOpus with administrator rights: Windows\Temp older than a week, memory dumps and system error reports |
| Previous Windows installation | by Windows itself. Irreversible: you can no longer go back to the previous version. |
The confirmation has a Create a restore point before cleaning checkbox (remembered, off by default). If the restore point cannot be created, the whole cleanup stops and nothing is deleted.
Information only
- Hibernation file (
hiberfil.sys): the detail has Reduce hibernation… (fast startup stays, hibernation stops working) and Turn off hibernation… (both go, the computer starts slower). Each explains its effect and runs a fixedpowercfgcommand after one UAC prompt. Both can be undone. Needs the system items switch. - Page file: Windows manages it; the button opens Performance Options.
- Restore points and shadow copies: the button opens System Protection, where you can limit the space they take.
Confirmation, progress and result
Clean up selected… shows every category with its size. Temporary data is marked as permanent and cannot be undone; open files are skipped. Clean up {size} starts the cleanup. The tab shows progress with Stop, and then the result: how much was freed, the free space before and after, and what was skipped - open or read-only files, a running browser, parts that need an administrator, or the part that is deleted at the next start.
What it never does
Deleting is the part to get right, so the rules are strict.
- It deletes only what the category itself counts. The list of targets is computed again at deletion time; a path outside the category, its parent or a subfolder of a target is rejected and nothing is deleted.
- Links are not followed. A junction or symbolic link inside a target is never entered; at most an old link itself is removed, never what it points to.
- Open files are skipped. MagnumOpus never ends a process. Read-only files are skipped and their attribute is not changed.
- Age is checked again. A file that changed since it was measured stays.
- Only clearly temporary data is deleted permanently. Your own files (old downloads, large files) always go to the Recycle Bin with Undo. The Recycle Bin is emptied only on request.
- Tool caches need the tool's own marker. A folder is cleaned only when it looks like that tool's cache, and not when a link points to it. Build output is deleted only next to its project file (
Cargo.toml, a dependency lock, a Python dependency list,.csproj) and not in OneDrive. - The administrator part is narrow. The elevated process takes only the disk and a fixed list of categories, never paths or commands, and works out what to delete by itself. It starts only after you confirm.
- No registry cleaning and no "optimization". Browser history, cookies and profiles are not touched.
From the command line
mo cleanup prints the same overview for scripts and deletes nothing unless you ask.
mo cleanup overview for the drive of the current folder
mo cleanup D: --json the same as JSON
mo cleanup C: --list browser items of one category
mo cleanup C: --run temp,browser --yes
--run takes only the safe categories that need no rights: temp, thumbs, mo, browser, shader and dumps. Without --yes it asks first. The Recycle Bin, personal files, developer caches, projects and system items are cleaned up only in the tab. Exit code 0 means done (skipped open files are in --json), 1 a category failed or you declined, 2 an invalid switch, drive or category, 3 mo-explorer.exe is missing next to mo.exe. See the command line reference.
To see why a disk is full before cleaning it, open the disk map; to remove programs you do not use, see Apps manager.