{"version":"2.1.236","anchor":"changing-directory-no-longer-leaves-a-stale-working-director","canonical_anchor":"changing-directory-no-longer-leaves-a-stale-working-director","heading":"Changing directory no longer leaves a stale working directory behind","tier":"notice","area":"Working Directory","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.236\/e\/changing-directory-no-longer-leaves-a-stale-working-director","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.236","markdown":"### Changing directory no longer leaves a stale working directory behind\n\nDirectory changes from resume, sandbox, deep links and worktrees no longer leave a stale path behind.\n\n**What**\n\nWorktree cleanup and switching, session resume, sandbox startup, deep links and CLI boot all changed directory directly before. They now go through one helper that changes directory and then immediately re-reads it, which refreshes Node's cached working directory and surfaces a deleted target right away instead of leaving a stale path to fail later.\n\n**Details**\n\n- The re-read is wrapped so a vanished directory is swallowed rather than crashing the path that moved.\n- Worktree cleanup failure still reports as \"Could not chdir to original directory while cleaning up worktree\".\n- Logging switched from reading the cwd directly to a getter with a fallback.\n\n**Evidence**\n\n`Could not chdir to original directory while cleaning up worktree`, `process.chdir`, `function MI(e) {\\n process.chdir(e);`, `process.chdir(e);`\n\n- Area: Working Directory\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5"}