Merge pull request #2206 from bethaniamh/fix-wing-worktree

fix(hooks): derive wing from project, not the git-worktree dir
This commit is contained in:
Igor Lins e Silva 2026-08-11 07:05:12 -03:00 committed by GitHub
commit fb0312f6c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -1226,6 +1226,12 @@ def _wing_from_jsonl_cwd(transcript_path: str) -> Optional[str]:
cwd_norm = cwd.replace("\\", "/").rstrip("/")
if not cwd_norm:
continue
# A cwd inside "<project>/.claude/worktrees/<wt>" (a git
# worktree) belongs to <project>, not the ephemeral worktree
# directory -- otherwise every worktree spawns its own wing.
_wt_marker = "/.claude/worktrees/"
if _wt_marker in cwd_norm:
cwd_norm = cwd_norm.split(_wt_marker, 1)[0]
project = cwd_norm.rsplit("/", 1)[-1]
if project:
return f"wing_{_safe_wing_slug(project)}"