Skip to main content

Module busy

Module busy 

Source
Expand description

Busy detection: determine whether a worktree is currently in use.

Two signals are combined:

  1. Session lockfile (explicit — gw shell/gw start write one)
  2. Process cwd scan (implicit — catches external cd + tool usage)

The current process and its ancestor chain are excluded so that Claude Code or a parent shell invoking gw delete on its own worktree does not self-detect as busy.

Structs§

BusyInfo
Information about a single process holding a worktree busy.

Enums§

BusySource
Signal source that flagged a process as busy.

Functions§

detect_busy
Detect busy processes for a given worktree path.
self_process_tree
Returns the current process + all ancestor PIDs (via getppid chain). Memoized for the lifetime of the process — the ancestry does not change during a single gw invocation.