Help us improve
Share bugs, ideas, or general feedback.
From worktree-plus
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.
npx claudepluginhub leejuoh/claude-code-zero --plugin worktree-plusHow this skill is triggered — by the user, by Claude, or both
Slash command
/worktree-plus:setupThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Register WorktreeCreate and WorktreeRemove hooks in the appropriate settings.json so that `claude -w` uses worktree-plus instead of the built-in worktree behavior.
Configures, creates, and troubleshoots Claude Code hooks like PreToolUse, PostToolUse, and UserPromptSubmit for automating tasks such as running tests before file edits or formatting outputs with jq.
Installs plugin hooks into a project's .claude/ directory for persistent use without the plugin loaded. Supports selective or bulk install, dry-run, and conflict resolution.
Configures Claude Code hooks for lifecycle events like PreToolUse, SessionStart, and automation use cases such as formatting enforcement and permission control.
Share bugs, ideas, or general feedback.
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$).