mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
ceb3a9e40c
Enhanced the dangerous-command-blocker hook with comprehensive protection: ## Features: - **3-Level Security System:** - Level 1: Block catastrophic commands (rm -rf /, dd, mkfs, fork bombs) - Level 2: Protect critical paths (.claude/, .git/, node_modules/, .env, etc.) - Level 3: Warn about suspicious patterns (wildcards, chained commands) - **Python Script Architecture:** - Moved from inline Python to dedicated script for better maintainability - Script auto-installed to .claude/scripts/dangerous-command-blocker.py - Clear regex patterns and detailed error messages - **Protected Resources:** - Claude Code configuration (.claude/) - Git repository (.git/) - Node.js dependencies (node_modules/, package.json, package-lock.json) - Environment files (.env, .env.local, etc.) - Language manifests (Cargo.toml, go.mod, requirements.txt, Gemfile, composer.json) ## Testing: - 16/16 test cases passing (100%) - Blocks catastrophic operations - Protects critical project files - Warns on suspicious patterns - Allows safe operations Co-authored-by: Claude <noreply@anthropic.com>
4.6 KiB
Executable File
4.6 KiB
Executable File