← ClaudeAtlas

claude-code-repo-migrationlisted

Move or rename a git repo on disk without losing its Claude Code history — remap the session dir (~/.claude/projects/<slug>/) and the ~/.claude.json projects key so every past session still resumes from the new path with trust, allowedTools and MCP servers intact, and repair the git worktrees the move breaks. Use when moving a repo to a different parent folder, renaming the org/parent directory, reorganising ~/projects, or after a move when: `claude --resume` shows no sessions / the session picker is empty at the new path, the trust dialog or project onboarding reappears, allowedTools or MCP servers were 'forgotten', auto-memory looks empty, or `git worktree list` / a worktree's git commands break. Covers the slug rule people get wrong (EVERY non-alphanumeric char becomes '-', not just '/'), which extra slug dirs a repo owns, backup-then-mutate ordering, and the fact that ~/.claude.json is live-rewritten by every running session.
stealth-factory/skills · ★ 3 · AI & Automation · score 72
Install: claude install-skill stealth-factory/skills
# Move a repo without losing its Claude Code sessions A plain `mv` of a repo works fine for git and breaks everything Claude Code keeps *about* that repo. Nothing errors — the sessions simply stop appearing, the trust dialog comes back, and the old transcripts sit in a directory nothing looks at any more. This skill is the remap that makes the move invisible. Commands live in [`reference/playbook.md`](./reference/playbook.md); three helpers live in [`scripts/`](./scripts) — slug derivation, the worktree move plan, and the registry remap. This body is the model and the rules. ## The three things, and only one of them is the repo | # | Thing | Where | If you skip it | | - | ----- | ----- | -------------- | | 1 | The repo | `~/projects/<parent>/<repo>` | — | | 2 | Session metadata | `~/.claude/projects/<SLUG>/` | every past session disappears from the picker; auto-memory goes with it | | 3 | The home registry | `~/.claude.json` → `projects["<abs path>"]` | trust dialog + onboarding reappear; `allowedTools`, `mcpServers`, `mcpContextUris` are gone | They are independent. Moving only the repo (2 and 3 left behind) is the common accident — and it is silent. **If the repo has already been moved**, which is how most people get here, the forward procedure does not apply: it assumes the old path still exists and would try to move a repo that is gone. Go to [step 8 of the playbook](./reference/playbook.md) — the metadata is untouched, so it is the same remap minus the repo move. N