Claude-code-hooks setup

Set up claude-code-hooks for your project. Guides you through choosing which hooks to enable and configuring environment variables.

install
source · Clone the upstream repo
git clone https://github.com/yurukusa/claude-code-hooks
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/yurukusa/claude-code-hooks "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/setup" ~/.claude/skills/yurukusa-claude-code-hooks-setup && rm -rf "$T"
manifest: skills/setup/SKILL.md
source content

Claude Code Hooks Setup

You are helping the user set up production safety hooks for Claude Code.

Available Hooks

HookPurposeEventMatcher
context-monitor.shContext window warnings (40% → 25% → 20% → 15%)PostToolUseall
activity-logger.shJSONL audit trail of file changesPostToolUseEdit|Write
syntax-check.shAuto syntax validation after editsPostToolUseEdit|Write
decision-warn.shAlerts on edits to sensitive pathsPreToolUseEdit|Write
cdp-safety-check.shBlocks raw WebSocket CDP constructionPreToolUseBash
proof-log-session.sh5W1H session summariesStop, PreCompactall
session-start-marker.shRecords session start timePostToolUseall
no-ask-human.shBlocks questions during autonomous operationPostToolUseall
branch-guard.shBlocks pushes to main/masterPreToolUseBash
error-gate.shBlocks external actions when errors existPreToolUseBash

Setup Profiles

Minimal (recommended for beginners)

  • context-monitor.sh + syntax-check.sh
  • Catches the two most common failure modes

Standard (recommended for most users)

  • All of minimal + activity-logger.sh + branch-guard.sh + decision-warn.sh + proof-log-session.sh + session-start-marker.sh
  • Good balance of safety and visibility

Autonomous (for unattended operation)

  • All hooks enabled including no-ask-human.sh and error-gate.sh
  • Maximum safety for headless/autonomous Claude Code sessions

Steps

  1. Ask which profile the user wants (or let them pick individual hooks)
  2. The plugin's hooks.json already configures the autonomous profile by default
  3. Help configure environment variables if needed:
    • CC_CONTEXT_MISSION_FILE
      — path to mission.md (default:
      $HOME/mission.md
      )
    • CC_ACTIVITY_LOG
      — path to activity log (default:
      $HOME/claude-activity-log.jsonl
      )
    • CC_MONITORED_DIRS
      — colon-separated paths for decision-warn (default:
      $HOME/bin:$HOME/.claude/hooks
      )
    • CC_PROTECT_BRANCHES
      — colon-separated branch names (default:
      main:master
      )
    • CC_ERROR_LOG
      — path to error tracker (default:
      $HOME/.claude/error-tracker.log
      )
    • CC_PROOF_LOG_DIR
      — path to proof logs (default:
      $HOME/proof-log
      )
  4. Verify the setup works by running a quick test