{"slug":"preserve-session","title":"preserve-session","description":"Preserves Claude Code session history across project directory renames, moves, and copies by assigning each project a path-independent UUID and maintaining a global registry mapping UUID to current path.\n\nAddresses a long-standing pain point: --resume and --continue silently lose session history when paths change. Closes anthropics/claude-code#5768; also tracked in #38089, #28745, #26766, #27883.\n\nCommands: /preserve-session:fix recovers sessions after rename/move (with copy detection and automatic .jsonl merge on destination collision), /preserve-session:inherit copies session history from another registered project, /preserve-session:doctor diagnoses hash/registry state and slug collisions including non-ASCII path issues on macOS, /preserve-session:uninstall removes all preserve-session data with a preview-then-confirm safety pattern. A SessionStart hook auto-initializes .claude/hash.txt on first run — zero manual setup.\n\n  Demo: https://www.youtube.com/watch?v=lWMrzASG7_o\n\n  Quality signals: 24 verified test scenarios (rename, move, copy, slug collision, non-ASCII paths, registry corruption recovery, full --resume E2E). Atomic registry writes via fcntl.LOCK_EX + tempfile.mkstemp + os.replace. NFC slug normalization to match Claude Code's path encoding on macOS. Python heredoc isolation against shell injection. Symlink-safe uninstall (isinstance/dict guards).\n  Shared helpers in hooks/common.sh with cross-platform Python discovery and uuidgen fallback.\n\n  Full design rationale, security notes, and test plan are in two related submissions:\n  • https://github.com/anthropics/claude-code/pull/39148 (initial bundled-plugin attempt; comprehensive design + 24-item test plan with collapsible sections)\n  • https://github.com/anthropics/claude-plugins-official/pull/1347 (auto-closed by submission bot; retained as reference for the proposed marketplace.json entry)\n\n  Plugin location: lives at plugins/preserve-session/ inside the wonbywondev/claude-plugins monorepo. The marketplace entry should use the git-subdir source format pointing to that subdirectory.","developer":null,"category":null,"reported_installs":null,"active":true,"first_seen_at":"2026-10-03T22:13:33.942Z","last_seen_at":"2026-10-14T12:00:01.027Z","last_changed_at":"2026-10-03T22:13:33.942Z","platform":"claude","sources":["Community"],"works_with":["Claude Code"],"marketplace_url":null,"repository_url":"https://github.com/wonbywondev/claude-plugins.git","web_data":{},"github_data":{},"catalog_sources":{"community":[{"name":"preserve-session","source":{"sha":"547f0c416a69a37c418d57c9d69a6df65bb75781","url":"https://github.com/wonbywondev/claude-plugins.git","source":"url"},"homepage":"https://github.com/wonbywondev/claude-plugins/tree/main/plugins/preserve-session","description":"Preserves Claude Code session history across project directory renames, moves, and copies by assigning each project a path-independent UUID and maintaining a global registry mapping UUID to current path.\n\nAddresses a long-standing pain point: --resume and --continue silently lose session history when paths change. Closes anthropics/claude-code#5768; also tracked in #38089, #28745, #26766, #27883.\n\nCommands: /preserve-session:fix recovers sessions after rename/move (with copy detection and automatic .jsonl merge on destination collision), /preserve-session:inherit copies session history from another registered project, /preserve-session:doctor diagnoses hash/registry state and slug collisions including non-ASCII path issues on macOS, /preserve-session:uninstall removes all preserve-session data with a preview-then-confirm safety pattern. A SessionStart hook auto-initializes .claude/hash.txt on first run — zero manual setup.\n\n  Demo: https://www.youtube.com/watch?v=lWMrzASG7_o\n\n  Quality signals: 24 verified test scenarios (rename, move, copy, slug collision, non-ASCII paths, registry corruption recovery, full --resume E2E). Atomic registry writes via fcntl.LOCK_EX + tempfile.mkstemp + os.replace. NFC slug normalization to match Claude Code's path encoding on macOS. Python heredoc isolation against shell injection. Symlink-safe uninstall (isinstance/dict guards).\n  Shared helpers in hooks/common.sh with cross-platform Python discovery and uuidgen fallback.\n\n  Full design rationale, security notes, and test plan are in two related submissions:\n  • https://github.com/anthropics/claude-code/pull/39148 (initial bundled-plugin attempt; comprehensive design + 24-item test plan with collapsible sections)\n  • https://github.com/anthropics/claude-plugins-official/pull/1347 (auto-closed by submission bot; retained as reference for the proposed marketplace.json entry)\n\n  Plugin location: lives at plugins/preserve-session/ inside the wonbywondev/claude-plugins monorepo. The marketplace entry should use the git-subdir source format pointing to that subdirectory."}]}}