BaCheWork and records of a photonics research workhorse
Language

Claude Code makes my computer slow: processes that won't close and temp files that keep piling up

A Claude Code session finishes, but the processes behind it often stay open, and nobody deletes the temp folder. This note records how I noticed, how I traced it layer by layer to its causes, and where to look if you want to check for yourself.

Type
Essay
Published
2026-11-11
Updated
2026-11-11

I like to run several Claude Code sessions at once for different tasks. After a while I noticed that the computer gets slower the longer it stays on, and when I opened Task Manager there was a long row of Claude entries. Only a few sessions were showing in my sidebar, yet a large chunk of memory was taken.

Tracing it further, the problem split into two: processes that will not close, and temp files that nobody deletes. Neither reports an error; both just pile up slowly.

What follows is what I observed on my own Windows machine between October and November 2026. Claude Code updates quickly, and newer versions may already behave differently, so go by what you measure yourself.

Conclusions first

  • Ending a session does not end its processes. Behind each session is its own process. Even after the work is done, or the session is archived, that process may still be running and holding memory.
  • A tree of child processes hangs underneath. The shells that run commands, the hook scripts, and the Chrome instances launched by browser automation: some follow the main process, and some do not.
  • Nobody cleans up the temp folder. Each session has its own temp folder, and it stays where it is after the session ends; it may contain copies of your files.
  • Any cleanup tool you write also needs checking. I wrote an automatic reclaim tool, and later found that most of the time it was failing silently.

1. How I noticed it: more Claude in Task Manager than in the sidebar

The most direct clue was a mismatch in the count. Once I counted 23 claude.exe processes, adding up to roughly 8.2 GB; another time there were 25, and after clearing the leftovers they dropped to 13, and only then did available memory recover to 17.0 GB out of 31.2 GB. The sessions actually in use in the sidebar were far fewer than that.

The desktop app’s architecture is one main desktop program, plus one engine process per session. So the number of claude.exe processes is roughly “the main program count plus the number of live session engines.” A number far above the sessions you are actually using means some engines were never shut down.

2. Tracing the cause: following the parent-child relationships layer by layer

Counts alone are not enough; I needed to know whose each process is. What I did was pull each process’s parent process and full command line, arrange them into a tree, and match each branch to the session that started it. Following it down, I found several kinds of leftovers:

  1. Idle session engines. The session finished long ago, but the engine is still running, together with the node processes and Chrome launched by Playwright beneath it, all still holding memory.
  2. Shells from the terminal panel. Shells opened by the desktop app’s built-in terminal tab are not attached under the engine, so ending the engine does not end them. In one case, clearing just this kind turned up 24 processes.
  3. Orphans whose parent is already gone. node, python (hook scripts), conhost, and powershell processes that survive after their parent process has exited.
  4. Sessions that were archived while their engine kept running. They disappear from the sidebar, but still hold memory.

3. My automatic reclaim mostly fails silently

Knowing the cause, I wrote a mechanism that reclaims itself at wrap-up, plus a background process that cleans up on a schedule. It seemed to work, until one time I cleared the leftovers by hand and, while looking into why there were still so many, found:

  • Of the 12 leftover engines, 11 did run self-reclamation at wrap-up, but all of them failed. Among them, nine waited 15 minutes and timed out; one hit a program error, yet was recorded as “engine already gone,” so a failure was logged as a success.
  • The scheduled cleanup process reported “cannot read last activity time” for every session, so it never reclaimed a single one.

What I learned: the cleanup tool is itself something to be monitored. Its claim that it cleaned up should be checkable against whether the processes are actually still there; otherwise the log says success while memory keeps getting consumed.

4. Temp files: one folder per session, left in place after it ends

Claude Code gives each session a temp folder, under %LOCALAPPDATA%\Temp\claude\, grouped by project and then by session. Conversion output, backups, screenshots, and background command output all go here.

I had assumed these were deleted automatically at wrap-up, but checking showed they were not. When I checked at the end of October, one project had already piled up folders from 13 old sessions. Measured again today, the whole folder comes to 1.2 GB.

Besides the space, there is a privacy issue: the temp folder may hold copies of your files, for example a backup made while processing a document. The file stays there, and you may not remember it.

One more easy trap: on Windows, the desktop app is a packaged App, so the AppData that Claude’s own shell sees may differ from what you see in your own terminal. On the same day I counted the folders under Temp\claude using both shells: one side showed 319, the other 106. If you check, look at both sides.

5. If you want to check for yourself, look in these places

No ready-made script is given here; I only list the clues I actually used to find the problem. Following them should let you find the state of your own computer.

Memory and processes

  • In Task Manager’s Details tab, sort by name, count how many claude.exe there are, and compare that with the number of sessions open in your sidebar.
  • To see parent-child relationships and command lines, PowerShell’s Win32_Process class (queried with Get-CimInstance) has ParentProcessId and CommandLine fields, enough to lay out the tree.
  • Pay particular attention to node, python, conhost, powershell, and chrome processes whose parent no longer exists.
  • Before you end any process, double-check its process name and start time. Windows reuses PIDs, so going by PID alone could close a different program.
  • Closing a session engine that is open on screen makes the desktop app report that it crashed. This is expected; you have not broken anything.

Temp files

  • Open %LOCALAPPDATA%\Temp\claude\, sort by modified date, and see how many old folders there are.
  • Before deleting, look inside for any results that exist only there, such as output files not yet moved elsewhere.
  • Check once with Claude’s shell and once with your own shell; if the two numbers differ, go by what you see yourself before deciding whether to delete.

Closing

Neither problem shows an error message; they just slowly make the computer sluggish and the disk slowly fill up. My approach is to treat them as items to check regularly: count the processes, measure the temp folder, and compare against how things looked when they were normal.