- Python 3: Required for running the hook scripts
- Verify:
python3 --version - Install:
brew install python3(requires Homebrew)
- Verify:
- Audio Player:
afplay(built-in, no installation needed)
All details are mentioned in HOOKS-README.md
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- If you don't have a
.claude/settings.jsonfile in your project, create one:touch .claude/settings.json - Open
install/settings-mac.jsonand copy the keys (disableAllHooksandhooks) into your.claude/settings.json
Why separate settings files per platform?
- Python command:
python3(macOS/Linux) vspython(Windows)- Script path:
${CLAUDE_PROJECT_DIR}env variable (macOS/Linux) vs relative path (Windows)
Start Claude, you will hear "Claude session start" which is the sound played on startup.
claude
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-hooksAfter 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.