Use an AI agent for disk cleanup without losing files
Troubleshooting guides · AI-assisted help
An agent is good at listing candidates and explaining what owns a folder. It is bad at knowing which of your files matter. Split the work that way: let it read and classify, keep the decision, and measure what actually changed.
Windows 11, macOS and GNU/Linux. One affected volume, one approved action at a time. Linux metadata inventory requires ext4; there is no released native Windows inventory scanner.
Get the two numbers that matter
Section titled “Get the two numbers that matter”Before an agent reads anything, write down what the problem actually is. “Low space” becomes actionable only with a required amount.
- Which volume is affected? Settings → System → Storage, or File Explorer → This PC. A second drive, a virtual disk or a synced folder can hold the data while a different volume reports the error.
- How much free space is there now? The figure the operating system reports for that volume, in bytes or with a unit.
- How much does the blocked task need? An update, an installer or a game usually states a requirement. If it does not, record “unknown” rather than guessing.
- When did you read each number? A delta without two timestamps is not a measurement.
That is enough for the agent to compute a shortfall and stop pretending that any large folder is a solution. The storage worksheet does the arithmetic locally, including unit conversion and a matched before/after comparison.
Read candidates without deleting anything
Section titled “Read candidates without deleting anything”Ask for a read-only classification, not a cleanup plan. The disk-cleanup skill already works this way: confirm the computer and volume, inspect, then label candidates.
| Class | Meaning | Safe default |
|---|---|---|
| Known-regenerable | The owning application can rebuild it, for example a page cache | Clear only through that application’s own control |
| App-managed | The application or its uninstaller owns the storage | Use the app’s storage settings; check what local state is removed |
| Personal-review | Your files, saves, downloads or projects | Move or back up. Do not delete to make a number go down |
| Protected | System files, recovery data, snapshots, virtual disks, backups | Leave alone unless you understand the recovery consequence |
| Inventory-only or unknown | No confirmed owner or exact effect | Record it as unknown. Do not act |
The skill is honest about its platform limits. Guided checks work on Windows, macOS and Linux. The optional metadata inventory and snapshot comparison require a supported Linux root filesystem on ext4, and the Windows volume baseline reads volume counters but does not walk directories. A Windows recursive scanner has not shipped, and an agent claiming otherwise is inventing a capability.
Two arithmetic traps to keep in front of you: a folder’s size is not the space an action will free, and the sum of the top folders rarely equals the volume’s used space because of other users, inaccessible items, junctions, snapshots and system files. Both are covered in folder size versus disk usage.
Approve one supported action
Section titled “Approve one supported action”Choose one candidate you can defend, then require a concrete preview. A usable one names the volume, the target, the exact action, the recovery, the estimate or “unknown”, and how the result will be verified.
Common supported actions, and the part people get wrong. Two questions apply to each one: does it delete only rebuildable data, and if it deletes something you wanted, is there any recovery path?
- Storage and Cleanup recommendations, temporary files. Supported, but “temporary” is a blanket label over several categories. Rebuildable caches, thumbnails and delivery-optimisation files are one thing; the Recycle Bin, Downloads, previous installations and error reports are another. Windows can include Recycle Bin items after a set age and Downloads that have not been opened for a set number of days, and those deletions generally bypass the Recycle Bin. Tick one category at a time, read what it holds, and leave anything you cannot identify.
- Previous Windows installation. Deleting it removes a rollback path. If the upgrade is recent and stable, that trade may be fine; decide deliberately, and only after reading the vendor page.
- Storage Sense. It frees space now and keeps deleting on a schedule, on the system drive only. It can clear temporary files, Recycle Bin items after a retention period and, if configured, Downloads and local copies of cloud files. It changes future behaviour, so do not let an agent enable it as a side effect of a cleanup; read each threshold before switching it on.
- OneDrive or another sync client. Files may be online-only placeholders. Deleting the local copy can remove the only copy, and “free up space” in the client is a different operation from deleting.
- Application caches. Use the application’s own clear-data control so it can confirm scope. A hand-deleted cache folder can hold sessions, offline work or the app’s database.
- Recycle Bin or Trash. Emptying it is irreversible on most systems and is a decision for the owner, not a step in a diagnostic.
If the preview is vague, deny it and ask for a named target. If the agent proposes a compound command that scans and deletes, or offers to “clean whatever is safe”, that is the moment to stop. The permission guide explains why, and the practice cards look exactly like that request.
Measure the same volume afterwards
Section titled “Measure the same volume afterwards”Reread the same counter on the same volume and write down the signed difference. Then answer the question that actually mattered: does the blocked task now run?
An illustrative record, invented to show the fields rather than a real result:
| Field | Value |
|---|---|
| Volume | System volume, NTFS |
| Required for the update | 6.0 GB |
| Free before, 09:02 | 3.1 GB |
| Action | Cleared one confirmed browser cache through the browser’s own control |
| Free after, 09:11 | 3.9 GB |
| Observed change | +0.8 GB |
| Still short | 2.1 GB |
| Task outcome | Update still refused with the same error |
That is a useful failure: the action worked, the arithmetic is honest, and the next decision is not “clear more caches” but “which candidate is large enough to matter”. Concurrent writes can also make the delta smaller than the space the action released; note them instead of adjusting the number.
If the figure went up or barely moved, do not repeat the action. Something else is writing, the target was not what you thought, or the space was never released, which is a real possibility with held-open files and snapshots.
When cleanup is the wrong tool
Section titled “When cleanup is the wrong tool”Stop and change approach when:
- the drive makes clicking or grinding noises, files will not open, or the volume disappears: stop, back up only if that is already working, and seek professional recovery. Repeated copying attempts and repair scans can make a failing drive worse;
- the missing space is in a virtual disk, container image, snapshot store or backup set: those have their own safe procedures, and deleting the wrong one destroys data;
- the volume is small because of a quota or a shared account, which cleanup cannot fix;
- the device is managed, so its policy may forbid both tools and user cleanup;
- you are being asked to install a “cleaner” to solve a space problem. The operating system already reports categories and the applications own their caches.
A no-change outcome, recorded honestly, is a valid result. It is also the reason this guide never quotes a reclaimed figure: only the same volume, measured before and after one approved action, can tell you what happened on your PC.