EnterWorktree doesn't see WorktreeCreate hooks registered by plugins
Resolved 💬 4 comments Opened Mar 9, 2026 by KingMob Closed Apr 6, 2026
Bug Description
EnterWorktree fails with "Invalid path" in jj (Jujutsu) repositories even when a plugin correctly registers WorktreeCreate/WorktreeRemove hooks via hooks/hooks.json.
Steps to Reproduce
- Create a plugin with
hooks/hooks.jsondefiningWorktreeCreateandWorktreeRemovehooks - Install and enable the plugin (confirmed via
settings.json→enabledPlugins) - In a non-git repository (jj), call
EnterWorktree
Expected Behavior
EnterWorktree should find the plugin-registered WorktreeCreate hook and use it, as documented:
Must be in a git repository, OR have WorktreeCreate/WorktreeRemove hooks configured
Actual Behavior
EnterWorktree returns "Invalid path". It appears to only check ~/.claude/settings.json hooks, not hooks registered through the plugin system.
Evidence
- The plugin (
jj@agent-pluginsv0.4.0) is installed and enabled ("jj@agent-plugins": trueinenabledPlugins) - The plugin's
hooks/hooks.jsoncorrectly definesWorktreeCreateandWorktreeRemovehooks - The hook scripts work perfectly when invoked manually — they create full jj workspaces with all files
- Other plugin components (skills, agents) from the same plugin work fine
Workaround
Duplicating the WorktreeCreate/WorktreeRemove hooks into ~/.claude/settings.json (pointing to the plugin's scripts) makes EnterWorktree work correctly.
Environment
- macOS (Darwin 25.3.0)
- Claude Code (latest as of 2026-03-09)
- Repository uses Jujutsu (jj) for version control (no
.gitdirectory)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗