---
title: "rulebook-guard"
url: "https://claudemods.dev/en/builds/rulebook-guard-1dc603"
source: "https://github.com/hamzafer/claude-code-mods/tree/main/mods/rulebook-guard"
source_type: "github"
repo: "https://github.com/hamzafer/claude-code-mods/tree/main/mods/rulebook-guard"
author: "hamzafer"
author_handle: "hamzafer"
stars: 498
category: "Workflows & CI"
categories: ["workflow"]
tags: ["claude-code", "git", "guardrails", "hooks", "linting", "plugin"]
permission_level: 2
scan_complete: true
install: "claude plugin marketplace add hamzafer/claude-code-mods\nclaude plugin install rulebook-guard"
added: "2026-10-05T01:41:30.049Z"
updated: "2026-11-17T13:58:49Z"
locale: "en"
content_locale: "en"
---

# rulebook-guard

A Claude Code mod that enforces writing and git rules: rewrites em dashes, and asks before git commit --amend, unformatted pushes, or personal info in notes and commits.

## Description

rulebook-guard is part of the hamzafer/claude-code-mods marketplace and ships a verified .claude-plugin/plugin.json with hooks that intercept the Write, Edit and Bash tool calls. It replaces em dashes in prose, and prompts before git commit --amend, an unformatted push (checked via ruff and prettier on changed files), or personal info like emails and phone numbers appearing in notes and commits. It reads HOME and shells out to git, ruff and prettier to inspect diffs against upstream or origin/main. Install with `claude plugin marketplace add hamzafer/claude-code-mods` then `claude plugin install rulebook-guard@claude-code-mods`, or try it directly with `claude --plugin-dir mods/rulebook-guard`. Built around the author's personal rules, so fork and adapt as needed.

## Install

```
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install rulebook-guard
```

## Original README

# 🛰️ Claude Code mods

[![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![CI](https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml)

**See what your agent is reading and writing, live.**

Mods are Claude Code plugins that add live UI and hooks to a session (Claude Code 2.1.287+). [What are mods?](https://claude.dev/blog/getting-started-with-claude-code-mods/)

mission-control draws every subagent, every tool call and every file they touch, in a pane next to the chat.

![mission-control at 4x: two subagents and a logout feature landing across four files](images/mission-control.gif)

## 🚀 Try mission-control

```sh
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install mission-control@claude-code-mods
```

Restart Claude Code and type `/mission` (or `/mission code` to open the code map). `q` closes it.

- 🤖 `w` shows the agents and every tool call, live
- 🗺️ `c` shows the code map, with import arrows
- 🔵 **Blue** while the agent reads a file
- 🟠 **Orange** while it writes
- 🟢 **Green** when done, with one line on what changed

> **Needs** Claude Code 2.1.287+. The Code view also needs macOS, Google Chrome and a terminal that shows images (Ghostty, kitty, iTerm2). The Who view works everywhere.

## 🧩 The mods

### 👀 See what's happening

| | Mod | What it does | Command |
| --- | --- | --- | --- |
| 🛰️ | **mission-control** | Live map of agents, tool calls and the code they touch | `/mission` |
| 🌦️ | **token-weather** | Context fill from Clear to Compact soon, plus a prompt-cache countdown | |
| 📍 | **where-am-i** | Goal, doing now, waiting on you, next step | `/where` |
| ➡️ | **next-steps** | 2 or 3 likely next prompts after each turn, one key to draft one | `1` `2` `3`, `0` hides |
| 💰 | **usage-meter** | 5-hour and 7-day plan usage, the reset countdown and the session's cost | |
| 📡 | **agent-radar** | One live line per running subagent | `/radar` |
| 🔍 | **review-watch** | One live line per running code review (Codex or a review subagent) with the model, target, elapsed time and Codex's latest output. A toast lists the findings when it ends | |
| 🌐 | **browser-lanes** | Whether this session has a browser, and who holds it | `/browser` |
| 🎬 | **replay-theater** | Steps through the last turn's edits, one diff at a time | `/replay` |
| 📝 | **md-preview** | Renders the Markdown files Claude edits like GitHub does, with before and after side by side. Needs Chrome and a terminal that shows images | `/md` |

### 🛡️ Guard your repo

| | Mod | What it does | Command |
| --- | --- | --- | --- |
| 💥 | **blast-radius** | Holds `rm -r`, force pushes and migrations, shows what they'd delete, cancels after 60 s with no answer | |

### 🔧 My setup (fork and adapt)

These are built around my own tools and rules. Fork them and change the rules to yours.

| | Mod | What it does | Command |
| --- | --- | --- | --- |
| 👀 | **glance** | One line with what needs you: next meeting, PRs, Linear issues, Slack DMs. Needs `gh` and the Google Calendar, Linear and Slack connectors | `/glance` |
| 🚦 | **merge-gate** | Holds `gh pr merge` until CI is green and Codex reviewed once. Needs `gh` and the Codex CLI. Reviews run on one fixed model; change it to yours | `/gate` |
| 📏 | **rulebook-guard** | Enforces my writing and git rules: rewrites em dashes, asks before `--amend`, unformatted pushes, emails and phone numbers in notes | |
| 💾 | **session-saver** | Saves where you left off, shows it on resume. Needs [unpause](https://github.com/hamzafer/unpause) | `/park [note]` |

### 🎮 For fun (opt-in)

| | Mod | What it does | Command |
| --- | --- | --- | --- |
| 📱 | **reels** | YouTube Shorts while Claude works, pauses when it's done | `/reels` |
| 🐍 | **snake** | Snake while Claude works | `/snake` |

## 📦 Install any mod

Same two commands, with the mod's name in place of `mission-control`. Or try one without installing:

```sh
git clone https://github.com/hamzafer/claude-code-mods && cd claude-code-mods
claude --plugin-dir mods/token-weather
```

## 📚 More

- 📖 [**docs/mods.md**](docs/mods.md): how they behave, setup notes and build your own
- 🎥 [**docs/demo.md**](docs/demo.md): videos and screenshots
- ⭐ Earlier project: [**cursor-commands**](https://github.com/hamzafer/cursor-commands) [![stars](https://img.shields.io/github/stars/hamzafer/cursor-commands?style=social)](https://github.com/hamzafer/cursor-commands), 600+ stars for Cursor slash commands
- 🤝 [**CONTRIBUTING.md**](CONTRIBUTING.md): add your own mod
