Skip to content

Windows: cancelled status line leaves git processes suspended forever #60

Open

Description

@LairdLuca

What happens

On Windows, statusline.ps1 slowly leaks git.exe processes. I found 734 of them after five days of normal use (several Claude Code sessions in parallel). Each one is stuck on rev-parse --abbrev-ref HEAD or diff --numstat, with:

  • a single thread in state Wait/Suspended
  • 0 seconds of CPU time
  • a parent process that no longer exists

They never exit on their own. Each costs about 0.9 MB of private memory plus a process slot.

Cause

Claude Code cancels an in-flight status line when a new update arrives (docs). Windows creates a child process suspended and the parent resumes it right after. If the parent is killed between those two steps, nothing ever resumes the child.

The script is exposed to this because PowerShell startup plus two git calls takes a few seconds, so cancellations are frequent.

Reproduction

A script that only runs the same two git commands in a loop, killed at a random moment between 1.5 and 4.5 seconds:

Scenario Runs Suspended git left behind
Not killed (each run completes) 10 0
Killed 60 4

Environment: Windows 11, Windows PowerShell 5.1, git 2.55.0.windows.5, status line v1.4.4 (the git calls are unchanged in v1.4.5).

A fix follows in a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions