/** * Relocate Claude Code sessions from one filesystem path to another. * * When a project directory is moved (e.g., from /Users/alice/Workspace/old * to /Users/alice/Workspace/new), Claude Code can no longer find the sessions * because they're stored under path-encoded directory names. * * This module handles the on-box filesystem side of a relocation ONLY: * 1. Renaming the project directory in ~/.claude/projects/ * 2. Updating sessions-index.json (projectPath, fullPath) * 3. Updating cwd fields in .jsonl session files (Claude + Codex) * * The session INDEX side (project_path / source_path rows) is owned by the * Store, not this module — the CLI routes that through * `SessionStore.relocatePaths`, so in self_hosted mode the shared cloud * registry is updated (never a raw on-box `new Database(...)` write). */ export interface RelocateOptions { /** Only show what would change without modifying anything. */ dryRun?: boolean; /** Print detailed progress. */ verbose?: boolean; } export interface RelocateResult { dirsRenamed: Array<{ from: string; to: string; }>; indexFilesUpdated: number; jsonlFilesUpdated: number; codexFilesUpdated: number; errors: Array<{ file: string; error: string; }>; } /** * Relocate the on-box transcript FILES after a project directory move. Does NOT * touch the session index — the caller updates that through * `SessionStore.relocatePaths` so it lands in whichever store is active * (local SQLite or the shared self_hosted cloud registry). */ export declare function relocate(oldPath: string, newPath: string, options?: RelocateOptions): RelocateResult; //# sourceMappingURL=relocate.d.ts.map