register-hook
CommunityCreate robust hook scripts and register them safely.
System Documentation
What problem does it solve?
This Skill automates the creation and registration of hook scripts with standardized error handling and proper placement in settings.json, reducing setup mistakes and manual configuration time.
Core Features & Use Cases
- Create Hook Script: Includes mandatory error handling pattern and a safe shebang.
- Set Permissions: Ensure the script is executable.
- Register in settings.json: Add the hook with the correct matcher and trigger.
- Restart Reminder: Warn when changes require a Claude restart.
- Test Instructions: Provide steps to verify the hook executes correctly.
Quick Start
Use the register-hook.sh script to create a hook named "log-bash-commands" with trigger "PreToolUse" and matcher "Bash", and provide the script content as needed. The script would include: #!/bin/bash set -euo pipefail trap 'echo "ERROR in log-bash-commands.sh at line $LINENO: Command failed: $BASH_COMMAND" >&2; exit 1' ERR JSON_INPUT=$(cat) COMMAND=$(echo "$JSON_INPUT" | jq -r '.tool_input.command // empty') echo "[$(date -Iseconds)] $COMMAND" >> /tmp/bash-log.txt
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: register-hook Download link: https://github.com/cowwoc/styler/archive/main.zip#register-hook Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.