{"version":"2.1.323","anchor":"worktree-exit-falls-back-to-the-folder-from-before-enterwork","canonical_anchor":"worktree-exit-falls-back-to-the-folder-from-before-enterwork","heading":"Leaving a worktree falls back to your earlier folder instead of staying put","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323\/e\/worktree-exit-falls-back-to-the-folder-from-before-enterwork","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323","markdown":"### Leaving a worktree falls back to your earlier folder instead of staying put\n\nIf Claude Code cannot return to the recorded original folder when leaving a worktree, it now tries the folder from before EnterWorktree\n\n**What**\n\nWhen a session leaves a worktree, Claude Code goes back to the folder it recorded as the original. It used to stay where it was if that recorded folder was written as a network path. Now, if the recorded folder is a network path or cannot be entered, Claude Code tries the folder the session was in before EnterWorktree ran. It logs a note when it does this.\n\nWhen a session is resumed, Claude Code also records the checkout and folder it was launched from.\n\n**Why**\n\nThis stops a session from being left inside a worktree that has already been deleted.\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: no"}