More screenshots
Works with the AI Agents you already use
Claude Code Hooks Pro: 7 Tested Hooks + Installer
7 tested Claude Code hooks, installed in one command: block dangerous commands, protect secrets, auto-format, and run tests before Claude finishes.
$7
Claude Code Hooks Pro: 7 Tested Hooks + Installer
Example session with this skill installed
Install guardrail hooks in my project: block dangerous commands, protect secrets, auto-format on edit, add session context, and run tests before you stop.
- Read your context and instructions
- Compiled the claude code hooks
Installed 5 hooks into .claude/settings.json (backup saved as settings.json.bak). All 22 tests pass.
Install
$ bash install.sh --scope project --hooks block-dangerous,protect-secrets,format-on-edit,session-context,tests-before-stop
installed block-dangerous -> PreToolUse (Bash)
installed protect-secrets -> PreToolUse (Read|Edit|Write|MultiEdit|Bash)
installed format-on-edit -> PostToolUse (Edit|Write|MultiEdit)
installed session-context -> SessionStart
installed tests-before-stop -> Stop
settings: .claude/settings.json (backup: .claude/settings.json.bak). Run /hooks in Claude Code to verify.
Tests
$ bash tests/run.sh
passed 22, failed 0
What it blocks (real output)
$ echo '{"tool_input":{"command":"rm -rf ~"}}' | .claude/hooks/block-dangerous.sh
Blocked by block-dangerous hook: command matches /rm.../. Use a safer alternative or ask the user to run it manually.
exit 2
$ echo '{"tool_input":{"file_path":"/app/.env.production"}}' | .claude/hooks/protect-secrets.sh
Blocked by protect-secrets hook: '/app/.env.production' looks like a secret. Ask the user for the specific non-secret value instead.
exit 2
| Command / file | Result |
|---|---|
rm -rf node_modules | allowed |
git push origin feature/x | allowed |
git push --force origin main | blocked |
.env.example | allowed |
~/.ssh/id_ed25519 | blocked |
Next steps
- Run
/hooksin Claude Code to see them registered. - Add
CLAUDE_TEST_CMDin settingsenvif your test command isn't auto-detected. - Put extra patterns in
.claude/hooks/blocklist.txt.
Connects securely to your tools. The creator never sees your data.
About this skill
7 tested Claude Code hooks, installed in one command: block dangerous commands, protect secrets, auto-format, and run tests before Claude finishes.
Claude Code's permission rules are a good start, but they can't format files, run your tests, or catch dangerous commands written in a dozen different ways. Hooks can, and you see every script before it runs.
What you get
| Hook | Event | What it does |
|---|---|---|
block-dangerous | PreToolUse (Bash) | Blocks rm -rf / or ~, sudo, curl-pipe-to-shell installs, force-push to main/master, chmod 777, mkfs/dd to disks, DROP DATABASE, git reset --hard origin. Normal commands like rm -rf node_modules still work. |
protect-secrets | PreToolUse (Read/Edit/Write/Bash) | Blocks .env*, SSH keys, ~/.aws credentials, *.pem/*.key, .npmrc/.pypirc/.netrc. Allows .env.example. |
format-on-edit | PostToolUse | Formats the edited file with prettier, ruff/black, gofmt, rustfmt or shfmt, only if installed and only inside the project. |
tests-before-stop | Stop | Runs your fast tests when there are uncommitted changes; if they fail, Claude is told to fix them. Loop-safe. |
session-context | SessionStart | Adds branch, uncommitted files, last 5 commits and HANDOFF.md to context. |
notify | Notification | Desktop notification on macOS and Linux (a beep on WSL) when Claude needs you. |
precompact-handoff | PreCompact | Saves a git-state snapshot before context compaction. |
Plus: an installer (install.sh) that merges hooks into project, local or user settings with jq, backs up the file and never duplicates entries; a 22-case test harness; your own block/protect lists (blocklist.txt, protected.txt); templates to write new hooks.
How it works
- Claude asks which hooks and which scope you want, and shows you the scripts.
install.sh --scope project --hooks block-dangerous,protect-secrets,...tests/run.shchecks every hook (22/22 must pass).- Run
/hooksin Claude Code to confirm they're registered.
Requirements
Claude Code, bash and jq (macOS, Linux or WSL). Formatters and test runners are used only if your project already has them.
Limits
Pattern-based blocking is a safety net, not a sandbox: keep Claude Code's permission rules on too. Windows without WSL is not supported.
Requires jq installed on the host. Scripts must execute within 2 seconds. Hooks run with user permissions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Requires
Permissions
Allowed Hosts