Claude Code hook
Claude Code Guardrails
Protective hooks that guard against lost work via branch protection and automatic checkpoints.
Install
git clone https://github.com/wangbooth/Claude-Code-Guardrails.gitFrom the README
π‘οΈ Claude Code Guardrails Smart Guardrail System for Safer Claude Code Development π₯ If this project helps you, please click the β Star in the top right corner to support us! πΊπΈ English | π¨π³ δΈζ | π―π΅ ζ₯ζ¬θͺ π¨ Pain Points: Claude Code's "Dangerous Moments" Have you ever encountered these frustrating scenarios while Vibe Coding? β Direct modification on main branch β One mistake, important code gets overwritten β Interrupted modifications β Intermediate artifacts lost, unable to rollback to specific states β Chaotic multiple modifications β Don't know which change introduced the bug β Accidentally deleted important files β No timely commits, game over β Manual changes overwritten β AI directly overwrites uncommitted manual changes, cannot distinguish code ownership π‘ Solution: Claude Code Guardrails Guardrails based on Claude Code Hook Triple Security Mechanism: π‘οΈ Pre-write Interception Alert + πΈ Precise Snapshot Commits + π Smart Merge Archiving β Protected branch interception β Automatically blocks writes to main branch, suggests creating feature branch β Uncommitted changes protection β Blocks when manual changes are uncommitted, forces commit first to avoid overwriting β File-level precise snapshots β Each modification only commits changed files, avoiding noise β Smart backup mechanism β Automatic backup before gitignore file modifications β Safe history merging β Multiple checkpoints intelligently merged into clean task commits π Start experiencing now! β¨ Core Features π‘οΈ Dual Security Protection - Protected branch interception - Uncommitted changes detection - Pre-write blocking alerts - Smart suggestion to create vibe branch - Force commit manual changes before continuing πΈ Precise Snapshots - File-level snapshotβ¦
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- wangbooth/Claude-Code-Guardrails
- Type
- Hooks
- Language
- Shell
- License
- MIT
- Last updated
- 15 September 2025
- Topics
- claude-codeclaude-code-hooksvibe-coding
- Listed in
- awesome-claude-code-hooks
FAQ
What is Claude Code Guardrails?
Protective hooks that guard against lost work via branch protection and automatic checkpoints. It is a hook for Claude Code, from wangbooth/Claude-Code-Guardrails on GitHub.
How do I install Claude Code Guardrails?
Clone wangbooth/Claude-Code-Guardrails from GitHub and follow the setup steps in its README.
Is Claude Code Guardrails popular?
wangbooth/Claude-Code-Guardrails has 54 GitHub stars and 2 forks, and is included in 1 curated Claude Code list. It was last updated on 15 September 2025.
More hooks
Claude Prime
120avibebuilder/claude-prime
You've heard Claude Code can do amazing things. Skills, hooks, agents, memory systems β but who has time to figure all that out? Claude Prime sets it up for you in one command.
vibeguard
44majiayu000/vibeguard
Rust CLI providing scoped review rules and native Bash/Git hooks for Claude Code.
Boucle Framework
126Bande-a-Bonnot/Boucle-framework
Autonomous agent framework with structured memory, safety hooks, and loop management. Built by the agent that runs on it.
Tiktok Skills
107sergebulaev/tiktok-skills
TikTok marketing skills for Claude Code and Codex: 3-second video hooks, captions, trend mapping, and a weekly plan. Draft, humanize, and publish via Publora. MIT. Content engineering by Creative Content Crafts.
Claude Code Patterns
126AaronRoeF/claude-code-patterns
Field-tested Claude Code patterns & anti-patterns for personal agents β an AI workflow that compounds: knowledge base, memory consolidation, hooks, subagents. Enterprise agent trust: agentrust-io.com. Updated monthly.
Cmds Llm Wiki
100johnfkoo951/cmds-llm-wiki
LLM Wiki template β Karpathy 3-layer pattern + Gold In Gold Out purpose gate + dual Claude CodeΒ·Codex harness (11 commands, 2 hooks, 18 web clipper templates)
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.