BrowseFull catalogOutcomesSolve a specific problemRolesStack by teamTrustFilter by risk tier
← Back to the Claude Observatory

Claude Code Security Hooks

Automation Security Usable
Works inClaude Code
Usable Scanned — metadata only

Ready-to-deploy guardrails for client Claude Code deployments. block-dangerous-commands and protect-secrets are essential safety hooks.

4 production hooks: block-dangerous-commands (blocks rm -rf ~, fork bombs, curl|sh), protect-secrets (prevents reading/modifying sensitive files), auto-stage (git stages after edits), notify-permission (Slack alert when input needed).

462 starsMIT (commercial OK)FreeDeveloper setup
Usable rating — This tool is functional but has notable gaps. Review the evaluation notes below before deploying.

Ready-to-deploy guardrails for client Claude Code deployments. block-dangerous-commands and protect-secrets are essential safety hooks. Transparent bash scripts, auditable implementation.

Any client Claude Code deployment — these hooks are foundational safety guardrails that should be part of every production setup.

Claude Code Claude Cowork Claude Chat

https://github.com/karanb192/claude-code-hooks

By karanb192

How to Get It

Claude Code only: Hooks are configured in your project's .claude/settings.json file. They run automatically before or after Claude takes actions. You can ask Claude to set up a hook for you by describing what you want in your conversation. Not available in Claude Cowork or Claude Chat.

Instructions to paste into Claude
git clone https://github.com/karanb192/claude-code-hooks
mkdir -p ~/.claude/hooks && cp claude-code-hooks/hook-scripts/pre-tool-use/block-dangerous-commands.js ~/.claude/hooks/

Then add a PreToolUse entry to .claude/settings.json pointing at node ~/.claude/hooks/block-dangerous-commands.js (the repo README shows the exact JSON block), and restart Claude Code. Repeat the copy step for the other hooks you want (protect-secrets, etc.). Requires Node.js.
First thing to try

After installing, paste this into Claude:

Help me block known dangerous shell commands across all sessions
CostFree

Trust Signals Auto-scanned

Stars462Contributors6Last updated2026-07-19LicenseMIT (OK for commercial use)Known CVEsNone foundSources: GitHub Advisory Database + OSV.dev · Scanned 2026-07-31 · scanner v1

Data & Access

Data processingPrompts sent to Anthropic API. Enterprise/Team plans exclude training.

Community Pulse Active

Discussed on Hacker News, Reddit

3 mentions across 1 sources

Reviewer notes

Auto-scanned review. These are observations, not a security certification.

catalog_hygiene stale-eval refresh: Scored from trust signals (evidence-eval-v1): 437 GitHub stars; 1 contributors; last commit 1d ago; license MIT.

Things to check

  • Hooks are reactive, not preventative—they block after detection rather than restrict Claude's capability upfront. Effectiveness depends on exact command patterns; sophisticated obfuscation or indirect execution paths may bypass filters.

How to evaluate tools before deploying →

Data shown here comes from public APIs and automated scanning. Reviewer notes reflect one person's experience. This is not a security certification or legal recommendation. Always evaluate tools according to your own organization's policies.

Evaluation

Ease of Use
3/5
Versatility
4/5
Reliability
3/5
Security
3/5
Overall score3.25 / 5.00 UsableEvaluatedJul 2026
catalog_hygiene stale-eval refresh: Scored from trust signals (evidence-eval-v1): 437 GitHub stars; 1 contributors; last commit 1d ago; license MIT.

← Back to the Claude Observatory

Rolling Claude out in your org? Let's talk.

Start a conversation →