HeyItsGilbert

ClaudeHooks — Development skill for Claude Code

Development community

PowerShell helpers for writing and registering Claude Code hook scripts.

How to install ClaudeHooks

This entry records only its repository, not the path inside it, so there is no exact command to give. Open HeyItsGilbert/ClaudeHooks and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What ClaudeHooks does

PowerShell helpers for writing and registering Claude Code hook scripts.

Alternatives in Development

  • Career-Ops For Codex — Read CLAUDE.md for all project instructions, routing, and behavioral rules 32.5k ★
  • Interview Script — Create structured customer interview scripts with JTBD probing 7.8k ★
  • Claude Hooks Mastery — 3,300+ Complete mastery guide for Claude Code hooks with production-ready scripts 3.4k ★

README

ClaudeHooks

PowerShell helpers for writing and registering [Claude Code](https://code.claude.com) hook scripts.

Installation

Install from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ClaudeHooks):

Install-Module ClaudeHooks

Quickstart: Write a hook

Create a hook script that denies `rm -rf` commands in Bash:

# ~/.claude/hooks/block-rm-rf.ps1
Import-Module ClaudeHooks

$hook = Read-ClaudeHookInput
$base = Get-ClaudeBashBaseCommand $hook.tool_input.command
if ($base -eq 'rm' -and $hook.tool_input.command -match '-rf?') {
    Write-ClaudeHookDeny -Reason 'rm -rf is not allowed. Use Remove-Item -Recurse instead.'
}

Then register it:

Add-ClaudeHookConfig -Event PreToolUse -Matcher Bash `
    -ScriptPath '~/.claude/hooks/block-rm-rf.ps1' -Scope User

Quickstart: Register a hook

List all registered hooks:

Get-ClaudeHookConfig | Format-Table

Test a hook with sample input:

Test-ClaudeHookConfig -Event PreToolUse -Matcher Bash

Remove a hook:

Remove-ClaudeHookConfig -Event PreToolUse -Matcher Bash `
    -ScriptPath '~/.claude/hooks/block-rm-rf.ps1' -Scope User

Decision matrix

Choose the right function based on your hook's situation:

Situation Use
PreToolUse - allow Write-ClaudeHookAllow
PreToolUse - deny Write-ClaudeHookDeny
PreToolUse - ask user Write-ClaudeHookAsk
PreToolUse - allow with modified input Write-ClaudeHookUpdatedInput
Stop / UserPromptSubmit / PostToolUse - block Write-ClaudeHookBlock
Any event - inject context for Claude