{"version":"2.1.324","anchor":"plugin-worktree-hooks-registered-ahead-of-worktree-creatio","canonical_anchor":"plugin-worktree-hooks-registered-ahead-of-worktree-creatio","heading":"Plugin worktree hooks are ready before --worktree creates the worktree","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/plugin-worktree-hooks-registered-ahead-of-worktree-creatio","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### Plugin worktree hooks are ready before `--worktree` creates the worktree\n\nWith `--worktree`, Claude Code now sets up plugins' WorktreeCreate and WorktreeRemove hooks before it creates the worktree\n\n**What**\n\nWhen you start Claude Code with `--worktree`, it creates a git worktree for you. A git worktree is a separate working folder linked to the same repository. Plugins are add-ons that extend Claude Code, and they can respond to the `WorktreeCreate` and `WorktreeRemove` hooks. A hook is an event a plugin can react to.\n\nClaude Code now registers these plugin hooks before it creates the worktree. It also registers seed marketplaces first. Marketplaces are the catalogues plugins are installed from. Before this, Claude Code could create the worktree before the plugin hooks were in place, and it logged that they had not been registered in time.\n\nThis early setup is skipped when `CLAUDE_CODE_SYNC_PLUGIN_INSTALL` is set.\n\n**Why**\n\nA plugin's worktree hooks are now more likely to run, including on a fresh install where the plugins were not yet set up.\n\n- Area: Worktrees\n- Names: `--worktree`, `WorktreeCreate`, `WorktreeRemove`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}