
hooks-security
Security hooks that guard branches and protect files during Claude Code sessions.
- version
- 1.0.0
- GitHub stars
- 3.8K
What it does
- Adds 4 hooks (
branch-guard,file-protection-hook,file-protection, andsecurity-scanner) that fire on Claude Code events - Enforces branch restrictions through
branch-guardand blocks edits to protected files via the file protection hooks - Runs a
security-scannerhook to check activity during event-driven automation
Security Hooks - Event-driven automation hooks
Add marketplace
/plugin marketplace add davepoon/buildwithclaudeRun it inside Claude Code once, then install the plugin below.
Install
/plugin install hooks-security@buildwithclaudeRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourcebranch-guard
Prevents accidental git push commands to main or master branches. Allows pushes to feature/staging branches.
Event Configuration
- Event Type:
PreToolUse - Tool Matcher:
Bash - Category: security
What It Blocks
git push origin maingit push --force origin master- Any variant targeting protected branches
What It Allows
git push origin feature-branchgit push origin develop- All other git commands
- All non-git commands
Environment Variables
| Variable | Default | Description |
|---|---|---|
CC_PROTECT_BRANCHES | main:master | Colon-separated list of protected branches |
Example: Protect additional branches
export CC_PROTECT_BRANCHES="main:master:production:release"
Requirements
jqfor JSON parsing
Source
From claude-code-hooks — battle-tested hooks from 140+ hours of autonomous Claude Code operation.
From the davepoon/buildwithclaude README
Build with Claude
Claude Skills, Agents, Commands, Hooks, Plugins, Marketplaces collections for and extend Claude Code
A plugin marketplace and discovery platform for Claude Code. Browse curated plugins, discover community contributions, and extend your Claude Code workflows.
Quick Start
# Add the Build with Claude marketplace
/plugin marketplace add davepoon/buildwithclaude
# Browse available plugins
/plugin search @buildwithclaude
# Install plugins
/plugin install <plugin-name>@buildwithclaude
What's Included
Build with Claude Plugins
Curated collections maintained in this repository:
| Type | Count | Description |
|---|---|---|
| Agents | 117 | Specialized AI experts (Python, Go, DevOps, Security, etc.) |
| Commands | 175 | Slash commands for automation (/commit, /docs, /tdd) |
| Hooks | 28 | Event-driven automation (notifications, git, formatting) |
| Skills | 26 | Reusable capabilities from plugins |
| Plugins | 51 | Bundled plugin packages by category |
Community Discovery
The platform indexes plugins from the broader Claude Code ecosystem:
- 20k+ Community Plugins from external marketplaces
- 4,500+ MCP Servers for database, API, and tool connections
- 1,100+ Plugin Marketplaces from the community
Web UI
Browse, search, and explore everything at buildwithclaude.com
Build with Claude Homepage
Browse Plugins
Browse Skills
Browse MCP Servers
Browse Plugin Marketplaces
Features
- Browse all plugin types with filtering
- Search across plugins, agents, commands, hooks, skills
- Copy install commands with one click
- View full documentation and usage examples
- Discover MCP servers and community plugins
Installation Options
Option 1: Plugin Marketplace (Recommended)
# Add marketplace
/plugin marketplace add davepoon/buildwithclaude
# Install specific plugins
/plugin install agents-python-expert@buildwithclaude
/plugin install commands-version-control-git@buildwithclaude
/plugin install hooks-notifications@buildwithclaude
# Or install everything
/plugin install all-agents@buildwithclaude
/plugin install all-commands@buildwithclaude
/plugin install all-hooks@buildwithclaude
Option 2: Manual Installation
# Clone repository
git clone https://github.com/davepoon/buildwithclaude.git
cd buildwithclaude
# Install agents
find plugins/agents-*/agents -name "*.md" -exec cp {} ~/.claude/agents/ \;
# Install commands
find plugins/commands-*/commands -name "*.md" -exec cp {} ~/.claude/commands/ \;
# Restart Claude Code
Available Plugin Categories
Agents (11 categories)
- Development & Architecture - Backend, frontend, mobile, GraphQL experts
- Language Specialists - Python, Go, Rust, TypeScript, C/C++ experts
- Quality & Security - Code review, security audit, debugging
- Infrastructure & Operations - DevOps, cloud, database optimization
- Data & AI - ML engineering, data pipelines, AI development
- Crypto & Blockchain - Trading systems, DeFi, Web3 development
Browse Subagents
Commands (22 categories)
- Version Control - Commit, PR creation, branch management
- Code Analysis - Testing, review, optimization
- Documentation - Docs generation, changelogs, API specs
- Project Management - Todos, PRDs, task tracking
Browse Commands
Hooks (8 categories)
- Notifications - Slack, Discord, Telegram alerts
- Git - Auto-staging, smart commits
- Development - Lint on save, auto-format
- Security - File protection, vulnerability scanning
Browse Hooks
Usage Examples
Using Agents
Agents are automatically invoked based on context, or explicitly called:
"Use the python-pro to optimize this function"
"@agent-security-auditor review this authentication code"
"Have the devops-troubleshooter help debug this deployment"
Using Commands
Commands use the / prefix:
/commit # Create conventional commit
/create-pr # Create pull request
/docs # Generate documentation
/tdd # Start test-driven development
/code_analysis # Analyze code quality
Using Hooks
Hooks run automatically on events like tool calls or session start.
Contributing
We welcome contributions!
Adding Plugins
- Create a new directory in
plugins/following the naming convention - Add your plugin files (agents, commands, hooks)
- Run
npm testto validate - Submit a pull request
Plugin Format
Agent (plugins/agents-*/agents/*.md):
---
name: agent-name
description: When to invoke this agent
category: category-name
tools: Read, Write, Bash
---
You are a [role description]...
Command (plugins/commands-*/commands/*.md):
---
description: What this command does
category: category-name
argument-hint: <args>
---
Command implementation...
Hook (plugins/hooks-*/hooks/*.md):
---
hooks: PreToolUse, PostToolUse
description: What this hook does
---
Hook implementation...
See CONTRIBUTING.md for detailed guidelines.
Contributors
This project exists thanks to all the people who contribute.
Links
- Web UI: buildwithclaude.com
- Documentation: Claude Code Docs
- Plugin Marketplaces: Plugin Docs
- Issues: GitHub Issues
License
MIT License - see LICENSE for details.
Made with ❤️ by Dave Poon
Details
- Marketplace
- davepoon/buildwithclaude
- Source
- plugins/hooks-security
- Author
- BuildWithClaude Community
- Category
- Hooks
- License
- MIT
- Keywords
- hooks, automation, security, file-protection, file-protection-hook, security-scanner
- Listed since
- Apr 6, 2026
More from davepoon/buildwithclaude
All 237- hooks-testingv1.0.0
- interviewv1.0.0
- isitdonev0.5.2
- keep-mac-awakev1.0.4
- kegg-mcp-serverv0.5.0
- kernel-development-skillsv0.4.3
- kordocv4.21.14
- korean-lawv4.15.6
- kumiv1.5.1
- kuudo-skillsv0.5.0
- lagos-diseno-esv1.0.0
- lead-finderv1.0.1
- legwisev1.1.1
- levea-video-editorv1.1.1
- lexio-apiv0.1.0
- lidnightv0.1.1
- lnplv0.8.0
- lnpl-mcpv0.8.0
- logbrewv0.3.2
- loootv0.2.1
- magic-cc-codex-workerv0.3.3
- mcp-servers-dockerv1.0.0
- memory-loopv2.3.1
- midpoint-card-pricesv1.0.1
Similar to hooks-security
More Security
hooks-performancedavepoon/buildwithclaude3.8K starsPerformance Hooks - Event-driven automation hooks
hooks-developmentdavepoon/buildwithclaude3.8K starsDevelopment Hooks - Event-driven automation hooks
hookifyathola/claude-night-market350 starsBehavioral rules engine: create safety hooks through markdown configuration with pattern matching and zero-code rule authoring
security-prodavila7/claude-code-templates24.2K starsEnterprise security toolkit with auditing, penetration testing, and compliance automation
safety-hookspchalasani/claude-code-tools2K starsProvides safety guards to block or require confirmation for risky CLI operations (e.g., rm, destructive git actions, .env access, large file operations)
security-guidanceccplugins/awesome-claude-code-plugins1K starsSecurity reminder hook that warns about potential security issues when editing files, including command injection, XSS, and unsafe code patterns