Background-task cleanup leaves orphaned find.exe processes on Windows (Git Bash/MSYS)
Environment: Windows, Claude Code 2.1.252, Git for Windows.
Summary
On 2 September 2026, three Claude Code subagents launched broad Git Bash searches:
find / -iname "bats" -type ffind / -iname "*br.public.avm.res.network.virtual-network*"find / -iname "keyvault*" -path "*azure*cli*"
Each command exceeded Claude's 120-second foreground timeout and was moved to the background. Claude later recorded each background task as killed, but the underlying C:\Program Files\Git\usr\bin\find.exe process remained alive after its wrapper and parent process exited.
The orphaned processes were PIDs 39536, 48920, and 50272. Each consumed one full logical processor, together using about 13.5% of total CPU capacity and keeping the laptop fan running. They continued for several hours until manually terminated.
Observed
- All three commands came from Claude Code subagent session logs.
- Claude reported their background tasks as killed.
- The three
find.exeprocesses remained alive with parent process IDs that no longer existed. - Windows confirmed that CPU and fan activity settled after the processes were terminated.
Likely cause
Claude stopped the Bash wrapper or tracked background task without terminating the complete Windows/MSYS child-process tree.
Requested fixes
- Ensure timeout and cancellation terminate every descendant process on Windows, potentially using a Windows job object or verified process-tree termination.
- Confirm that descendants are gone before reporting a background task as killed.
- Avoid unrestricted
find /searches. Search a bounded directory withrg,rg --files, or a similarly scoped command. - Add a regression test covering an MSYS/Git Bash pipeline whose child process survives after the wrapper exits.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗