PreToolUse hooks fire before any permission mode check, so a deny from a hook blocks the tool even under bypassPermissions or dontAsk. An allow from a hook does not override deny rules. Use this to enforce policy that users cannot switch off by changing mode.
Read in this order
- OfficialHooks and permission modes (Claude Code hooks guide)States which hook decisions override permission modes and which cannot loosen deny rules.
- OfficialPermission modes (Claude Code docs)Explains each mode so you can see where hooks sit in the order.