Background-task cleanup leaves orphaned find.exe processes on Windows (Git Bash/MSYS)

Status Open
Reported on v2.1.252
Maintainer reply None cached
Activity 5 comments · opened Sep 2, 2026

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 f
  • find / -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.exe processes 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

  1. Ensure timeout and cancellation terminate every descendant process on Windows, potentially using a Windows job object or verified process-tree termination.
  2. Confirm that descendants are gone before reporting a background task as killed.
  3. Avoid unrestricted find / searches. Search a bounded directory with rg, rg --files, or a similarly scoped command.
  4. Add a regression test covering an MSYS/Git Bash pipeline whose child process survives after the wrapper exits.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗