The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Brand Voice listing page.
Brand writing enforcement for Claude Code — automatic, configurable, zero-friction.
Every time Claude writes or edits a Markdown file, brand-voice checks it against your brand guidelines and signals Claude to fix violations before the file saves. No manual review. No rule reminders in every prompt.
Claude reads the violation list, corrects the file, and retries the write — automatically.
Your brand guidelines live in a doc somewhere. Claude doesn't read them unless you paste them into every prompt. Even then, the rules drift over time.
brand-voice makes the rules structural:
.brand-voice-ignore for whole files, <!-- brand-voice-disable-line --> for individual linesOr run without installing:
Requires Node.js 18+.
Run the setup skill inside any Claude Code session:
The skill does everything:
brand-guidelines.md to your projectCLAUDE.md.claude/settings.json.mcp.jsonAfter setup, every .md and .mdx file Claude touches is checked automatically.
Three components work together:
| Component | What it does |
|---|---|
PostToolUse hook (brand-voice-check) | Runs after every Write/Edit/MultiEdit on .md/.mdx; exits 2 with violations so Claude auto-corrects, exits 0 when clean |
MCP server (brand-voice-mcp) | Exposes analyze_readability and apply_suggestions for on-demand analysis and word-level fixes |
CLI (brand-voice) | Standalone checker for CI pipelines, ratchet baselines, and GitHub PR annotations |
| Rule | Severity | Description |
|---|---|---|
| Forbidden terms | error | Whole-word, case-insensitive match — blocks the write |
| Avoid terms | warning | Same matching — signals a preferred alternative |
| Sentence length | warning | Configurable max words per sentence (default: 25) |
| Passive voice | warning | Auxiliary + past-participle pattern detection |
| Readability grade | warning | Flesch-Kincaid grade per sentence vs. your target |
Code blocks, inline code, indented blocks, and table rows are never checked — only prose.
Never checked: physical line length or line breaks. The CLAUDE.md injection always includes a formatting rule telling Claude to write continuous paragraphs and let the renderer word-wrap, but the analyzer itself has no line-width rule and never will — sentence length is measured in words, not characters or lines, so hard-wrapped and unwrapped prose score identically.
| Code | Meaning |
|---|---|
0 | No violations — file accepted |
2 | Violations found — Claude reads output, corrects, and retries |
Exit 1 is never used (it aborts the session rather than triggering a retry).
One Markdown file holds your entire brand configuration. Keep it under 600 words so it fits cleanly in context.
See example/brand-guidelines.md for a complete working example.
## On-Brand Examples and ## Off-Brand Examples are accepted as aliases for ## On-Tone Examples / ## Off-Tone Examples. All other section names are case-insensitive exact matches.
The hook and CLI search for brand-guidelines.md in this order:
~/.claude/brand-guidelines.md (user scope — enforces rules across all your projects).brand-voice-ignoreCreate a .brand-voice-ignore file in your project root. Uses gitignore-style patterns:
Add this comment anywhere on a line to suppress all violations on that line. Useful for one-off exceptions where the violation is intentional.
analyze_readabilityCheck a file or inline text for violations and readability scores.
Inputs:
| Field | Type | Required | Description |
|---|---|---|---|
file | string | one of file/text | Absolute or relative path to a .md/.mdx file |
text | string | one of file/text | Inline Markdown to analyze |
cwd | string | no | Working directory for locating brand-guidelines.md |
Returns: { filePath, passed, violations[], readabilityScores, visualIdentity }
apply_suggestionsApply safe word-level substitutions for forbidden/avoid terms. Does not fix sentence length, passive voice, or grade — those need human judgment.
Inputs:
| Field | Type | Required | Description |
|---|---|---|---|
file | string | yes | Path to the file to fix |
dryRun | boolean | no | Preview diff without writing (default: false) |
Returns: diff + change list (dry run) or confirmation + change list (live)
Tip: Run dryRun: true first to preview, then apply.
brand-voice works independently of Claude Code — add it to any pipeline.
Check all .md files:
Check only files changed in the current branch:
GitHub Actions inline annotations (PR diff comments):
Ratchet enforcement — block regressions without requiring a clean slate:
Example GitHub Actions workflow:
Exit 0 = clean or within baseline. Exit 1 = errors found or baseline exceeded.
See src/types.ts for full type definitions.
| Scenario | What to do |
|---|---|
| Solo developer | Run /brand-voice-setup once per project; commit brand-guidelines.md |
| Team | Commit brand-guidelines.md, .claude/settings.json, and .mcp.json; teammates get enforcement on git pull |
| Global (all projects) | Run /brand-voice-setup with the global flag; writes to ~/.claude/brand-guidelines.md |
| claude.ai (browser) | Setup skill outputs a paste block for Claude Project instructions — no hook or MCP needed |
| Enterprise / CI | Use brand-voice check in pipelines; commit .brand-voice-baseline.json for ratchet enforcement |
brand-guidelines.md — created by /brand-voice-setup or written manuallyvale-syncBug reports, feature requests, and pull requests are welcome. See CONTRIBUTING.md for setup instructions, key invariants to preserve, and code style guidance.
MIT — see LICENSE.