Skip to content

Bash script to update Claude Code's project references after moving a folder to a new path

License

Notifications You must be signed in to change notification settings

skydiver/claude-code-project-mover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Claude Code Project Mover

A bash script to update Claude Code's project references after moving a folder to a new path.

Why?

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.

Usage

Important: This script only updates Claude Code's metadata. You must move your project folder first, then run this script to update the reference.

  1. Move your project folder to the new location
  2. Run the script:
    ./claude-project-mover.sh
  3. Select the project and enter the new path
  4. The script validates the destination folder exists before proceeding

What it does

  • Renames the project folder in ~/.claude/projects/
  • Replaces all path references in .jsonl session files
  • Optionally creates a compressed backup in the same folder:
    BACKUP__-Users-jdoe-Desktop-myproject__20251225_123130.tar.gz
    

Installation

chmod +x claude-project-mover.sh

Requirements

  • macOS or Linux with Bash
  • Claude Code installed (~/.claude/projects/ must exist)

About

Bash script to update Claude Code's project references after moving a folder to a new path

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages