Safety and automation hooks for Claude Code
npx claudepluginhub steeef/claude-hooksCommand safety hooks: rm (with git-ignore support), kubectl, terraform
Git safety hooks: branch workflow enforcement, add/checkout/commit guards, worktree suggestions
File protection hooks: file length limits, read length limits, worktree edit guard
Desktop notifications for Claude Code events (Stop, Notification)
Blocks access to .env files, preventing accidental secret exposure
Clean worktree branch names (no worktree- prefix)
Claude Code marketplace entries for the plugin-safe Antigravity Awesome Skills library and its compatible editorial bundles.
Production-ready workflow orchestration with 79 focused plugins, 184 specialized agents, and 150 skills - optimized for granular installation and minimal token usage
Directory of popular Claude Code extensions including development tools, productivity plugins, and MCP integrations
Safety and automation hooks for Claude Code.
| Plugin | Type | Purpose |
|---|---|---|
| command-safety | PreToolUse | Blocks dangerous commands (rm, kubectl delete, terraform destroy) |
| git-hooks | PreToolUse/PostToolUse | Enforces git safety (no commits to main, blocks dangerous checkout/add patterns) |
| file-protection | PreToolUse | Worktree edit guard, blocks edits to CLAUDE.md, warns on very large files |
| env-protection | PreToolUse | Blocks access to .env files, prevents accidental secret exposure |
| notifications | Stop/Notification | Desktop notifications on macOS |
/plugin marketplace add steeef/claude-hooks
/plugin install command-safety@steeef/claude-hooks
/plugin install git-hooks@steeef/claude-hooks
/plugin install file-protection@steeef/claude-hooks
/plugin install notifications@steeef/claude-hooks
git clone https://github.com/steeef/claude-hooks.git
cd claude-hooks
CLAUDE_HOOKS_DIR environment variable (add to your shell rc file):export CLAUDE_HOOKS_DIR="$HOME/code/claude-hooks"
~/.claude/settings.json:{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/command-safety/hooks/command_hook.py"
},
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/git-hooks/hooks/git_pre_hook.py"
}
]
},
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/file-protection/hooks/file_hook.py"
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/git-hooks/hooks/cleanup_hook.py"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/notifications/hooks/notification_hook.sh"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_HOOKS_DIR/plugins/notifications/hooks/notification_hook.sh"
}
]
}
]
}
}
Blocks potentially destructive commands:
rm on git-tracked files (allows removal of ignored files like build artifacts)kubectl delete, kubectl scale --replicas=0, kubectl cordon, kubectl drainterraform destroyEnforces safe git workflows:
git checkout main -- file overwritesgit add -A, --force flagsProtects important files and encourages worktree workflow:
Prevents accidental exposure of secrets in .env files:
.env reads - both Bash commands (cat .env, grep .env) and Read toolls, mv, cp, touch on .env files.env.example, .env.template, .env.sampleenv-safe script for inspecting variable names without valuesDesktop notifications on macOS using osascript:
Stop events (task completion)Notification eventsRequirements: Python 3.11+
# Install dependencies
uv sync
# Run tests
uv run pytest -v
# Run pre-commit hooks
uvx --with pre-commit-uv pre-commit run --all-files
Based on pchalasani/claude-code-tools.