Bug: Hook commands not executing on Windows Desktop App

Resolved 💬 3 comments Opened Feb 28, 2026 by enzoferraripapa-arch Closed Mar 4, 2026

Summary

Hook commands defined in ~/.claude/settings.json are matched by the hook system but never actually execute on the Windows Desktop App (Claude Code v2.1.51).

Steps to Reproduce

  1. Configure a Stop hook in ~/.claude/settings.json:
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo hook_fired > /c/Users/USERNAME/tools/hook_proof.txt"
          }
        ]
      }
    ]
  }
}
  1. Send a message and wait for Claude to respond
  2. Check if hook_proof.txt was created

Expected Behavior

The file hook_proof.txt should be created after each response (Stop event fires).

Actual Behavior

  • Debug log confirms hooks are matched: Matched 2 unique hooks for query "no match query"
  • Debug log shows Hook output does not start with {, treating as plain text
  • But the file is never created — the command does not actually execute
  • Tested with multiple command formats: echo, touch, rundll32, powershell, wscript, cmd.exe /c start — none produce any effect

Environment

  • Claude Code Desktop App v2.1.51
  • Windows 11 Home 10.0.26200
  • Shell: Git Bash (C:\Program Files\Git\bin\bash.exe)
  • Entry point: claude-desktop (from debug log: cc_entrypoint=claude-desktop)

Additional Context

  • The same hook commands work correctly when executed directly via the Bash tool within the session
  • The hook matching logic works (confirmed by debug log)
  • Only the actual command execution fails silently
  • This appears to be Windows Desktop App specific — CLI users on macOS/Linux report hooks working correctly

View original on GitHub ↗

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