ClaudeCodeMod

All shelves / Mods / Safety

rulebook-guard

By hamzafer

rulebook-guard is a Claude Code safety mod by hamzafer.

Asks before git commit --amend, an unformatted push, or personal details in notes and commits.

Holds a command

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install rulebook-guard@claude-code-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.1.3
License
MIT
Repo stars
381
Last change
2026-10-23

What it can reach

  • Holds a command
  • Sees tool calls
  • Calls another program on this machine

Claude Code 2.1.287 or later. The author says to restart after installing. It rewrites em dashes in .md, .mdx, .markdown, and .txt writes, commit messages, pull request text, and Slack posts, and leaves code files alone. It asks before git commit --amend, before a git push with files that ruff format or Prettier would change, and before an email address or phone number goes into ~/notes, memory files, CLAUDE.md files, or a commit. Saying no refuses the call, and Claude gets the reason; in auto mode the session waits for your answer. It never runs a Prettier the repo ships in git, or anything else it tracks under node_modules. The author calls it a guardrail, not a security boundary: the repo's own Prettier config still runs, as it would for npm test.

The marketplace, claude-code-mods, holds all of hamzafer's mods, merge-gate and glance among them. This one installs on its own, or from the checklist that npx claude-code-mods@latest opens. The author lists this with the mods built around their own tools and rules, to fork and change to yours. The rules are plain code in hooks/register.ts. Stopping what those rules forbid before it lands is why this page files it under safety. dash-guard-mutlumehmet refuses a write that adds an em dash, an en dash, or a double hyphen in prose, and names the lines to rewrite. dogma, by Marcel-Bich, runs, asks about, or blocks git commands and deletes by your DOGMA-PERMISSIONS.md. This one rewrites the dashes itself and asks before the rest. In the source, a toast says how many em dashes it replaced, and where.

Demo

A hook asks before a writing or git rule is broken
From the author's repo.

What it hooks into

  • tool.callAround a tool call, where it can hold oneWriteEditBash

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

Files

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

Facts

Author
hamzafer
Category
Safety
Marketplace
claude-code-mods
Repo
hamzafer/claude-code-mods
Folder
mods/rulebook-guard
Version
0.1.3
License
MIT
Repo stars
381
Last change
2026-10-23
Language
TypeScript
Files
5

Other mods in Safety

bash-guardSingh-APHolds a commandHolds every Bash call, even in bypass mode. Blocks rm -rf on a home or system directory, and asks before a force-push, a hard reset, or a pipe into sh.net-guardSingh-APHolds a commandHolds curl, wget, ssh, scp, git push, and WebFetch, even in bypass mode. Blocks paste sites and request catchers, and asks before data goes anywhere new.file-guardSingh-APHolds a commandHolds writes outside the project and writes into .git, and asks before lockfiles and CI files.slopsquat-guardSingh-APHolds a commandHolds a package install and checks the name against its registry, so a hallucinated or typosquatted package does not install.command-explainerSingh-APDraws a plain-English line and a risk level on the permission prompt, so you can see what the command does before you approve it.secret-guardarasovicHolds a commandHides API keys and private keys before the model or the transcript sees them, blocks credential files and commands that print secrets, and shows what it caught.guardrailsarasovicHolds a commandHolds Cloudflare write commands, attribution lines in commits and pull requests, and branch names that start with claude/.guardrails-liteedtrackaiHolds a commandHolds a read of a secret .env file, a git force-push, and a recursive rm on /, ~, or $HOME. .env.example, .env.sample, and .env.template are allowed.injection-guardSingh-APStrips hidden characters from tool output and marks results that carry instructions aimed at Claude, so they reach it as untrusted data.collision-guardnateherkaiHolds a commandHolds an edit to a file another open chat changed in the last 30 minutes, and asks you to proceed, move this chat to a worktree, or cancel.recording-modenateherkaiHolds a commandMasks keys, personal details, and business figures on screen while you record, hides results from mail, chat, and finance tools, and keeps private files closed.secret-boxray-amjadHolds a commandOpens a masked box when Claude needs a key, writes the key to .env, and gives Claude a placeholder; any key a tool prints comes back as a placeholder too.
All 73 in Safety