Claude’s preToolUse hooks let you block dangerous commands BEFORE they execute. This would be super helpful for any destructive commands you don’t want Claude running or even for files you don’t want Claude accessing.
Here’s how to set it up:
→ Add a hook config in settings.json
→ Define which command triggers it
→ Write a script that decides: allow or deny
→ Claude checks your script before every tool call
🔗 Full docs:
code.claude.com/docs/en/hooks#pretooluse
Part 2 of Claude Security Features You Didn’t Know About coming soon!
#claudepartner