Skip to content
Anthropic Claude Code·Indexed by this site · Originally published· Event →SelectedAttention40

Community report: Claude Code silently skips failed hooks on Windows

AI summary

A user reported in a GitHub issue that Claude Code on Windows treats a hook command that fails to start (exit code 127) as a non-blocking error, with prompts or tool calls proceeding as usual, the failure written only to the --debug log, and no indication within the session. The cause is that Windows hook commands are executed via Git Bash, backslash paths have their separators stripped, and unquoted paths containing spaces are split, so an ordinary Windows path can trigger it. The reporter said that UserPromptSubmit or PreToolUse hooks used as security or compliance controls (such as those deployed via managed-settings.json) would therefore silently fail, appearing no different from a hook running normally and allowing the action, and that their Windows test pipeline had failed for three consecutive weeks with no diagnostics because of this.

Why it was selected

On Windows, an ordinary path format is enough to make a hook used as a security control silently fail with no prompt in the session; teams relying on managed hooks can use this to troubleshoot configuration.

Read originalgithub.com