[BUG] UserPromptSubmit hooks silently not firing in git worktree sessions
Summary
UserPromptSubmit hooks configured in .claude/settings.json or .claude/settings.local.json silently skip in git worktree sessions. No error is thrown, no log entry is written — they simply don't fire. SessionStart hooks (e.g. from claude-mem) do fire correctly in the same sessions, making this specific to UserPromptSubmit.
Steps to reproduce
- Configure a
UserPromptSubmithook in.claude/settings.local.json(e.g. a hook that echoes a protocol reminder or runs a context-loading script). - Run Claude Code from a git worktree (via
claude -w <name>or from a path under.claude/worktrees/{name}/). - Submit any prompt.
- The hook does not fire. No error is shown. No log entry in
~/.claude/debug/latest.
Evidence
In ~/.claude/projects/<worktree-path>/<session>.jsonl:
- Zero occurrences of
"hookEventName":"UserPromptSubmit"despite the hook being present in settings. SessionStarthooks (e.g. from theclaude-memplugin) do appear correctly — hook discovery is running, just not forUserPromptSubmitin this context.
Confirmed across five sessions, three worktrees, six-plus days. The parent vault's regular (non-worktree) sessions run the same hooks correctly.
Root cause hypotheses
- The worktree path nests its own
.claude/inside the parent vault's.claude/. Claude Code may load the worktree'ssettings.local.jsonforSessionStartbut silently failUserPromptSubmitregistration in the nested structure. "once": truestate may be keyed on the parent-vault project path, marking hooks as already-fired for all subsequent worktree sessions.
Impact
Any automation depending on UserPromptSubmit for context injection, session initialization, or auto-update checks is silently broken in worktree sessions. No indication that hooks aren't running — users assume their automation is working when it isn't.
Related: #47733 (user-level MCP servers also fail in worktrees — same root cause, different subsystem).
Detailed session JSONL evidence and full repro: adelaidasofia/ai-brain-starter#6
Environment
- macOS Darwin 25.4.0, arm64
- Claude Code: latest CLI (claude-opus-4-6, 1M context)
- Worktrees nested under
.claude/worktrees/{name}/within the main working directory
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗