Claude Code hook

Rulebricks Guardrails

Real-time guardrails for Claude Code tool calls backed by Rulebricks rule tables.

79 stars 10 forksHooks Source

Install

From source
git clone https://github.com/rulebricks/claude-code-guardrails.git

From 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…
Read the full README on GitHub

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.
Claude Code docs

Details

Type
Hooks
Language
Python
License
MIT
Last updated
4 February 2026

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

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.