AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

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★ 445⑂ 41AI score 9/10Last updated: Sep 24, 2026

What it does

  • Writes or repairs the hooks block (matcher + command) in ~/.claude/settings.json or 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, JSON allow/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_active checks 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

  1. "Add a PreToolUse hook that blocks git push --force on main — silent on exit 0, exit 2 with a message, and prove it fires before committing."
  2. "Wire a PostToolUse auto-formatter for Edit|Write that prints nothing on success."
  3. "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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on AI 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.

  1. Open a terminal and create the skills directory: mkdir -p ~/.claude/skills
  2. Clone the repository: git clone https://github.com/boshu2/agentops.git /tmp/agentops
  3. Copy the skill: cp -r /tmp/agentops/images/gemini/skills/cc-hooks ~/.claude/skills/
  4. Confirm the bundled docs came along: ls ~/.claude/skills/cc-hooks
  5. Install jq if missing (macOS: brew install jq; Ubuntu: sudo apt install jq) — the policy scripts require it.
  6. Restart Claude Code and ask something like "use cc-hooks to add a PreToolUse guard for ...".
  7. Verify any installed hook with claude --debug or /hooks; to roll back, delete the matcher entry from settings.json.
View source on GitHub ↗License: Apache-2.0