← ClaudeAtlas

clarc-hooks-authoringlisted

Reference guide for writing, testing, and configuring clarc hooks — PreToolUse, PostToolUse, SessionStart, SessionEnd patterns with suppression and cooldown.
marvinrichter/clarc · ★ 9 · AI & Automation · score 69
Install: claude install-skill marvinrichter/clarc
## When to Use Use this skill when: - Adding a new hook to clarc's hook system - Debugging why a hook fires or doesn't fire - Configuring per-project hook suppression - Understanding the difference between blocking and advisory hooks - Writing a PreToolUse hook that validates or blocks a Bash command before Claude executes it - Creating a PostToolUse nudge that reminds the developer to run a security review after editing auth-related files - Implementing a cooldown mechanism so an advisory nudge fires at most once per N minutes instead of on every file save - Combining multiple checks for the same event into a single dispatch script to avoid spawning one Node.js process per check ## Hook System Overview Hooks are Node.js scripts in `scripts/hooks/` registered in `hooks/hooks.json`. They intercept Claude Code tool calls at specific lifecycle events. ``` hooks/hooks.json ← registration (event, matcher, command) scripts/hooks/*.js ← implementation scripts .clarc/hooks-config.json ← per-project suppression config ~/.clarc/hooks-config.json ← global suppression config ``` ## Event Types | Event | When | Common Uses | |-------|------|-------------| | `PreToolUse` | Before tool executes | Validation, blocking, warnings | | `PostToolUse` | After tool completes | Formatting, nudges, logging | | `SessionStart` | New session begins | Context loading, project detection | | `SessionEnd` | Session closes | State saving, weekly tasks | | `PreCompact` | Before context