"Folder no longer exists" when project paths change — no recovery path, requires manual binary DB edits
Summary
When a project folder is moved or renamed, Claude Code shows \"Folder no longer exists. Please start a new session.\" for all affected sessions. There is no UI to remap or recover them. The only fix requires manually editing binary LevelDB files, a JSON session store, and a worktrees registry — none of which are documented or user-accessible.
Steps to Reproduce
- Have several projects with session history in Claude Code
- Move or rename one or more project folders (e.g.
~/Projects/MyApp→~/Code/MyApp) - Reopen Claude Code
- All sessions for the moved projects show \"Folder no longer exists. Please start a new session.\"
Expected Behavior
Claude Code should either:
- Detect the move (e.g. via inode tracking or git remote matching) and update paths automatically, or
- Prompt the user to locate the new folder when a missing path is detected, then remap all affected sessions, or
- At minimum, provide a settings UI to remap a stale project path to a new location
Actual Behavior
The error is shown with no recovery option. Clicking the session does nothing useful. There is no way to fix this through any Claude Code UI or documented command.
Why This Is Hard to Fix Manually
Paths are stored in at least 4 separate locations, some of which are binary:
| Location | Format | Contains |
|---|---|---|
| ~/.claude.json | JSON | Project registry (keys = paths) |
| ~/.claude/projects/{encoded-path}/*.jsonl | JSONL | Every message in every session has a cwd field |
| ~/Library/Application Support/claude/Local Storage/leveldb/ | Binary LevelDB | Per-tab cc-session-cwd-local_{id} keys with \x01-prefixed values |
| ~/Library/Application Support/claude/git-worktrees.json | JSON | Worktree path registry |
The LevelDB store is the primary trigger for the error message. Editing it requires:
- Installing
classic-levelvia npm - Writing a Node.js script to iterate and patch entries
- Understanding that values have a
\x01(SOH) prefix byte inherited from Chromium's localStorage encoding - Closing Claude Code first to release the lock, then patching, then reopening
This took multiple hours of investigation and several failed attempts to fix for one user. It should not be this hard.
Suggested Fix
Short term: When a project path is missing on startup, show a dialog: \"The folder for [Project Name] can't be found. Would you like to locate it?\" — then remap all stored references atomically.
Medium term: Store project identity by a stable ID (e.g. git remote URL + root commit hash) rather than absolute path, so moves are tolerated automatically.
Long term: Consolidate all path storage into a single source of truth rather than 4 separate stores that must all be updated in sync.
Environment
- Claude Code version: 1.1.6452
- OS: macOS 15 (Darwin 25.3.0)
- Shell: zsh
Additional Context
This issue commonly affects users who:
- Reorganize their home directory
- Move from one disk/volume to another
- Rename a project
- Use git worktrees that get cleaned up
The worktree case is especially common — every cleaned-up worktree leaves a stale entry in LevelDB and git-worktrees.json that triggers this error.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗