You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Name the Shared Stash as a Cross-Worktree Hazard in the Worktree Isolation Rule #2896
git stash keeps one stash list per repository, in refs/stash, and every worktree of that repository shares it. A git stash pop in one worktree pops the newest entry, which can belong to a task in another worktree.
Constructed sequence, two worktrees of one repository:
Worktree A runs git stash push, parking an edit to a.py.
Worktree B runs git stash push, parking an edit to b.py.
Worktree A runs git stash pop, and its tree receives B's b.py edit, since that entry is newest.
Worktree B later pops A's a.py edit into its own tree.
Neither the repo-worktree skill nor GOVERNANCE.md "Repository Boundaries and Write Safety" names the stash. Both say a worktree isolates a task. A reader reasonably takes that to cover every git state the task touches.
Impact
Parallel lanes in worktrees of one repository cross stashes silently. The receiving tree gains a foreign edit, which a blanket or careless add would commit. The owning tree loses its parked work unless the work was already committed. Both failures are the cross-task contamination that worktree isolation exists to prevent.
Suggested fix
State in the repo-worktree skill, as part of the isolation rule, that the stash is shared per repository and never per worktree, so a task in a worktree does not use git stash. It commits work in progress on its own branch or copies a file to a scratch directory of its own instead. Consider whether GOVERNANCE.md "Repository Boundaries and Write Safety" names it alongside the blanket add and the hard reset as an operation that crosses the task boundary.
Activity
State That a Worktree Does Not Use the Shared Git Stash (#2899)
Promote the Stash, D4.1 Guard, Citation, and Handoff Read Fixes to Ma…