Unclear It is not clear whether this check applies in every mode or only in certain kinds of session.
A hook is a command you configure that Claude Code runs at a set moment. A PreToolUse hook runs before a tool is used and can block it. Claude Code now runs your PreToolUse hooks for each project document it is about to read into the conversation.
- If a hook fails with an error, no text from that document is sent.
- If a hook blocks the read, no text is sent.
- If a hook rewrites the request, no text is sent.
In each case Claude Code logs an error. Project documents are also no longer read once Claude has already replied in the conversation.
When the conversation is compacted (shortened to save space), Claude Code now asks the hooks about the project documents before it fetches any of them, and can refuse a read that a hook vetoed or whose document name does not match what was checked.
Hooks can now keep project document content out of the conversation, which gives you a way to control what gets sent to the model.
It is not clear whether this check applies in every mode or only in certain kinds of session.