Skip to main content

claude-code-hooks

How to write, test, register, and debug Claude Code hooks โ€” PreToolUse / PostToolUse / SessionStart / Stop Bash guards that enforce a rule the model would otherwise talk itself past. Use whenever the user wants to create a hook, block/intercept a tool call, turn a repeatedly-violated rule into a hard gate, add a guard rail, debug a hook that misfires or "poisons the session", register a hook across profiles, or mentions hooks / PreToolUse / Stop hook / ๆ‹ฆๆˆช / ๅฎˆๅซ / ้’ฉๅญ / ๆ‹ฆไธ‹. Bakes in the hard-won pitfalls: UserPromptSubmit only ever sees user input, never Claude's own text โ€” a rule about Claude's own output belongs on Stop instead; token-level shlex matching (never awk splitting); bash -n + real-JSON end-to-end testing BEFORE registering (a corrupted PreToolUse hook poisons every Bash call); SSOT + symlink so a ~/.claude reinstall can't lose it; multi-profile convergence; and human-confirmation release gates. Reach for this even for "make it stop doing X" โ€” a durable stop is a hook, not a reminder.

Jump to install

Source facts

Repository
TuYv/ccpm
Last source activity
August 14, 2026 at 19:45
Detected SKILL.md language
English
Stars
1
Forks
2

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.