AIToday
AI Coding AssistantsZenn AI/MLPublished: Nov 28, 2026, 10:01 JST

Claude Code 2.1.330 on Windows leaves 5 processes alive after TaskStop

Send on LINE
Claude Code 2.1.330 on Windows leaves 5 processes alive after TaskStop

3 Key Points

  1. What happened

    The author ran three background commands via claude -p on Windows 11 with Claude Code 2.1.330, stopped the task with TaskStop, and three seconds later all five resulting processes — including sleep.exe 123 and cat.exe — were still alive.

  2. Why it matters

    A stop command that reports STOPPED while spawned processes keep running means a user cannot rely on it to actually end a background job, and the leftovers here only disappear on their own because they were short sleeps.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

The bug traces to how Git Bash (MSYS2) launches commands on Windows. According to the issue's explanation, Claude Code stops a background Bash task with Windows' taskkill /T, which finds children by following Windows' record of the parent process. Git Bash first creates a copy of itself, that copy starts the command as a separate process, and the copy exits immediately — so from Windows' point of view the command's parent no longer exists and taskkill /T cannot see it. The author notes they did not verify that mechanism themselves, only the resulting behavior.

The practical exposure depends on what is left behind. Short commands like sleep end on their own within minutes, but a monitoring loop such as 'tail -f log | grep error', a 'while true; do ...; sleep 30; done' loop, or an ssh connection would persist. The issue reporter described several hundred such leftovers accumulating until a 64GB machine became unusable and had to be force-restarted twice, and the author notes that a setup running claude -p every night would add to the pile on each run.

A partial mitigation the author tested: running 'timeout 20 sleep 301' in background Bash and stopping it with TaskStop left timeout and sleep alive, but both disappeared after 20 seconds. The author did not test whether wrapping a shell construct like a while loop as 'timeout 600 bash -c \'...\'' stops the inner work as well.

FAQ
Which commands were left running after TaskStop?
The five processes were sleep.exe 123, timeout.exe 124 sleep 122, the inner sleep.exe 122, sleep.exe 125 and cat.exe. All five were still listed three seconds after claude -p exited.
How can I find leftover Git Bash processes on my own machine?
List running processes whose ExecutablePath matches '*\Git\usr\bin\*' using Get-CimInstance Win32_Process, then inspect the CommandLine column for unfamiliar tail, sleep or ssh entries. Stop them one at a time with Stop-Process -Id after checking the ProcessId.
What is the recommended workaround?
Avoid running commands that never end in background Bash; if you must, attach a timeout such as 'timeout 600 tail -f ...' so the command ends by itself. For unattended runs, log the process list after each run and note the rule in CLAUDE.md.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAI voices spur false police reports in US, NPR says