Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 1.92 KB

File metadata and controls

65 lines (44 loc) · 1.92 KB

Installation - Linux

⬅ Back to Main README

Prerequisites

  • Python 3: Required for running the hook scripts
    • Verify: python3 --version
    • Install: sudo apt install python3 (Ubuntu/Debian) or sudo yum install python3 (RHEL/CentOS)
  • Audio Player: paplay from pulseaudio-utils
    • Install: sudo apt install pulseaudio-utils

All details are mentioned in HOOKS-README.md


Installation

Step 1: Copy hooks folder

Open terminal in your project directory and run the following commands:

mkdir -p .claude/hooks
git clone https://github.com/shanraisshan/claude-code-hooks.git temp-hooks
cp -r temp-hooks/.claude/hooks/* .claude/hooks/
rm -rf temp-hooks

Step 2: Copy settings.json keys into your existing Claude settings file

  1. If you don't have a .claude/settings.json file in your project, create one: touch .claude/settings.json
  2. Open install/settings-linux.json and copy the keys (disableAllHooks and hooks) into your .claude/settings.json

Why separate settings files per platform?

  • Python command: python3 (macOS/Linux) vs python (Windows)
  • Script path: ${CLAUDE_PROJECT_DIR} env variable (macOS/Linux) vs relative path (Windows)

Step 3: Start Claude

Start Claude, you will hear "Claude session start" which is the sound played on startup.

claude

Optional: Test Agent Hooks

To test the agent-specific hooks (PreToolUse, PostToolUse, Stop), copy the demo agent file:

mkdir -p .claude/agents
git clone https://github.com/shanraisshan/claude-code-hooks.git temp-hooks
cp temp-hooks/.claude/agents/claude-code-hook-agent.md .claude/agents/
rm -rf temp-hooks

After copying, run the agent in Claude Code with:

/agents claude-code-hook-agent

This agent fetches the weather for Dubai and demonstrates the PreToolUse, PostToolUse, and Stop hooks in action.