{"version":"2.1.324","anchor":"worktree-entry-gets-symlink-guard-and-canonical-path-handlin","canonical_anchor":"worktree-entry-gets-symlink-guard-and-canonical-path-handlin","heading":"Entering a worktree refuses a path that leads elsewhere through a symlink","tier":"notice","area":"Worktrees","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/worktree-entry-gets-symlink-guard-and-canonical-path-handlin","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### Entering a worktree refuses a path that leads elsewhere through a symlink\n\nWhen a feature switch is on, the EnterWorktree tool fails instead of moving the session if the worktree path leads to another folder through a symlink\n\n**What**\n\nA worktree is a second working copy of a git repository, kept in its own folder so work can happen there without touching the main copy. `EnterWorktree` is the tool Claude uses to move a session (one running conversation with Claude Code) into a worktree.\n\nThe tool now checks whether the new worktree folder actually leads to some other folder through a symlink, a shortcut on disk that points to another location. If it does, the session stays where it is and the tool fails with a message saying nothing was removed and asking Claude to tell you. If you use a `WorktreeCreate` hook (your own script that creates worktrees), it has to print the folder's real path, not a shortcut to it.\n\nThis check, and the way Claude Code now works out a worktree's real path, only run when a feature switch is on.\n\n**Why**\n\nIt stops a worktree path from quietly pointing the session at a folder outside the ones it is allowed to work in.\n\n- Area: Worktrees\n- Names: `EnterWorktree`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}