Claude Code hook
Rulebricks Guardrails
Real-time guardrails for Claude Code tool calls backed by Rulebricks rule tables.
Install
git clone https://github.com/rulebricks/claude-code-guardrails.gitFrom the README
We have since built a dedicated product to help developers manage AI permissions better, which we intend to make open source. Check it out at stoplight.ai. Claude Code Guardrails settings.json works if: - You're fine editing JSON and killing Claude Code sessions every time policy changes - Your security team is comfortable making PRs - You don't need to know what got blocked, when, or for whom - Basic pattern matching like Bash(rm:*) covers your use cases Use this if: - Policy changes need to apply instantly across your team—no git pull, no restart - Security/compliance needs a clear audit trail of every blocked command - You need conditional logic: "allow rm -rf on node_modules, deny everywhere else" - Non-engineers need to edit rules without touching config files Rulebricks gives you instant governance from one hook. Setup (5 minutes) 1. Create your rules 1. Go to rulebricks.com and create an account 2. Fork one of these templates from the "AI Agents" category: - Claude – Bash Guardrails — control shell commands - Claude – File Access Policy — control file read/write/edit - MCP Tool Governance — control MCP server operations 3. Customize the rules for your team 4. Publish the rule 5. Copy your API key from the API tab 2. Install Automatically finds your rules Claude will detect your published rules and wire up the appropriate hooks. 3. Restart Claude Code You're done. What gets checked Configuration Environment variables in ~/.claude/settings.json: Updating rules Edit your decision table and publish a new version. Changes apply immediately— no restart, no redeployment. Reviewing histories Review the history of blocked commands in the Logs tab. You can query by tool, approval decision, and more. There are other meaningful perks to this…
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
- rulebricks/claude-code-guardrails
- Type
- Hooks
- Language
- Python
- License
- MIT
- Last updated
- 4 February 2026
- Listed in
- awesome-claude-code-hooks
FAQ
What is Rulebricks Guardrails?
Real-time guardrails for Claude Code tool calls backed by Rulebricks rule tables. It is a hook for Claude Code, from rulebricks/claude-code-guardrails on GitHub.
How do I install Rulebricks Guardrails?
Clone rulebricks/claude-code-guardrails from GitHub and follow the setup steps in its README.
Is Rulebricks Guardrails popular?
rulebricks/claude-code-guardrails has 79 GitHub stars and 10 forks, and is included in 1 curated Claude Code list. It was last updated on 4 February 2026.
More hooks
Claude Code Blueprint
119Aedelon/claude-code-blueprint
Production-grade Claude Code configuration: skills, agents, hooks, rules, and permissions working as a system.
Pitchcraft
201moshuying/pitchcraft
汇报.skill · pitchcraft — Structured persuasion for tech leads, PMs, and founders: kickoff, status, wrap-up, pitch, and solution selling on one 5-part framework (Hook→Context→Proposal→Evidence→Ask), with AI material intake and a pre-submit checklist. Works with Claude Code, Cursor, Codex, and more.
Kim Service
177KimYx0207/Kim_Service
面向 Claude Code、Codex 等 AI 编码助手的 Hook 与 Agent Skill 开源合集。
Claude Heartbeat
184Siigari/claude-heartbeat
Keep Claude Code alive and autonomous without -p. Heartbeat hook + inbox/outbox pattern.
Codex Skill
226cathrynlavery/codex-skill
Give Claude Code a second opinion using OpenAI Codex - automatic plan review via hooks
Claude Hooks Manager
74webdevtodayjason/claude-hooks
CLI for listing, adding and managing hooks in Claude Code settings.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.