Claude Code was using 139 GB of my disk. Only 4 GB was in .claude

Spoiler: 87 GB of it was the same 31 MB file, copied 2,852 times.


I right-clicked C:\Users\me\.claude, hit Properties, and got 4.19 GB across 20,165 files. My first reaction was everyone's first reaction: what is this, and can I delete it?

There are already good posts about what lives in ~/.claude. They're all written from a Mac. On Windows, .claude turned out to be the small part. So I had Claude Code measure its own footprint. Here's what it found, and how I cleaned it up.


Claude Code writes to four places on Windows

Paste this into PowerShell. It takes a minute or two if you have as much junk as I did:

$places = "$env:USERPROFILE\.claude", "$env:TEMP\claude", "$env:APPDATA\Claude", "$env:USERPROFILE\.local\share\claude"
foreach ($p in $places) {
  if (Test-Path $p) {
    $s = (Get-ChildItem $p -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum
    "{0,8:N1} GB  {1}" -f ($s/1GB), $p
  }
}
FolderWhat it holdsSize
%USERPROFILE%\.claudeTranscripts, settings, skills, plugins, memory4.2 GB
%TEMP%\claudeA scratchpad and task output for every session124.9 GB
%APPDATA%\ClaudeThe Claude desktop app, including its Cowork VM image9.3 GB
%USERPROFILE%\.local\share\claudeNative installer: one binary per version0.7 GB
Total~139 GB

The folder everyone writes about was 3% of the total.


117 GB from a single session

Almost all of %TEMP%\claude came from one folder: one session in my astrology side project, three days of work in October. Its scratchpad held 646,411 files.

Claude Code gives every session a scratchpad, a temp folder where the agent is told to put intermediate files. That session was testing chart rendering variants. For each variant, the agent copied the app folder into the scratchpad and opened a fresh headless Chrome to screenshot it.

The app folder contains de440s.bsp, NASA JPL's planetary ephemeris: 31 MB of binary data that tells you where Mars was in 1987. The result:

  • 2,852 copies of de440s.bsp: 86.9 GB
  • 366 throwaway Chrome profiles: 9.9 GB
  • The other ~20 GB: 150,000 HTML files, 23,000 PNGs, 3,000 SQLite databases and more

Nothing was broken. The agent did exactly what it was told: put temporary files in the temporary folder. Nobody told it that a 31 MB file shouldn't be copied 2,852 times.


Why the built-in cleanup didn't catch it

Claude Code has a cleanup sweep. It deletes transcripts and session data older than cleanupPeriodDays (default: 30 days). It works: while I was measuring, the sweep ran and projects/ dropped from 3.6 GB to 2.1 GB on its own.

But according to the docs, scratchpad files "last as long as the session's transcript". The scratchpad goes when its transcript goes. That session was eight days old. With the default setting, those 117 GB would have sat there until late November. Setting cleanupPeriodDays to 14 wouldn't have helped either.

The docs also say the operating system can clear the temp folder, "such as on restart". Windows didn't. I still had folders from December 2025 in there, left over from sessions whose transcripts were long gone.


What's actually in .claude

  • projects/: every session transcript, as a .jsonl file. My biggest was 268 MB. Deleting one only costs you /resume for that session.
  • projects/<project>/memory/: Claude's auto memory, the notes it keeps across sessions. The sweep never touches it. Don't you either.
  • skills/: 470 MB for me, but 463 MB of that was one skill's Python .venv with 12,615 files. That's where most of the "20,165 files" came from.
  • file-history/: copies of files Claude edited, so you can rewind. 85 MB.
  • settings.json, .credentials.json, plugins/ and ~/.claude.json: keep. The docs explicitly say not to delete them.

One trap: claude purge <path> cleans up a project's state, but it deletes that project's auto memory too. Run it with --dry-run first. It also doesn't touch the temp folder, where my 117 GB was.


The cleanup, step by step

1. Find the weight. The PowerShell snippet above gives you totals. For the details I use Everything: turn on Tools → Options → Indexes → Index folder size, then search temp\claude\ size:>20mb and sort by name. The same filename hundreds of times means an agent was copying something. Searching de440s.bsp found all 2,852 copies in under a second.

2. Delete the temp folder. Close every Claude Code session first (terminal, VS Code, desktop app), and copy out anything from a scratchpad you actually want to keep. Then run:

Remove-Item "$env:TEMP\claude" -Recurse -Force

Claude Code recreates the folder when it needs it. PowerShell beats Explorer here: Explorer chokes on 600,000 files and tries to fit 117 GB into the Recycle Bin.

If something refuses with "file in use", use PowerToys File Locksmith: right-click the folder, choose Unlock with File Locksmith, and it shows which process holds the lock (typically a leftover headless Chrome or Node) and lets you end it.

3. Remove old binaries. The native installer keeps previous versions. Run claude --version, then delete the other folders in %USERPROFILE%\.local\share\claude\versions. That freed 460 MB for me.

4. Optional: move the temp tree off C:. Set the CLAUDE_CODE_TMPDIR environment variable to a folder on a bigger drive, and the whole scratchpad tree lives there instead.

5. Leave %APPDATA%\Claude\vm_bundles alone if you use Cowork. It's the desktop app's 7.3 GB Linux VM image, there's only one copy, and deleting it means downloading it again.


The real fix: one paragraph in CLAUDE.md

Cleaning up is a one-off. Next week the agent will do the same thing again. So the project's CLAUDE.md gets this:

## Scratchpad hygiene
- Never copy app/data/ into the scratchpad. Reference the repo path instead (de440s.bsp is 31 MB).
- Headless Chrome: reuse one --user-data-dir, or delete it after the screenshot.
- Before you finish a task, delete what you created in the scratchpad.

Three lines. The agent reads them every session, which is more than I can say for my own notes.


WSL: the opposite surprise

I also run Claude Code in WSL, so I expected a second mess there. ~/.claude was 124 MB, and there was no Claude temp folder at all. My heavy agent work runs on the Windows side, and that's where the junk piled up. To check yours:

du -sh ~/.claude ${TMPDIR:-/tmp}/claude* 2>/dev/null

Before and after

FolderBeforeAfter
%TEMP%\claude124.9 GBTBD
.claude4.2 GBTBD
.local\share\claude0.7 GBTBD
%APPDATA%\Claude9.3 GB9.3 GB (left alone)
Total~139 GBTBD

What I take from it

Agents have no sense of disk space. They copy whatever they're pointed at, as many times as the task needs, into whatever folder you call temporary. Check %TEMP%\claude after any long agent session, and use CLAUDE.md to tell the agent what not to copy.

If you're putting AI agents to work in your business and want them set up so they don't quietly fill your disks (or worse), that's what I do: AI business automation.

The full list of what lives in .claude, and what the sweep covers, is in the official docs: Claude Code, the .claude directory.

Tools used: Everything to find the files, PowerToys File Locksmith for the locked ones, and LICEcap for the GIFs in this post.

Thank you for reading.




← Back to Blog Index