install-hook

Manage Claude Code hooks in per-user settings JSON files.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/ChazzCoin/claude-kit --skill install-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: install-hook
Source: https://github.com/ChazzCoin/claude-kit/tree/main/kit/skills/install-hook
Command: npx skills add https://github.com/ChazzCoin/claude-kit --skill install-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, python3.

What problem does it solve?

This Skill provides a reusable foundation to install, remove, or list Claude Code hooks inside a project-wide or per-user settings.json file. It centralizes hook management so skills can attach to events without duplicating logic.

Core Features & Use Cases

  • Add, remove, or list hooks for events such as SessionStart, SessionEnd, Stop, and PreToolUse.
  • Safely modify per-user or project-scoped settings files with idempotent operations.
  • Create the target file automatically if missing and validate JSON structure.

Quick Start

Add a SessionStart hook that echoes a greeting by running install-hook.sh add SessionStart 'echo hello'.

Frequently Asked Questions about install-hook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a bash command to run automatically when a Claude Code session starts?

You can add a SessionStart hook by running a simple shell command like `install-hook.sh add SessionStart 'echo hello'` to wire Claude Code hooks into your per-user settings JSON file.

Can I automatically manage Claude Code hooks without manually editing JSON files?

Yes, automating Claude Code hook management reads and updates target JSON settings files like `.claude/settings.local.json` directly, validating the JSON structure and creating the file if it is missing.

What is the best way to list or remove event-based hooks in a project settings file?

The best way to list or remove event-based hooks is using an idempotent shell command that targets your project or per-user settings JSON, preventing duplicate entries across events like Stop or PreToolUse.

Do I need Python 3 and git installed to configure Claude Code hooks?

Yes, you need Python 3 installed for JSON manipulation and git for your project environment, as the hook installation process relies on these dependencies to safely modify settings files.

Why are my Claude Code hooks duplicating when I update the settings file?

Duplicating hooks often happens when manually editing JSON; using an idempotent hook installation command ensures that adding an event command to the settings file will not create duplicate entries.

What events are available for automation when wiring Claude Code hooks?

Available automation events for Claude Code hooks include SessionStart, SessionEnd, Stop, and PreToolUse, allowing you to trigger specific bash commands at different lifecycle stages.