DashboardcliSymlink traps in recursive collection a…

Symlink traps in recursive collection and worktree dependencies

Category: gotcha
Confidence: 0.90
ID: 01a08bab-3b6e-75c3-9925-075b076afddc
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 0
Source session: 12na8hXrpthm52Hlq
Created: 2026-06-24 18:36:02
Updated: 2026-09-10 14:14:10

Content

Recursive file collection must use lstat, skip symlinked directories, and track visited realpaths; ancestor-pointing directory symlinks otherwise recurse forever, especially in macOS framework and dSYM trees. File symlinks may still be followed. Separately, a worktree node_modules symlink is safe only when both worktrees share the same branch and lockfile. Otherwise esbuild can fail with Host version X does not match binary version Y; remove the symlink and run pnpm install in the affected worktree.

Move to: