Hooks issues on macOS — page 2
Issues the maintainers labelled both platform:macos and area:hooks.
392 issues · 88 open · 304 resolved (78%) · first seen Aug 22, 2025
Is this getting better or worse?
This class of problem is converging. 127 new reports in the last 90 days vs 244 in the 90 before — -48%. The open backlog peaked at 88 in 2026-08 and sits at 88 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
264 of these reports name the Claude Code build they were running, spanning 108 releases. Heaviest reporters:
- Claude Code v2.1.87
- Claude Code v2.1.126
- Claude Code v2.1.119
- Claude Code v2.1.81
- Claude Code v2.1.92
- Claude Code v2.1.71
- Claude Code v2.1.63
- Claude Code v2.1.143
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 31 days across 304 closures. Of the 304 closures with a recorded reason, 26% were closed as completed and 226 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
161 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] WorktreeCreate / Remove hooks not called in Claude Desktop
- Workaround: use PreToolUse on Agent with worktree isolation to trigger your lifecycle hooks: This works in Claude Desktop because PreToolUse/PostToolUse hooks fire normally — it's only the dedicated WorktreeCreate/Worktr…
Found in the thread of #29716 · still open - Post/PreToolUse Hooks Not Executing in Claude Code
- …oolUse event actually being triggered by tool execution? 🔄 Workaround Status Currently using reactive PostToolUse validation instead of preventive PreToolUse blocking , but this is: - ❌ After-the-fact (damage already do…
Found in the thread of #6305 · still open - [BUG] Cowork sessions ignore user hooks and managed settings — sandbox platform mismatch breaks all settings resolution
- …the macOS host are not forwarded. This means the documented workaround from 34428 ( in settings.json block) doesn't work for cowork — settings.json isn't loaded (Root Cause 1), and even if set in the host shell, the env…
Found in the description of #40495 · still open - [Bug] EnterWorktree tool ignores WorktreeCreate/WorktreeRemove hooks
- Workaround: use a hook on to trigger your own lifecycle hooks: Similarly for cleanup: This ensures your lifecycle hooks fire even when using the EnterWorktree tool, until the native WorktreeCreate/WorktreeRemove events a…
Found in the thread of #36205 · still open - [BUG] PreToolUse permissionDecision: "allow" no longer suppresses prompt for Bash with dangerouslyDisableSandbox: true (2.1.116+ regression)
- …r any command that is sandbox-eligible but invoked with \ . Workarounds available today: 1. Migrate the policy decision into \ rules (loses dynamic context, transcript-aware judging, etc.). 2. Set \ — flips \ to true, th…
Found in the thread of #51798 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 392 matches; the statistics above cover all 392.
- Worktree path corrupted by hook stdout — JSON output concatenated into path
- Hooks fail when working directory path contains spaces (macOS)
- PostToolUse: EnterWorktree hook does not fire when worktree is created via `claude -w`
- Stop hooks fail with ENOENT for /bin/sh on macOS (posix_spawn)
- [BUG] Plugin Stop hooks never execute despite being registered (SessionStart works from same hooks.json) - Version 2.1.63
- [BUG] Agent hook 'prompt' fields silently stripped from settings.json Stop hooks
- Desktop app: session permanently wedged after manual /compact — deferred local-command send is echo-tracked by a uuid that never echoes
- [BUG] HTTP 407 error for pretooluse http hook with authentication in sandbox
- [bug] [area:agents] [platform:macos] Agent(isolation: "worktree") post-creation setup silently rewrites...
- [BUG] SessionStart hook `sessionTitle` silently ignored for source `clear` (only applied for startup/resume)
- Degenerate token repetition in long sessions, only stoppable by user interrupt
- [BUG] UserPromptSubmit Hook does not Display Reason in Claude Code Desktop
- Stop hook error: "TabManager not available" still occurs in v2.1.133 CLI mode
- Plugin PreToolUse hooks silently override `bypassPermissions` / `acceptEdits` with no indication to the user
- PreToolUse hook with Bash matcher silently not invoked (UserPromptSubmit + PostToolUse hooks fire fine)
- [BUG] Bare hook entry {type, command} silently breaks entire hooks config — no error, no warning
- [BUG] SessionStart prompt hooks crash with unhandled exception
- Stop hook false-positive: stale subagent IDs block session end
- Hookify plugin: ImportError due to versioned cache directory structure
- [BUG] File reverts to previous content after pre-commit hook modifies it in-place
- Plugin hooks that refresh OAuth tokens silently break authentication
- Skill-scoped hooks in SKILL.md frontmatter are not passed to forked subagent when using context: fork
- [Plugin: ralph-loop] stop-hook.sh loses execute permission when cached
- Plugin manager does not preserve execute permissions on hook scripts
- [BUG] `GIT_INDEX_FILE` inherited from git hooks causes index corruption during plugin initialization
- feat(hooks): PostCompact hook should fire in the new session context to enable agent ACK/handoff signals
- [Bug] Hookify plugin displays "hook error" messages for non-matching events despite successful exit
- PostToolUse hook reports 'hook error' when Bash command exits non-zero but hook exits 0
- Plugin hooks for SessionEnd event are not fired
- Subagent (Agent tool) does not fire Stop hook on completion
- PostToolUse hooks: exit code 2 shows 'blocking error' but doesn't actually block
- Hooks docs: four payload field divergences vs shipped behavior (2.1.207, captured)
- [BUG] PreToolUse hook `if: "Bash(...)"` still false-positives on `$()` command substitution in 2.1.202
- PreToolUse hooks with Edit|Write matcher silently never invoked for an entire session (bypassPermissions, v2.1.195/196) while Bash-matched hooks fire normally
- Transcript: short assistant text between tool calls persists as an empty record (hooks can't read it)
- [Bug] Plugin-registered CwdChanged and FileChanged hooks don't fire (settings.json works) — v2.1.153
- Feature: Expose background task state to SessionEnd hooks
- Claude actively bypasses safety hooks by deleting flag files
- [Bug] Stop hook error: Failed with non-blocking status code
- [BUG] PreToolUse hook payload `session_id` / `transcript_path` alternate between current and stale UUIDs within one conversation
- Subagent MCP tool result not delivered after WorktreeCreate hook in non-git workspace
- [BUG] Stop-hook "callback" injects a synthesised user turn (isMeta:true) when a paused subagent expects SendMessage but parent has no such tool
- [BUG] PreToolUse/PostToolUse hook error: Cannot find module session-state.cjs
- [BUG] Hook stdin contains unescaped U+0000–U+001F control characters in JSON string fields, causing jq parse error and silent bypass of security hooks
- Same assistant response rendered 16 times in terminal for a single user message
- Users are billed for ~24M hidden input tokens/month per heavy seat — silent session resumes re-fire SessionStart hooks + re-send MCP instructions, with no UI disclosure or consent
- [BUG] UserPromptSubmit hooks silently not firing in git worktree sessions
- PostToolUse:Write hook error: 'Messages are required for agent hooks. This is a bug.' with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
- macOS: session-snapshot hook fossilises iCloud FileProvider corruption when repo is under ~/Documents
- Plugin auto-update deletes old cache dir, breaking ${CLAUDE_PLUGIN_ROOT} in running sessions
- Plugin framework deletes external hooks/hooks.json from working tree
- [Bug] Stop hooks failing, causing rapid token consumption and degraded performance
- PreToolUse hooks returning exit 2 + deny JSON do not block tool execution
- Plugin hooks fail: CLAUDE_PLUGIN_ROOT not injected at hook execution time
- PreToolUse hooks do not fire in non-interactive mode (claude -p)
- Plugin installer strips execute permissions from .sh files
- Marketplace plugin sync strips execute permissions from .sh hook files
- [BUG] SessionStart hook re-fires when switching between session tabs in Claude Code Desktop
- PreToolUse hook `permissionDecision: "deny"` ignored for Edit tool — tool executes despite deny
- Community workarounds for 5 open bugs — hooks, compaction, MCP auth
- [Bug] Disabled marketplace plugins register hooks and cause persistent errors
- [BUG] Notification hook not firing in Claude Desktop
- [BUG] Resumed worktree session does not trigger WorktreeRemove on exit
- Agent/Prompt hooks do not block PreToolUse or deliver feedback to Claude
- [BUG] PreToolUse hooks cause agent hang after ToolSearch deferred tool loading
- .
- EnterWorktree doesn't see WorktreeCreate hooks registered by plugins
- [BUG] PreToolUse hook updatedInput silently ignored in claude -p mode
- PostToolUse hook falsely stops model continuation with [Solution Detected] on investigative Bash output
- [BUG] PostToolUse hooks do not fire on failed Bash commands (non-zero exit code)
- statusLine hook output: leading whitespace stripped, preventing right-aligned content
- [BUG] PermissionRequest hook `permission_suggestions` inconsistencies with UI
- WorktreeCreate no-op hook causes silent hang on `claude -w` startup
- [BUG] Claude fails silently in VSCode with hook failures
- [BUG] WorktreeCreate hook returning a path outside the repository is always refused: "git could not be run to resolve it"
- [BUG] SessionEnd hook stdin pipe not closed for /clear events
- [BUG] claude.ai plugin ingester silently hides plugins whose hooks.json has an unknown top-level key (tolerated by Claude Code CLI)
- [MODEL] Major Data loss. Agent-constructed test payload with $(...) executed for real due to bash double-quote handling — rm -rf ~ ran against live home directory
- [Bug] Claude Code deliberately disables user guardrails and ignores explicit instructions
- Hook runner spawns with deleted session cwd — every hook fails with `ENOENT: posix_spawn '/bin/sh'` and PreToolUse deny-hooks fail open (distinct from the Bash-tool cwd validation)
- [MODEL] Claude reasoned around its own PreToolUse hook and executed a bypass without user notification
- [BUG] PreToolUse hook for Write/Edit can be bypassed by writing files via the Bash tool
- [BUG] /goal stop hook fires after every assistant turn, interrupting user mid-message
- [BUG] SessionStart Hook in Project Settings Crashes All Agent View Background Sessions
- Monitor tool events trigger UserPromptSubmit hooks, polluting conversation
- [Feature Request] Desktop mode does not support webhook hooks for notifications
- [BUG] CLAUDE_ENV_FILE variables not available in Bash on resumed sessions (--continue/--resume)
- PostToolUse agent hook fails with "Messages are required for agent hooks. This is a bug."
- [Bug] Bash tool not auto-sourcing CLAUDE_ENV_FILE in shell initialization
- Hook errors for PreToolUse:Agent / PostToolUse:Agent surface cryptic "command not found" output
- if field in hooks does not match file-extension patterns — Edit(*.ts) never fires even for TypeScript files
- [FEATURE] Sub-agents should inherit CLAUDE_ENV_FILE environment variables from parent session
- PreToolUse hook 'allow' cannot bypass Bash sensitive path ask rules (unlike Edit/Write)
- Agent-type PreToolUse hooks fail: 'Messages are required for agent hooks'
- UserPromptSubmit hook reports 'error' despite exit 0 and valid JSON output
- [BUG] Stop hook feedback with no output creates an infinite loop
- PostToolUse additionalContext silently dropped for Agent tool calls
- WorktreeCreate hook causes --worktree flag to hang indefinitely
- CLAUDE_PLUGIN_ROOT env var not always set when invoking plugin hooks
- PreToolUse hook 'if' field does not filter hook process spawning (v2.1.87)