Skip to main content

Module migrate

Module migrate 

Source
Expand description

Path math for migrate - relocating a session so it can be resumed from a different project directory. Each tool ties a session to a directory differently, so the encoding lives here (and is unit-tested against the schemes observed on disk).

Functions§

claude_project_folder
claude_store_root
Claude Code stores a session at ~/.claude/projects/<folder>/<uuid>.jsonl, where <folder> is the absolute project path with every /, ., and _ turned into - (the scheme observed across every project folder on disk). Resume is scoped to this folder, so migrating to a new directory means copying the transcript into that directory’s folder. Which Claude store a transcript should be written into.
gemini_project_hash
Gemini CLI stores chats under ~/.gemini/tmp/<projectHash>/chats/, where <projectHash> is the SHA-256 (hex) of the absolute project path. The chat JSON carries the same hash in its projectHash field.