Quality gates for Claude Code.
Format every edit. Gate every turn.
/plugin marketplace add rossedman/guardrails
/plugin install guardrails@guardrails
The loop
Guardrails is one Go binary wired into Claude Code's hooks. A fast inner loop on every edit, and a hard gate before Claude can call the work done.
Claude learns the standards for the languages this repo uses before it writes a line.
standardsSuppressions, skipped tests, lowered thresholds and risky commands are stopped before they run.
deny · askEvery edited file is formatted in place, then linted and type-checked.
< 2sTouched code must build, pass tests, hold coverage and pass every linter before the turn ends.
block · passWhat Claude sees
Failures name the file, the function and the fix. Claude keeps working until the gate passes, and after three blocks in a row hands the turn back to you with a summary.
guardrails: go gate failed (2 of 6 checks) [coverage] 84.2% < 90.0% internal/sched/queue.go:41 (*Queue).Drain 0/14 internal/api/handler.go:88 decodeRequest 3/11 fix: add table-driven tests [lint] 1 issue internal/api/handler.go:102:5 errcheck fix: suppression comments are not allowed attempt 1 of 3 · guardrails gate --explain
What you get
Coverage on what Claude touched, at your preset's bar: strict, standard or adopt. Never lower than where the session started.
New //nolint, # noqa, t.Skip, lowered thresholds and config edits are denied before they happen.
terraform apply and force pushes are denied. Packages that don't exist, are malicious or are days old are stopped before they install.
guardrails harden mutation-tests and fuzzes the Go code you changed, so coverage can't hide empty tests.
ruff, mypy, shellcheck, tflint, trivy, golangci-lint and more: pinned, checksum-verified, downloaded on first use.
Your corrections and the checks Claude trips most become drafts for .claude/rules/, via /guardrails:learn.
Quick start
The plugin downloads its own binary and every linter and scanner it runs, pinned and checksum-verified, the first time they're needed. Nothing else to install. macOS and Linux, amd64 and arm64.
Full getting-started guide› /plugin marketplace add rossedman/guardrails
› /plugin install guardrails@guardrails
Your next session opens with one line: the languages it found and the bar Claude is held to. No config needed.
Claude measures the code and recommends a preset: strict for new code, standard, or adopt for existing repos (coverage never drops; new code is tested).
› /guardrails:setup
Edits are fixed, risky moves stopped, and every turn gated. When you want more:
› /guardrails:status # what's on, what's next
› /guardrails:gate # check before you commit
› /guardrails:harden # do the tests test?
› /guardrails:learn # mistakes into rules
Languages
Each language module fixes on edit, checks in about two seconds, and adds its own checks to the Stop gate. Modules switch on when the repo uses the language.
Commands
Everything the hooks and skills do, you can run yourself, in CI or a pre-commit hook. Every command has --help with examples.
--all.guardrails.yaml and Claude rulesDocumentation
Free and open source under the MIT license.