Loosely Decoupled
GuidePowerShell

How to Find What's Taking Up Space on Your C: Drive with PowerShell

You finish with each large C: folder matched to its owner, whether an AI model folder, a package cache or the hibernation file, and to the cleanup it needs.

A stipple engraving of a tired man with headphones round his neck opening a row of nested crates at a desk, the last one packed with heavy iron weights and carrying a small cyan tag.
On this page

TL;DR

Record the free space, then size the folders one level at a time until a directory belongs to one tool. That tells you which cleanup you need. Clean it with that tool’s own command where it has one, never by deleting files inside a cache a tool manages. Then record the free space again, because a cleanup’s own report isn’t what the disk got back.

Command
PS> Get-Volume -DriveLetter C | Select-Object SizeRemaining, Size
PS> Get-ChildItem -LiteralPath $env:USERPROFILE -Force -Directory | ForEach-Object { [pscustomobject]@{ Name = $_.Name; GiB = [math]::Round((Get-ChildItem -LiteralPath $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1GB, 2) } } | Sort-Object GiB -Descending | Select-Object -First 10

My Windows 10 PC had 586.4 GB free on a 999.0 GB disk, so the disk wasn’t full and nothing was urgent. I measured it anyway. I use it for ComfyUI and Hugging Face models, Steam games and development, and I wanted to know what was there before it became a problem. The largest folder in my user profile was Documents, at 75.86 GiB. Nearly all of it was ComfyUI, and most of that was model checkpoints. Which directory is largest on your PC depends on what you run. The series covers each cause. This is the Windows counterpart of the Mac series, built from readings I took on this PC. The Mac version of this article is What’s Taking Up All the Space on My Developer Mac?.

Record the free space before you start

You check a cleanup by comparing two readings, so take the first one now. Get-Volume reads the volume and changes nothing. C: is the drive Windows lives on; use the letter of the drive you are sizing up:

Command
PS> Get-Volume -DriveLetter C | Select-Object SizeRemaining, Size

Output


SizeRemaining          Size
-------------          ----
 586395574272  999002918912

Tested with

Windows
10 Pro 22H2 (10.0.19045), PowerShell 7
Date
November 2026

Both columns are bytes. Take the reading when the PC is quiet: no update installing, no application downloading, nothing you started still writing. I took this one with no ComfyUI or Python process running. A PC keeps writing while you work, so free space can move between readings. On this one, two readings taken a minute after a first one were each less than 2 MB below it.

Use one unit for every reading. Get-Volume reports bytes, and 586.4 GB and 546.1 GiB are the same free space. In this article, volume figures are GB and folder sizes are GiB (1024 to the third power, which is what 1GB means in PowerShell).

Find what’s taking up space with PowerShell

Each command here reads sizes and changes nothing. A folder that PowerShell can’t read adds nothing to its total, so a size can be too low. The function in step 2 counts those paths instead of hiding them. A size can also be too high: a hard link is a second directory entry for the same file data. PowerShell counts that file in full in every folder that has an entry for it, so two folders can share the same bytes and both report them.

  1. List the size of each folder in your user profile. This is the command from the answer:

    Command
    PS> Get-ChildItem -LiteralPath $env:USERPROFILE -Force -Directory | ForEach-Object { [pscustomobject]@{ Name = $_.Name; GiB = [math]::Round((Get-ChildItem -LiteralPath $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1GB, 2) } } | Sort-Object GiB -Descending | Select-Object -First 10

    On the PC measured here, an inventory of the same folders on 2026-11-01 put Documents first at 75.86 GiB, then AppData at 31.89 GiB, .cache at 6.14 GiB and OneDrive at 5.45 GiB.

  2. Define a function that sizes one level of any path, folders and files together, and counts what it could not read. Then run it on the largest folder, and on the largest folder inside that, until one tool owns the directory:

    PowerShell
    $script:unread = 0
    function Get-FolderSize($root) {
      Get-ChildItem -LiteralPath $root -Force | ForEach-Object {
        $e = $null
        $bytes = if ($_.PSIsContainer) { (Get-ChildItem -LiteralPath $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue -ErrorVariable e | Measure-Object Length -Sum).Sum } else { $_.Length }
        $script:unread += $e.Count
        [pscustomobject]@{ Name = $_.Name; GiB = [math]::Round($bytes / 1GB, 2) }
      } | Sort-Object GiB -Descending | Select-Object -First 8
    }
    Command
    PS> Get-FolderSize "$env:USERPROFILE\Documents"
    PS> "$script:unread paths could not be read"

    Repeat Get-FolderSize on the largest entry it lists. On this PC that was Documents\ComfyUI, where the models folder holds the checkpoints, text encoders and LoRA files.

  3. Check the hidden places, even if they didn’t top the first list. AppData\Local holds the caches that tools keep for themselves. The files at the root of C: include the ones Windows manages, such as hiberfil.sys:

    Command
    PS> Get-FolderSize "$env:USERPROFILE\AppData\Local"
    PS> Get-ChildItem C:\ -Force -File -ErrorAction SilentlyContinue | Select-Object Name, @{ n = 'GiB'; e = { [math]::Round($_.Length / 1GB, 2) } } | Sort-Object GiB -Descending

    On this PC, the 2026-11-01 inventory read hiberfil.sys at 6.38 GiB and pagefile.sys at 2.82 GiB. pagefile.sys changes size; it read 2.38 GiB on 2026-10-30.

  4. For a package manager, ask the tool where its cache is rather than assuming a path. Each command runs only when the tool is on PATH; if PowerShell can’t find it, see Cache command not found:

    Command
    PS> uv cache dir
    PS> python -m pip cache dir

The sizes in the next section come from a separate inventory of known locations on the same PC. It doesn’t drill down level by level, so use it as a checklist of places to look, not as a replacement for the steps earlier.

Match the directory to its cause

This table lists the large directories on this PC and the part of the series that covers each one:

Directory and what fills itSize hereCovered in
Documents\ComfyUI
Model checkpoints (54.65 GiB), text encoders, LoRA files, and one virtual environment
75.86 GiBPart 3 (AI models)
AppData
Per-user application data, including the two caches below
31.89 GiBPart 4 (hidden caches)
.cache\huggingface
Hugging Face model cache; the newest file is from 2023
5.27 GiBPart 3 (AI models)
AppData\Local\uv
The uv cache of ComfyUI Desktop’s bundled uv; at least one of its files is hard-linked into the ComfyUI virtual environment
4.56 GiBPart 4 (hidden caches)
AppData\Local\pip
The pip cache of a Python 3.10 since uninstalled
2.72 GiBPart 4 (hidden caches)
C:\hiberfil.sys
The hibernation file
6.38 GiBPart 6 (Windows itself)
Component store, WinSxS
Windows system components; DISM reports the real size and needs an elevated session; read two days earlier
11.76 GBPart 6 (Windows itself)
C:\Windows\SoftwareDistribution\Download
Windows Update downloads
1.15 GiBPart 6 (Windows itself)
C:\Windows\Installer
Installer files that Windows keeps
1.07 GiBPart 6 (Windows itself)
C:\$Recycle.Bin
Held nine crash dumps (178.8 MB, 0.17 GiB) on 2026-10-30 before it was emptied, and 129 bytes right after; the size here is the later inventory’s reading
0.02 GiBPart 2 (crash dumps)
C:\ProgramData\NVIDIA Corporation\Downloader
NVIDIA app downloads
2.41 GiBPart 5 (gaming)
Steam library
Mostly on another drive; 0.62 GiB on C:, with shader and web caches under 1 GiB each
0.62 GiB on C:Part 5 (gaming)

The rows overlap. Of the 3.96 GiB in the ComfyUI virtual environment’s site-packages, 3.87 GiB are in files with more than one hard link. On the one file I checked, the other link was in the uv cache. A hard-linked file counts in full in both the Documents\ComfyUI row and the uv row, so clearing the uv cache can free much less than its folder total. Part 4 measures how much.

The numbers move between runs. One ComfyUI update grew the uv cache from 3.55 to 4.56 GiB. Quote the reading you took, not one from this table.

Some directories stay whatever their size:

  • Model files you still use. A checkpoint isn’t a cache.
  • A Steam library. It holds installed games, not leftovers.
  • OneDrive and iCloudDrive. Both sync with online storage. OneDrive is a reparse point here: its files can be placeholders for files stored online, so neither folder’s size is a cleanup target.
  • C:\Windows\Installer and the component store. Do not delete files from either by hand. Windows manages both, and part 6 (Windows itself) covers the commands that do.

Docker and WSL aren’t covered in this series. Docker Desktop and any WSL distribution are absent on this PC (only Windows’ built-in wsl.exe stub is present), so this article has no readings for them.

Record the free space again

Run the same command you started with:

Command
PS> Get-Volume -DriveLetter C | Select-Object SizeRemaining, Size

Compare the new figure with the first reading, not with the size of what you removed; only the volume’s figure says what the disk got back. Emptying the bin freed no space shows a cleanup where the two differed.

Do this with a coding agent

Paste this prompt into your own local coding agent. It measures and reports, and it changes nothing:

Text
Find what is taking up space on this Windows PC's system drive. Measure and
report only. Delete, move or clean nothing, and stop and ask me before any
change. Use PowerShell. Do not run elevated commands unless I ask. Do not
open, move or change files in model folders, game libraries or the Hugging Face
cache. You may size them, but do not suggest deleting their contents.

1. Record free space on C: first with Get-Volume -DriveLetter C
   (SizeRemaining, Size). Say that the figures are bytes, and use one unit for
   every size you report.
2. List the size of each folder in my user profile, then do the same on the
   largest folder inside it, one level at a time, until each large directory
   belongs to one tool. In this step do not recurse into ComfyUI, models,
   checkpoints, .cache\huggingface, Steam or any game library; report each by
   size as a whole and map it to part 3 (models) or part 5 (games) by name.
   Also check AppData\Local and the files at the root of C:. Count the paths
   you could not read, and say that a size can be too low because of them, or
   too high because a hard-linked file counts in every folder that links it.
   Ask package managers for their cache paths (for example uv cache dir or
   python -m pip cache dir) instead of assuming them, and say so if a tool is
   not on PATH.
3. For each measured directory over 1 GiB, report a table with its size, which
   tool owns it, what fills it, and that tool's own cleanup command if it has
   one.
4. Mark anything that is in use or holds work: a running application that has
   files open there, an update in progress, a game launcher, a project with
   uncommitted changes. Say what would be lost if each were removed.
5. Treat OneDrive and iCloud folders as placeholders for online files and do
   not scan them for cleanup.
6. End by naming which part of the series applies to each large folder: part 2
   for crash dumps and error reports, part 3 for AI models, part 4 for hidden
   uv and pip caches, part 5 for gaming, part 6 for Windows itself.

Then stop and wait. I will choose what to clean.

Common failures

Emptying the bin freed no space

I emptied the bin with Clear-RecycleBin -DriveLetter C -Force. It held nine crash dumps, 178.8 MB. Get-Volume read 581,462,724,608 bytes before and 581,462,724,608 after. One minute later, two more readings were each less than 2 MB below the first, and the $Recycle.Bin folder was down to 129 bytes. Free space didn’t rise.

The cause isn’t established, and the evidence points away from restore points. In a controlled test, I created a 1 GiB file, deleted it and read Get-Volume, with and without a shadow copy newer than the file, and the space came back at once both times. The dumps are gone, so the original run can’t be repeated.

Do not delete shadow copies to make the number move. They are the restore points System Restore uses.

Cache command not found

On this PC, neither uv nor python is on PATH, the list of folders PowerShell searches for a command, so neither command can find a tool to run. The cache folders exist all the same: AppData\Local\uv at 4.56 GiB and AppData\Local\pip at 2.72 GiB. A cache can belong to a copy of a tool that an application bundles, or to a tool you’ve since uninstalled. Here there’s one of each. The uv cache belongs to the copy of uv that ComfyUI Desktop bundles, which its log shows running uv pip install --dry-run at the start of an update, and whose cache gained files during that update. The pip cache belongs to a Python 3.10 installed in 2022 and since uninstalled; its newest file is from January 2023, and nothing on the PC uses it. Size the folder with Get-FolderSize, as in step 2, and treat the owner as unconfirmed until you find the tool that wrote it.

New articles, by email.

A short note when something new is published.