cc-hooks (Claude Code Hook Configurator)
Installs, repairs and tests Claude Code hooks so risky commands are blocked mechanically instead of by polite instructions.
Dev & CodingAdvanced★ 444⑂ 41AI score 9/10Last updated: Sep 22, 2026
What it does
- Writes or repairs the hooks block (matcher + command) in
~/.claude/settings.jsonor a project.claude/settings.json, using the correct array format. - Honours each event's contract —
PreToolUse,PostToolUse,PermissionRequest,Stop,SessionStart— including what can block and the exit-code semantics (0 = allow, 2 = block with stderr, JSONallow/deny/ask). - Ships guard recipes and opt-in installers for real hazards:
git push --force,rm -rf, edits to installed skill copies, unbounded file reads over a line budget, plus a policies-as-data dispatcher. - Enforces hard-won rules: silence on the happy path (stray stdout on exit 0 corrupts the tool call),
stop_hook_activechecks to avoid recursion, narrow reversible matchers.
Who it's for
- Developers and platform engineers running Claude Code who want policy-level guardrails
- Anyone debugging a hook that broke tool calls or caused an infinite Stop loop
- Teams whose CLAUDE.md rules keep getting ignored and need mechanical enforcement
Examples
- "Add a PreToolUse hook that blocks
git push --forceon main — silent on exit 0, exit 2 with a message, and prove it fires before committing." - "Wire a PostToolUse auto-formatter for Edit|Write that prints nothing on success."
- "Add a Stop hook that forces continuation while tests fail, guarded by
stop_hook_active."
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/boshu2/agentops/HEAD/images/gemini/skills/cc-hooks/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the images/gemini/skills/cc-hooks folder from the GitHub repo boshu2/agentops into my ~/.claude/skills/cc-hooks/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/boshu2/agentops.git /tmp/agentops && mkdir -p ~/.claude/skills && cp -r /tmp/agentops/images/gemini/skills/cc-hooks ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and create the skills directory:
mkdir -p ~/.claude/skills - Clone the repository:
git clone https://github.com/boshu2/agentops.git /tmp/agentops - Copy the skill:
cp -r /tmp/agentops/images/gemini/skills/cc-hooks ~/.claude/skills/ - Confirm the bundled docs came along:
ls ~/.claude/skills/cc-hooks - Install
jqif missing (macOS:brew install jq; Ubuntu:sudo apt install jq) — the policy scripts require it. - Restart Claude Code and ask something like "use cc-hooks to add a PreToolUse guard for ...".
- Verify any installed hook with
claude --debugor/hooks; to roll back, delete the matcher entry from settings.json.
View source on GitHub ↗License: Apache-2.0