SkillAgentSearch skills...

claude-code-hooks

Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging.

Install / Use

npx skills add aiskillstore/marketplace --skill claude-code-hooks

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

85/100

Supported Platforms

Claude Code

Tags

Our assessment of claude-code-hooks

claude-code-hooks scores 85/100 on our quality scale, 243rd of 317 Customer Support skills we index.

Its SKILL.md is 2.9 KB long, well organised into 18 sections with 3 code examples: a solid amount of guidance for an agent.

It has 428 GitHub stars, a meaningful sign that others use it.

Substance
26/30
Structure
18/20
Description
15/15
Adoption
11/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so claude-code-hooks is actively maintained.
  • Our last check on 2026-11-05 found the source still online.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

claude-code-hooks compared with similar skills

All 4 of these similar skills score higher than claude-code-hooks; compare them before choosing.

SkillScoreStarsUpdatedFormat
claude-code-hooks (this skill)by aiskillstore8542855d agoSKILL.md
algorithmic-artby anthropics100177.9k57d agoSKILL.md
pptxby anthropics100177.9k57d agoSKILL.md
prospectingby coreyhaines3110060.1k7d agoSKILL.md
ad-creativeby coreyhaines3110060.1k7d agoSKILL.md

Frequently asked questions

How do I install claude-code-hooks?
Run npx skills add aiskillstore/marketplace --skill claude-code-hooks. The install tabs above show the steps for each supported agent.
Which AI agents does claude-code-hooks work with?
It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
Is claude-code-hooks safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is claude-code-hooks still maintained?
The repository was last updated about 2 months ago, so claude-code-hooks is actively maintained.

name: claude-code-hooks description: "Claude Code hook system for pre/post tool execution. Triggers on: hooks, PreToolUse, PostToolUse, hook script, tool validation, audit logging." compatibility: "Claude Code CLI with settings.json support" allowed-tools: "Bash Read Write" depends-on: [] related-skills: [claude-code-debug, claude-code-headless]

Claude Code Hooks

Execute custom scripts before/after Claude Code tool invocations.

Quick Reference

| Event | When | Has Matcher | |-------|------|-------------| | PreToolUse | Before tool execution | Yes | | PostToolUse | After tool completes | Yes | | PermissionRequest | Permission dialog shown | Yes | | Notification | Notifications sent | Yes | | UserPromptSubmit | User submits prompt | No | | Stop | Agent finishes | No | | SubagentStop | Subagent finishes | No | | PreCompact | Before context compaction | No | | SessionStart | Session begins/resumes | No | | SessionEnd | Session ends | No |

Basic Configuration

Add to ~/.claude/settings.json or .claude/settings.local.json:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "$CLAUDE_PROJECT_DIR/hooks/validate.sh",
        "timeout": 5000
      }]
    }]
  }
}

Matcher Patterns

| Pattern | Matches | |---------|---------| | "Write" | Only Write tool | | "*" or "" | All tools | | "mcp__*" | All MCP tools | | "Bash" | Bash commands |

Hook Script Requirements

#!/bin/bash
# Receives JSON via stdin: { "tool_name": "...", "tool_input": {...} }
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name')

# Exit codes:
# 0 = Success (continue)
# 2 = Block with error (stderr shown to Claude)
# Other = Non-blocking error

Common Use Cases

| Use Case | Event | Example | |----------|-------|---------| | Validate inputs | PreToolUse | Block dangerous commands | | Audit logging | PostToolUse | Log all tool usage | | Custom approval | PermissionRequest | Slack notification | | Session init | SessionStart | Load project context |

Security Checklist

  • [ ] Quote all variables: "$VAR" not $VAR
  • [ ] Validate paths (no .. traversal)
  • [ ] Use $CLAUDE_PROJECT_DIR for paths
  • [ ] Set reasonable timeouts
  • [ ] Handle jq parsing errors

Troubleshooting

# Debug hook loading
claude --debug

# List registered hooks
/hooks

# Test script manually
echo '{"tool_name":"Bash"}' | ./hooks/validate.sh

Official Documentation

  • https://code.claude.com/docs/en/hooks - Hooks reference
  • https://code.claude.com/docs/en/settings - Settings configuration

Additional Resources

  • ./references/hook-events.md - All events with input/output schemas
  • ./references/configuration.md - Advanced config patterns
  • ./references/security-patterns.md - Production security

See Also: claude-code-debug for troubleshooting, claude-code-headless for CLI automation

Related Skills

View on GitHub
GitHub Stars428
CategoryCustomer
Updated1mo ago
Forks45

Languages

Python

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium