ClaudeCodeMod

All shelves / Mods / Safety

guardrails

By mishgoldenberg

guardrails is a Claude Code safety mod by mishgoldenberg.

Blocks commands such as rm -rf, mass kubectl deletes, or a force push from clickable rules with presets, and checks scripts Claude wrote before they run.

DrawsHolds a command

Install

The marketplace name is claude-mods.

In your shell
claude plugin marketplace add mishgoldenberg/claude-mods
claude plugin install "guardrails@claude-mods"
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.2.0
License
MIT
Repo stars
11
Last change
2026-10-06

What it can reach

  • Draws in the session
  • Holds a command
  • Sees tool calls

Needs Claude Code 2.1.286 or newer. Restart Claude Code after installing. The README's main install adds mod-manager and picks mods from its /mods pane; this line is from its loop that installs every mod without the manager. Panels dock beside the chat in the desktop app or a terminal 144 columns wide or more, and open inline in narrower ones. Options appear in /config. Function hooks are early access, and a Claude Code update can break a mod. Safe defaults turns on the first time it loads, and /guard-preset off turns everything off. The presets are Safe defaults, Locked to project, and Read-only review. /guard opens the rules panel, where you can add your own patterns, and /guard-log shows what it blocked in the last 7 days. Every block is kept for 30 days on this machine, with commands cut to 200 characters. Claude cannot edit guardrails' own settings. The author calls it a seatbelt, not a sandbox: a script that arrives another way, an obfuscated command, or a shell trick that rewrites its settings can get through. Quoted prose such as a commit message is ignored unless it is handed to a shell.

The marketplace name is claude-mods. The marketplace also holds mod-manager, which installs the others from a pane, and ten more mods. This one installs on its own. The README's loop installs every mod with claude plugin install "$m@claude-mods"; this page puts this mod's name in place of $m. Refusing destructive commands is why this page files it under safety. bash-guard holds every Bash call and blocks rm -rf on a home or system directory. blast-radius holds a risky shell command and shows what it would touch before it asks. This one is a panel of rules you click on or off, including keeping Claude inside the project, and it reads a script Claude wrote this session before a shell command runs it. A blocked call gets a denial that tells Claude not to work around the rule.

Demo

The author's recording of guardrails in the desktop app: asked to run KUBECONFIG=nowhere oc delete all --all -n demo, the command is blocked, a toast reads guardrails: Blocked Bash: Block mass deletes in clusters & infra, and Claude explains that the rule blocked it and that it will not try a reworded command. The project is the author's sample.
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • command.runWhen you run its slash command/guard/guard-preset/guard-log
  • tool.callAround a tool call, where it can hold one
  • ui.renderDraws into the sessionPane

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 3

  • /guardOpen guardrails: toggle safety rules and presets
  • /guard-presetApply a guardrail preset
  • /guard-logWhat guardrails blocked in the last 7 days

Files

The author's source, 3 files. They load when you open them.

Facts

Author
mishgoldenberg
Category
Safety
Marketplace
claude-mods
Repo
mishgoldenberg/claude-mods
Folder
plugins/guardrails
Version
0.2.0
License
MIT
Repo stars
11
Last change
2026-10-06
Language
TypeScript
Files
5

Other mods in Safety

loop-breakermishgoldenbergNotices Claude going in circles, the same command failing 3 times or the same code rewritten 3 times in a turn, tells you, and tells Claude to stop and rethink.scope-guardtheonly1meHolds a commandAsks before Claude edits, deletes, or moves files outside what you asked for, and flags milder drift above the prompt with keys to pull Claude back.installguardgrichesHolds a commandHolds a package install the registry flags, such as a made-up name, a lookalike, or an hours-old release, and asks you, with a report pane beside the question.flywheel-modHarperZ9Holds a commandHolds a risky shell or file-edit call when the Flywheel monitor flags it, shows held and passed counts above the prompt, and writes a receipt for each turn.push-gateIvanLutsenkoHolds a commandAsks before every git push the model runs, with the repository, branch, upstream, commit count, and a force-push warning, and runs the confirmed push itself.devtoolsNMenzelHolds a commandHolds a tool call at a breakpoint you set for Continue, Step, or Reject, with a dashboard pane of every call and Error Lens on why a call failed.agentic-flowruvnetHolds a commandRefuses an agentic_flow_agent call whose task matches a destructive or exfiltration pattern or passes an API key, and adds a status-line entry for the guard.agentdbruvnetHolds a commandRefuses a write to AgentDB memory that holds a key, token, password, or private key, and refuses its destructive admin tools unless you turn them on.cc-askpassGoneToneOpens a password pane when a command Claude runs asks for sudo, ssh, or git credentials, so the password goes to the program and never reaches the model.secret-envtoy-craneHolds a commandOpens a pane for typing an API key into a .env file, shows [hidden] wherever the value appears in tool results, and denies Write and Edit on that key's line.mod-blast-radiusv-amorimHolds a commandHolds a risky Bash command on a card until you choose Run or Cancel, shows what it would change first, and reads your own rules from a JSON file.mod-collision-guardv-amorimHolds a commandPauses a file edit when another open session just edited that file, and asks you to proceed, move to a worktree, cancel, or type an instruction for Claude.
All 73 in Safety