Claude Code Guardrails banner
rulebricks rulebricks

Claude Code Guardrails

Productivity community

Description

Real-time guardrails for Claude Code tool calls.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

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](https://stoplight.ai).**

Claude Code Guardrails

![Example Table](example.png)

`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.

Claude Code → PreToolUse hook → Rulebricks API → allow / deny / ask

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**

git clone https://github.com/rulebricks/claude-code-guardrails
cd claude-code-guardrails
./install.sh

Claude will detect your published rules and wire up the appropriate hooks.

3. Restart Claude Code

You're done.

What gets checked

Template Matcher What it controls
Bash Command Guardrails Bash Shell commands
File Access Policy `R