move-project
Skill0 starsChanged 2 months agoMITView on GitHub
Moves a project folder to a new location AND immediately repairs the link to its Claude Code chat history and memory (which are otherwise lost, because the storage is keyed by the project path). Use when the user says "move the project", "relocate this folder", "put the project into a group", "I'm sorting my projects", and for any reorganisation of project folders, so memory and history are not lost.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architectSkill
- atomic-commitSkill
- codebase-tutorialSkill
- code-via-opencodeSkill
- code-walkthroughSkill
- deep-research-economySkill
- deep-researchSkill
- github-pushSkill
- instagram-transcriptSkill
- poc-portfolio-prepSkill
- research-via-opencodeSkill
- resume-after-windowSkill
- translate-ruSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When a project folder moves, its path changes → Claude creates a new empty entry and the old one (with history and memory) is orphaned.
- Very specific: line 30
All the logic lives in ~/.claude/scripts/migrate-claude-storage.sh:
- Distinctive: line 40
no target → a plain rename of the entry.
- Very specific: line 51
Keep it outside ~/.claude — transcripts may contain secrets and must never end up in a dotfiles repository.
- Distinctive: line 80
If the orphan's original folder was deleted (not moved) — there is nowhere to move it.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
move-project — relocate a project without losing history and memory
Why
Claude Code keeps each project's chat history and memory in
~/.claude/projects/<encoded-path>/, where the path is encoded by replacing every
non-alphanumeric character with - (so /, _, ., space → -).
When a project folder moves, its path changes → Claude creates a new empty entry and the old one (with history and memory) is orphaned. This skill moves the folder and at the same time moves/merges its storage entry.
Inside a storage entry:
<uuid>.jsonl— session transcripts (chat history);<uuid>/— session data (tool results, subagents);memory/— memory (MEMORY.md+ fact files).
Engine
All the logic lives in ~/.claude/scripts/migrate-claude-storage.sh:
migrate-claude-storage.sh <OLD_PATH> <NEW_PATH> # by real paths
migrate-claude-storage.sh --enc <OLD_ENC> <NEW_ENC> # by encoded entry names
--dry-run only show what would be done
--root <dir> storage root (default ~/.claude/projects)Behaviour:
- no target → a plain rename of the entry;
- target exists → safe merge without overwriting: sessions are moved (UUIDs never
collide), memory files are added,
MEMORY.mdindexes are merged by unique lines; - the source is removed only if it ends up empty.
Procedure
- Backup (once per reorganisation session):
Keep it outsidetar czf ~/claude-projects-backup-$(date +%Y%m%d_%H%M%S).tar.gz -C ~/.claude projects~/.claude— transcripts may contain secrets and must never end up in a dotfiles repository. - Dry run — check the mapping is right:
~/.claude/scripts/migrate-claude-storage.sh --dry-run "$OLD" "$NEW" - Move the folder, then repair the storage:
mv "$OLD" "$NEW" ~/.claude/scripts/migrate-claude-storage.sh "$OLD" "$NEW" - Check skill references. Some skills contain hard-coded absolute paths. Find and
update them:
grep -rl "$OLD" ~/.claude/skills - Check that no orphans are left — entries whose folder no longer exists:
ls -1 ~/.claude/projects | while read s; do real=$(printf '%s' "$s" | sed 's#^-##; s#-#/#g') # approximate! [ -d "/$real" ] || echo "possible orphan: $s" done
Caveats
- The encoding is lossy (different names can map to the same encoded path), so when guessing the target always check against a folder that really exists, never reconstruct the path from the entry name. The orphan check above is only a hint.
- If the orphan's original folder was deleted (not moved) — there is nowhere to move it; leave it or delete it by hand.
- Related automation: the
SessionStarthookhooks/reconnect-project-storage.shre-attaches orphaned history by itself when a project is opened and the target entry is still empty (plain rename only, never a merge).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

