Loading...
Loading...
Migrate Claude Code project sessions when renaming directories. TRIGGERS - directory rename, move project, migrate sessions, project path change, workspace reorganization, rename folder.
npx skill4agent add terrylica/cc-skills project-directory-migrationSafely migrate Claude Code project context (sessions, memory, history) when renaming a project directory.
my-old-name/my-new-name/Question 1 (header: "Source"): "What is the current project directory path?"
Options:
- "Use current directory: $PWD" (Recommended)
- "Specify a different path"
Question 2 (header: "Target"): "What should the new directory path be?"
Options:
- (User provides via "Other" free text)--dry-runbash "<skill-scripts>/claude-code-migrate.sh" --dry-run "$OLD_PATH" "$NEW_PATH"Question 3 (header: "Scope", multiSelect: true):
"What should be included in migration?"
Options:
- "Claude Code sessions + history (Recommended)"
- "Auto-memory (MEMORY.md) (Recommended)"
- "Backward-compatibility symlink (Recommended)"
- "Auto-fix environment: mise trust, venv recreate (Recommended)"
Question 4 (header: "Execute"):
"Ready to migrate? The script creates a timestamped backup first."
Options:
- "Execute migration now (Recommended)"
- "Export copy-paste commands for manual execution"
- "Cancel"/-/Users/alice/projects/my-app --> -Users-alice-projects-my-app| Asset | Location |
|---|---|
| Sessions | |
| Memory | |
| Session index | |
| History | |
| Subagents | |
| File | Fields with paths | Needs rewriting? |
|---|---|---|
| | Yes |
| | Yes |
Session | None | No |
| None (content only) | No |
scripts/claude-code-migrate.sh# Dry run (preview what would happen)
bash scripts/claude-code-migrate.sh --dry-run /old/path /new/path
# Execute migration
bash scripts/claude-code-migrate.sh /old/path /new/path
# Rollback from most recent backup
bash scripts/claude-code-migrate.sh --rollback
# Show help
bash scripts/claude-code-migrate.sh --help~/.claude/migration-backup-YYYYMMDD-HHMMSS/~/.claude/projects/mv /old/path /new/path| Issue | Auto-fixed? | Manual Solution |
|---|---|---|
| mise trust error after rename | Yes (Phase 8) | |
| Yes (Phase 8) | Restart terminal or |
| VIRTUAL_ENV path mismatch | Yes (Phase 8) | |
| "No conversations found" | Yes (Phase 4) | Re-run migration script |
| Warned (Phase 8) | |
| Git push auth fails | No | Update credential helper or remote URL |
| Session subdirs missing | No | Use |