Feature: Handle project root directory renames gracefully

Resolved 💬 3 comments Opened Jan 20, 2026 by harshavardhana Closed Jan 24, 2026

Problem

When the project root folder is renamed during a Claude Code session, all Bash commands fail with "Path does not exist" error. The session becomes unusable and must be restarted.

Steps to reproduce:

  1. Start Claude Code in /home/user/repos/my-project
  2. Rename the folder: mv my-project my-project-renamed
  3. Try to run any Bash command in Claude Code
  4. All commands fail with "Path does not exist"

Requested Improvements

  1. Detect stale working directory - When the working directory no longer exists, prompt the user to update it rather than failing silently on every command.
  1. Allow mid-session directory change - Provide a command (e.g., /cd or /chdir) to update the project root without restarting the session.
  1. Suggest renamed paths - If the parent directory exists but the specific folder is gone, check for similarly-named folders and suggest them as alternatives.

Use Case

This is common during refactoring when renaming a project (e.g., aistor-kvaistor-icms). Currently, users must:

  • Save their progress/context manually
  • Exit the session
  • Start a new session in the renamed directory
  • Manually restore context

A graceful handling of directory renames would make these workflows much smoother.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗