
hook-manager
by b-open-io
prompts for generating powerful code using open-protocols
SKILL.md
name: hook-manager description: Discover and install Claude Code hooks from bopen-tools. This skill should be used when users ask to "list hooks", "install a hook", "show available hooks", "enable hook", "what hooks are available", or need help managing Claude Code automation hooks.
Hook Manager
Discover, install, and manage Claude Code hooks from the bopen-tools collection.
Available Hooks
| Hook | Event | Description | Auto-install |
|---|---|---|---|
protect-env-files | PreToolUse | Blocks edits to .env files (security) | Recommended |
uncommitted-reminder | Stop | Shows uncommitted changes when Claude stops | Optional |
auto-git-add | PostToolUse | Auto-stages files after edits | Optional |
time-dir-context | UserPromptSubmit | Adds timestamp/dir/branch to prompts | Optional |
lint-on-save | PostToolUse | Runs lint:fix after file edits | Optional |
lint-on-start | SessionStart | Runs linting on session start | Optional |
auto-test-on-save | PostToolUse | Runs tests after file edits | Optional |
protect-shadcn-components | PreToolUse | Protects shadcn UI components | Optional |
Installing a Hook
Hooks are installed by copying the JSON config to ~/.claude/hooks/:
# Create hooks directory if needed
mkdir -p ~/.claude/hooks
# Copy hook from plugin cache
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/<hook-name>.json ~/.claude/hooks/
Then restart Claude Code to load the hook.
Hook Details
protect-env-files (Recommended)
Security hook - Prevents accidental edits to environment files containing secrets.
- Blocks:
.env,.env.local,.env.production,.env.staging - Prompts for confirmation if edit attempted
- No performance impact
uncommitted-reminder
Shows git status when Claude finishes responding if there are uncommitted changes.
- Helps prevent forgotten commits
- Exit code 2 feeds back to Claude
auto-git-add
Automatically runs git add -A after Write/Edit/MultiEdit operations.
- Only stages, never commits
- 5 second timeout
time-dir-context
Adds context line to every prompt: timestamp, working directory, git branch.
- Example:
Context: 2025-01-24 14:32:15 | /Users/you/project | Branch: main
lint-on-save
Runs bun lint:fix after file edits.
- Requires project with
lint:fixscript in package.json - Requires
bunandjq - Works with statusline for lint count display
lint-on-start
Runs linting when session starts.
- Same requirements as lint-on-save
auto-test-on-save
Runs tests after file edits.
- Can be slow on large test suites
- Consider project-specific setup
protect-shadcn-components
Prevents edits to shadcn/ui component files.
- Only relevant for projects using shadcn/ui
Uninstalling a Hook
rm ~/.claude/hooks/<hook-name>.json
Restart Claude Code.
Listing Installed Hooks
ls ~/.claude/hooks/
Quick Install Commands
# Security (recommended)
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/protect-env-files.json ~/.claude/hooks/
# Workflow helpers
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/uncommitted-reminder.json ~/.claude/hooks/
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/auto-git-add.json ~/.claude/hooks/
# Context enrichment
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/time-dir-context.json ~/.claude/hooks/
# Development automation
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/lint-on-save.json ~/.claude/hooks/
cp ~/.claude/plugins/cache/bopen-tools/user/.claude/hooks/lint-on-start.json ~/.claude/hooks/
Verifying Installation
After installing and restarting Claude Code:
claude --debug
Look for hook registration messages in the debug output.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon