[BUG] Accessing `/hooks` menu in worktree causes project-level hooks to be unloaded
Resolved 💬 4 comments Opened Mar 13, 2026 by winterqt Closed May 22, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I have project-level WorktreeCreate and WorktreeRemove hooks. This usually works great. However, if I open the /hooks menu from a worktree-using session, and then exit the session, it causes the WorktreeRemove hook to not be fired. I suspect this applies to other hooks as well.
What Should Happen?
The hooks shouldn't be unloaded.
Error Messages/Logs
2026-03-13T19:29:38.632Z [DEBUG] WorktreeCreate [<snip>] completed with status 0
2026-03-13T19:29:38.632Z [DEBUG] Hook output does not start with {, treating as plain text
2026-03-13T19:29:38.632Z [DEBUG] Created hook-based worktree at: /home/winter/.claude/worktrees/clever-twirling-cloud
[...]
2026-03-13T19:29:43.435Z [WARN] No WorktreeRemove hook configured, hook-based worktree left at: /home/winter/.claude/worktrees/clever-twirling-cloud
Steps to Reproduce
(Note that I'm not sure whether or not this happens with the default worktree implementation as well.)
$ claude -w/hooks/exit- Observe
WorktreeRemoveisn't called
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.74 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗