Project config tied to directory path breaks on file reorganization
Problem
Claude Code stores project-specific configuration (conversation history, session logs, memory files) in ~/.claude/projects/ using a directory path as the key. For example, opening Claude Code from /Users/me/kb/projects/kicker stores sessions in ~/.claude/projects/-Users-me-kb-projects-kicker/.
When you reorganize your file structure (e.g., moving projects/kicker to projects/twenty/kicker), all conversation history becomes inaccessible. The old config directory still exists but Claude Code no longer finds it because the working directory path changed.
Impact
- All previous conversations for that project are lost from the restore UI
- Memory files (MEMORY.md) with project-specific context become orphaned
- There is no built-in migration, warning, or path-update mechanism
- Users have to manually discover the naming convention (
-separated path) and copy/rename directories
In my case, a routine reorganization of 9 project directories made conversation history across 5 projects inaccessible. The manual recovery process (copying old config dirs to new path names) is fragile and error-prone.
Expected behavior
One or more of:
- Path-independent project identity — tie config to a project ID (from CLAUDE.md or similar) rather than filesystem path, so moves don't break history
- Automatic migration detection — when opening a project, check if the directory was recently moved (via git history or inode) and offer to migrate config
- CLI command for migration —
claude project migrate --from <old-path> --to <new-path>to safely reconnect history - Warning on orphaned configs — notify users when config directories exist for paths that no longer exist on disk
Environment
- Claude Code CLI
- macOS (case-insensitive filesystem adds additional complexity for renames like
ABUS→abus) - Knowledge base with 9 project directories reorganized into client hierarchy
Additional context
The current system means any file reorganization — a normal part of project evolution — risks losing accumulated conversation context. For users who rely on conversation history for continuity across sessions, this makes directory restructuring unnecessarily risky.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗