Skip to content
claudemods

Claude Code Safety Mods: Guards for Commands and Secrets

Claude Code safety mods block dangerous shell commands, keep secrets out of the conversation and protect files before a tool runs. What they catch and miss.

Top pick: Blast Radius (#2 in Best Claude Code Mods, best in safety)

>_ agent-usage-guard

Agent Usage Guard

Holds subagent fan-out, heavy-context prompts and retry loops before they burn through your Claude Code plan window.

  • status
  • Reads files
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

Blast Radius running in Claude CodeFeatured

Blast Radius

Holds rm -r, force pushes and database migrations in Claude Code and shows what they would change before they run.

  • pane
  • above-prompt
  • Runs commands
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.291

>_ ccpii

ccpii

Masks emails, names and phones with placeholders before Claude reads them, using a local privacy-filter model.

  • status
  • toast
  • transcript
  • Reads files
  • Writes files
  • Runs commands
  • Network
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

Block Dangerous Commands running in Claude CodeFeatured

Block Dangerous Commands

Refuses rm -rf /, force-push to main, DROP TABLE, curl | sh and other destructive Bash commands before they run.

  • toast
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.310

Collision Guard running in Claude CodeFeatured

Collision Guard

Asks before Claude edits a file another open chat changed in the last 30 minutes: proceed, use a worktree, or cancel.

  • transcript
  • Reads files
  • Writes files
  • Runs commands
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

>_ merge-gate

Merge Gate

Holds gh pr merge until CI is green and one Codex review has run. PR status line above the prompt, plus /gate.

  • above-prompt
  • Reads files
  • Runs commands
  • Intercepts tool calls
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

>_ pii-guard

PII Guard

Replaces Taiwanese personal data with placeholders before Claude sees it and restores real values when Claude writes.

  • none
  • Reads files
  • Runs commands
  • Network
  • Intercepts tool calls
  • Reads your prompts

tested with v2.1.291

Project Sentinel running in Claude CodeFeatured

Project Sentinel

A status band, context handoff, prompt cache tracking and permission rules for long Claude Code runs.

  • above-prompt
  • pane
  • spinner
  • status
  • toast
  • Reads files
  • Runs commands
  • Calls the model (uses your quota)
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.296

>_ prompt-bouncer

Prompt Bouncer

Drops vague prompts like “fix the thing” before Claude sees them, and can suggest your project's own term.

  • status
  • toast
  • Reads files
  • Calls the model (uses your quota)
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools

tested with v2.1.307

Recording Mode running in Claude CodeFeatured

Recording Mode

Run /rec before you record: keys, emails, names and money are masked on screen and private files stay closed.

  • above-prompt
  • toast
  • transcript
  • Reads files
  • Writes files
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools

tested with v2.1.310

>_ rulebook-guard

Rulebook Guard

Replaces em dashes in prose and asks before git amend, unformatted pushes and personal info in notes.

  • toast
  • Reads files
  • Runs commands
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.307

>_ scope-guard

Scope Guard

Declare which paths Claude may change with /scope, then list changed files as in scope, outside scope or pre-existing.

  • none
  • Runs commands
  • Intercepts tool calls
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

>_ secret-box

secret-box

Claude Code uses an API key without seeing it: a masked box saves it to .env and tool output comes back redacted.

  • pane
  • above-prompt
  • toast
  • transcript
  • Reads files
  • Writes files
  • Runs commands
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools

tested with v2.1.307

Secret Redactor running in Claude CodeFeatured

Secret Redactor

Swaps API keys, emails and public IPs for placeholders before Claude sees them, and restores them when a tool runs.

  • toast
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI

tested with v2.1.291

>_ time-machine-midudev

Time Machine

Every turn that changes files becomes a git snapshot; /timeline puts the working tree back as it was before any turn.

  • pane
  • toast
  • Reads files
  • Runs commands
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.310

>_ transcript-redactor

Transcript Redactor

Swaps API keys and passwords for stable placeholders before Claude reads them, and restores them for local tools.

  • toast
  • transcript
  • Reads files
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI

tested with v2.1.307

Claude Code safety mods check what Claude is about to do and stop the risky part before it happens. The common jobs are blocking dangerous shell commands such as rm -rf / or a force-push to main, hiding secrets so they never reach the model, and protecting files such as .env or lockfiles from edits.

How do Claude Code safety mods intercept actions?

The main hook is tool.call. It runs just before a tool such as Bash, Edit or Write executes, and a mod can pass the call on with next(e), refuse it with { deny: reason }, or answer it with { result } without running the tool at all. A matcher narrows the hook, for example on('tool.call', { tool: 'Bash' }, ...). tool.check decides allow, ask or deny after tool.call and the classic PreToolUse hooks have run.

Secret-hiding mods tend to use prompt.submit to inspect or change what you send, and session.append to see each line before it is stored. Because a guard sits on the path of every call, it should register a .catch handler so a bug in the guard denies the call instead of crashing it or letting it slip through. The events reference lists what each event can return.

What should you check before installing one?

Every safety mod shows Intercepts tool calls; that is the point. Check what else it shows. A command guard needs little beyond Changes the UI for its toasts. Reads your prompts is expected for a secret filter and unexpected for a command guard. Network on a safety mod deserves a close look at the source.

Read the rule list. A good guard documents every pattern, explains why each one is there, and gives you an allow list for false positives plus a warn mode that only reports.

What safety mods cannot do

A pattern guard is not a sandbox. A command can be built so that no regular expression recognises it, and mods run with your user permissions. Treat safety mods as protection against the everyday accident, keep permission prompts on for anything you would not run yourself, and use claude --safe-mode when you need a session with every mod off.

FAQ

Do Claude Code safety mods replace permission prompts?
No. They are an extra layer that catches common accidents by pattern. Keep Claude Code's own permission prompts and deny rules on; an obfuscated command can still get past a pattern match.
What happens when a safety mod blocks a command?
The tool.call hook returns { deny: reason }. The command does not run, and Claude receives the reason as the tool result, so it can try a safer approach or ask you.
Can a broken safety mod let commands through?
That depends on its .catch handler. A guard should fail closed, so if its own check throws, it denies the call rather than letting it run. Look for that in the How it works section.