Migrates Claude Code project sessions, history, and auto-memory when renaming or moving a project directory. Handles path encoding, dry-run audits, and backward-compatibility symlinks.
Ships in devops-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Safely migrate Claude Code project context (sessions, memory, history) when renaming a project directory.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
Use this skill when:
my-old-name/ to my-new-name/)Use AskUserQuestion to collect source and target paths.
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)
Run the migration script in --dry-run mode to discover what needs migrating:
bash "<skill-scripts>/claude-code-migrate.sh" --dry-run "$OLD_PATH" "$NEW_PATH"
Present findings to user:
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: 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"
If user chooses "Export copy-paste commands": Generate the exact commands they can paste into their terminal after closing Claude Code. This is the safest option since Claude Code won't be accessing the project files during migration.
After migration completes, report:
Claude Code encodes directory paths by replacing / with -:
/Users/alice/projects/my-app --> -Users-alice-projects-my-app
| Asset | Location |
|---|---|
| Sessions | ~/.claude/projects/{encoded-path}/*.jsonl |
| Memory | ~/.claude/projects/{encoded-path}/memory/MEMORY.md |
| Session index | ~/.claude/projects/{encoded-path}/sessions-index.json |
| History | ~/.claude/history.jsonl |
| Subagents | ~/.claude/projects/{encoded-path}/{session-id}/subagents/ |
| File | Fields with paths | Needs rewriting? |
|---|---|---|
sessions-index.json | originalPath, entries[].projectPath, entries[].fullPath | Yes |
history.jsonl | project field per entry | Yes |
Session .jsonl files | None | No |
MEMORY.md | None (content only) | No |
Located at 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 |
|---|---|---|
(old-name) in shell prompt | Yes (Phase 8) | Restart terminal or uv sync |
| VIRTUAL_ENV path mismatch | Yes (Phase 8) | uv sync --dev recreates venv |
| "No conversations found" | Yes (Phase 4) | Re-run migration script |
.envrc not allowed | Warned (Phase 8) | direnv allow |
| Git push auth fails | No | Update credential helper or remote URL |
| Session subdirs missing | No | Use --rollback, retry |
After this skill completes, reflect before closing the task:
Do NOT defer. The next invocation inherits whatever you leave behind.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/devops-tools:project-directory-migrationfrom devops-tools
npx claudepluginhub terrylica/cc-skills --plugin devops-tools23 skills in this plugin
/agentic-process-monitorMonitor background processes from Claude Code with sentinel files, heartbeat liveness and subagent polling, to detect completion, failure, hang or timeout. TRIGGERS - monitor background process, sentinel file, heartbeat./claude-code-proxy-patternsClaude Code OAuth proxy patterns and anti-patterns for multi-provider model routing./clickhouse-cloud-managementClickHouse Cloud user and permission management. TRIGGERS - create ClickHouse user, ClickHouse permissions, ClickHouse Cloud credentials.Other plugins' skills for the same job