Find and stop processes an agent left behind
Agents start shells, watchers and dev servers, and do not always stop them. One wait loop that started a tail -f per turn left 1,167 orphans, about a thousand console helpers and 6 GB of memory in one night.
Checked 29 November 2026
Find them
# the programs with the most copies
Get-Process | Group-Object ProcessName | Sort-Object Count -Descending | Select-Object -First 10 Count, Name
# processes whose parent is gone
$ids = (Get-Process).Id
Get-CimInstance Win32_Process | Where-Object { $ids -notcontains $_.ParentProcessId } | Select-Object ProcessId, Name, CreationDateThe second list is a rough first look: some system processes have no parent by design, and Windows reuses process ids, so check a name before stopping it.
Contain them
Windows has a tool for this: a job object. Processes started inside a job stay members after their parent exits, a job can cap how many processes it holds, and closing it can end everything in it. A terminal whose shell runs in a job can always be cleaned up completely.
With Ourkite Bot
Every terminal runs in its own job with a hard ceiling of 2,000 processes, and is counted every 30 seconds. Past 150 processes, 40 copies of one program, 25 orphans, 2 GB of memory or one process hot for ten minutes, you see where and why, and Clean up stops only the orphans and the over-represented program, never the shell or the agent.
Try the preview
The preview is shared by email while the signed installer is prepared. Tell us how many agents you run and what you would want first.
- Windows 10 or 11, 64-bit
- Claude Code, signed in
- git
Windows 10 and 11 · Claude Code · early preview