Expand description
Busy detection: determine whether a worktree is currently in use.
Two signals are combined:
- Session lockfile (explicit —
gw shell/gw startwrite one) - 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§
- Busy
Info - Information about a single process holding a worktree busy.
Enums§
- Busy
Source - 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
gwinvocation.