{"version":"2.1.50","anchor":"vcs-agnostic-worktree-isolation-via-hooks","canonical_anchor":"vcs-agnostic-worktree-isolation-via-hooks","heading":"VCS-Agnostic Worktree Isolation via Hooks","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.50\/e\/vcs-agnostic-worktree-isolation-via-hooks","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.50","markdown":"### VCS-Agnostic Worktree Isolation via Hooks\n\n**What**\n\nCustom hooks for creating and removing worktrees, enabling worktree isolation to work with any version control system\u2014not just Git.\n\n**Usage**\n\nConfigure hooks in your `settings.json`:\n\n`{ \"hooks\": { \"WorktreeCreate\": [{ \"command\": \"your-worktree-create-script\" }], \"WorktreeRemove\": [{ \"command\": \"your-worktree-remove-script\" }] } }` **Details** - `WorktreeCreate` hook receives JSON input with `name` (suggested worktree slug); stdout should contain the absolute path to the created worktree - `WorktreeRemove` hook receives JSON input with `worktree_path` (absolute path to worktree); exit code 0 indicates successful removal - Enables worktree isolation for non-Git VCS systems (Mercurial, SVN, etc.) - Error messages guide users when hooks are missing or fail **Evidence** Hook types and error messages (search for `\"WorktreeCreate\"`, `\"WorktreeRemove\"`, `\"Configure WorktreeCreate\/WorktreeRemove hooks\"`)"}