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:
- Start Claude Code in
/home/user/repos/my-project - Rename the folder:
mv my-project my-project-renamed - Try to run any Bash command in Claude Code
- All commands fail with "Path does not exist"
Requested Improvements
- Detect stale working directory - When the working directory no longer exists, prompt the user to update it rather than failing silently on every command.
- Allow mid-session directory change - Provide a command (e.g.,
/cdor/chdir) to update the project root without restarting the session.
- 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-kv → aistor-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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗