Dev Tools · 1h ago
Claude Code hook: use 'deny' not 'ask' to force agent prerequisites
A developer building a progressive disclosure system for Claude Code found that using 'ask' in a PreToolUse hook only pauses for human approval, not forcing the agent to read a required design doc. Switching to 'deny' blocks the edit until the agent reads the file, then retries. The fix ensures the agent completes prerequisites before proceeding, mimicking Claude Code's native read-before-edit behavior.
Meridian48 take
This is a useful debugging insight for agent developers, but the distinction between 'ask' and 'deny' is clearly documented—the real lesson is to test hook behavior before relying on it.
claude-codeagent-hooks