Registers WorktreeCreate and WorktreeRemove hooks in Claude Code settings.json for worktree-plus plugin. Fixes issues when hooks fail to fire or claude -w falls back to default behavior.
From worktree-plusnpx claudepluginhub leejuoh/claude-code-zero --plugin worktree-plusThis skill is limited to using the following tools:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Register WorktreeCreate and WorktreeRemove hooks in the appropriate settings.json so that claude -w uses worktree-plus instead of the built-in worktree behavior.
For detailed configuration (.worktreeinclude, .worktreelink, branch prefix, remote tracking), see ${CLAUDE_SKILL_DIR}/../../README.md.
The setup script scans enabledPlugins across all settings files to detect the actual install scope, then writes hooks to the matching file:
~/.claude/settings.json.claude/settings.json.claude/settings.local.jsonIt handles three cases per hook: missing (adds), stale path (updates), already correct (skips). Existing hooks from other plugins are preserved.
Requires jq for JSON manipulation. If the script fails with "jq: command not found", install it first:
brew install jq # macOS
apt install jq # Linux
bash "${CLAUDE_SKILL_DIR}/../../hooks/scripts/setup-hooks.sh"
jq is installed and the settings file path is writablesettings.json only take effect after restarting Claude Code. The file watcher picks up most config changes live, but hook registration is loaded at session startup.jq for JSON parsing. If jq is missing, setup will fail silently and worktrees will fall back to built-in behavior.--plugin-dir simultaneously, both versions run and the cached (marketplace) version may take precedence. Disable the marketplace version first: claude plugin disable worktree-plus@<marketplace>..worktreeinclude/.worktreelink: Windows-style line endings cause paths to include invisible \r, making copies/symlinks fail silently. The scripts handle CRLF automatically, but if you hit issues, check with cat -A .worktreeinclude (CRLF shows as ^M$).