[BUG] PreToolUseHook not working in Claude
Resolved 💬 3 comments Opened May 12, 2026 by lubainak Closed May 16, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
<img width="404" height="396" alt="Image" src="https://github.com/user-attachments/assets/4a80100e-faf8-4a1b-bfb6-40db19db987a" />
What Should Happen?
@claude please help me resolve this bug. I implemented a PreToolUseHook for Claude, to prevent reading .env file. There is sensitive data in it, and the hook is not working. What are the possible reasons for it and how will it be fixed?
Error Messages/Logs
Steps to Reproduce
read .env file
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
4.5
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗