claude-session-migrate

Migrate Claude Code session storage for relocated or renamed project directories.

Updated Dec 4, 2014
One-click install
npx skills add https://github.com/kevintraver/dotfiles --skill claude-session-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-session-migrate
Source: https://github.com/kevintraver/dotfiles/tree/main/claude-skills/claude-session-migrate
Command: npx skills add https://github.com/kevintraver/dotfiles --skill claude-session-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you migrate Claude Code session storage when you move or rename project directories.

Core Features & Use Cases

  • Path encoding: Claude stores session directories with hyphenated paths; this Skill updates them to the new path.
  • Migration steps: Verify old path, convert to Claude's folder format, and move directories.
  • Edge-case handling: Missing old, existing new, multiple sessions, invalid paths.

Quick Start

cd ~/.claude/projects/ && mv -- -old-encoded-path -new-encoded-path

Frequently Asked Questions about claude-session-migrate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update Claude session storage after moving a project directory?

Claude session storage uses encoded path names. When you move or rename a project directory, migrate the session folder by converting the old path to Claude's hyphenated format, then move it to match the new location. This realigns session tracking with your directory structure.

What path encoding does Claude use for session directories?

Claude encodes session paths by converting forward slashes to hyphens, replacing spaces with hyphens, removing the leading slash, and removing any leading hyphen. For example, `/home/user/my-project` becomes `home-user-my-project`.

Can I migrate multiple Claude sessions when reorganizing directories?

Yes. The migration process handles multiple sessions by checking for existing old paths, converting each to the new encoded format, and safely moving directories. Edge cases like missing old paths or already-existing new paths are validated before migration.

What happens if I rename a directory with spaces in the path?

Spaces in directory names are encoded as hyphens in Claude's session folders. When you rename a directory containing spaces, the session migration updates both the hyphenated path encoding and verifies the new directory structure exists before completing the move.

Do I need to manually verify Claude sessions after moving a project?

Yes. After migration, verification checks that the new session folder exists and is correctly positioned. This ensures Claude can locate your session data and resume work without interruption.