[BUG] PostToolUse hooks fail to execute when working directory is home directory (~)

Status Closed — not planned
Maintainer reply None cached
Activity 3 comments · opened Jan 3, 2026 · closed Feb 16, 2026

Description

PostToolUse hooks are registered correctly but fail to execute when the current working directory is the user's home directory (~), which is also where ~/.claude settings directory is located.

Environment

  • Working directory: ~ (home directory /Users/lizf)
  • Settings location: ~/.claude/settings.json
  • Platform: macOS (Darwin 24.6.0)
  • Feedback ID: f7ae04d3-9760-4925-957d-112219dc617d

Expected Behavior

PostToolUse hooks should execute after Bash tool calls, regardless of whether the working directory is ~.

Actual Behavior

  • Works: Hooks execute correctly when working in subdirectories (e.g., ~/Downloads, ~/go/src)
  • Fails: Hooks do not execute when cwd == ~ (home directory)
  • Hook execution silently fails with no errors in debug mode

Steps to Reproduce

  1. Configure a PostToolUse hook in ~/.claude/settings.json
  2. Start Claude Code with working directory as home directory (~)
  3. Run /hooks command - observe hook is registered twice:
  • Once with user scope (from ~/.claude/settings.json)
  • Once with project scope (from .claude/settings.json in ~)
  1. Execute a Bash tool call (e.g., cd ~/Downloads && pwd)
  2. Observe that hook does not fire despite being registered

Additional Context

This appears to be the inverse of previously reported issues:

  • #10367: Hooks fail in subdirectories but work from project root
  • #8810: UserPromptSubmit hooks not working in subdirectories

The collision between ~/.claude (settings directory) and ~ (project directory) causes hooks to register twice but never execute.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗