A bash script to update Claude Code's project references after moving a folder to a new path.
Claude Code stores project data in ~/.claude/projects/ using folder names derived from the project path. When you move a project to a different location, Claude Code loses track of it. This script updates the project metadata to match the new path.
Important: This script only updates Claude Code's metadata. You must move your project folder first, then run this script to update the reference.
- Move your project folder to the new location
- Run the script:
./claude-project-mover.sh
- Select the project and enter the new path
- The script validates the destination folder exists before proceeding
- Renames the project folder in
~/.claude/projects/ - Replaces all path references in
.jsonlsession files - Optionally creates a compressed backup in the same folder:
BACKUP__-Users-jdoe-Desktop-myproject__20251225_123130.tar.gz
chmod +x claude-project-mover.sh- macOS or Linux with Bash
- Claude Code installed (
~/.claude/projects/must exist)