On this page
Move session data after a project directory rename.
#claudewheel.mv
#claudewheel.mv
Move session data after a project directory rename.
#MvResult
Counters tracking the outcome of a project-directory move operation.
#_discover_profile_dirs
def _discover_profile_dirs() -> list[Path]Find all profile directories plus ~/.claudewheel/shared/ if it exists.
Uses the shared discovery module for profiles, then includes the shared store directory (which holds the actual session data).
#_rewrite_jsonl_file
def _rewrite_jsonl_file(path: Path, old_path: str, new_path: str, dry_run: bool) -> intReplace old_path with new_path in every line of a JSONL file.
Returns the number of lines where a replacement was made.
#_update_claude_json
def _update_claude_json(path: Path, old_path: str, new_path: str, dry_run: bool) -> boolRename a project key in .claude.json. Returns True if updated.
The key lives under data["projects"][old_path], not at the top level.
#run_mv
def run_mv(old_path: str, new_path: str, dry_run: bool=False, quiet: bool=False, post_hoc: bool=False) -> MvResultRename a project directory and migrate Claude Code session data.
In default mode, renames old_path to new_path on the filesystem and then migrates all session data. With post_hoc=True, skips the filesystem rename (the directory was already renamed externally) and only migrates sessions.