Worktree-origin resolution keeps spawning git against deleted directories, breaking spawn_task chip launches (~10% failure rate)

Status Open
Maintainer reply None cached
Activity 1 comment · opened Sep 2, 2026

When creating a worktree for a new session or a spawn_task-suggested chip, Claude Desktop resolves the "create from" source through a fixed ancestor-origin path rather than the spawning session's live current worktree — and never validates that path still exists before shelling out to git with it as cwd. When the origin directory has since been deleted, every git command fails with spawnErrno: ENOENT (Node's child_process.spawn failing on a nonexistent cwd — /usr/bin/git itself is present and functional), the worktree creation cascades into a "not a git repository" / "use base directory" fallback, and the chip launch fails client-side with the generic "Couldn't start the suggested task."

Measured from local ~/Library/Logs/Claude/main*.log (2026-08-22 to 2026-09-02):

  • Chip launches (LocalSessions.popBackgroundTaskSuggestionById): 60 succeeded, 7 failed (~10.4%)
  • Every failure is preceded within seconds by a Git command failed: ... spawnErrno: 'ENOENT' burst
  • 6 of 8 distinct worktree-origin paths resolved in this window no longer exist on disk, yet were still resolved to 30+ times as a spawn source (up to 13 hits on one dead path)
  • Archiving the session that first surfaced this does not fix it — unrelated sessions independently resolve to the same dead origin anchors

Expected: worktree creation validates the origin cwd exists before spawning git, and falls back to a live ancestor (or a fresh clone) instead of silently degrading to a non-worktree session or failing the launch outright. Dead origin entries should also get evicted rather than retried indefinitely.

Environment: macOS, Claude Desktop, local sessions with a large number of concurrently active worktrees (~50+).

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗