Docs / Get started / The guard
The guard
An opt-in plugin that checks your workspace's rules on your machine before a command or edit runs. It can refuse or ask. It can never allow.
Install
Claude Code: install the guard
claude plugin install commonrig-guard@commonrigIn Claude Code: sign the guard in
/commonrig-guard:connectIts sign-in holds the rules scope and nothing else. For Codex, the guard reads its commands and edits and watches until you tell it to enforce, as Codex cannot ask.
What it checks
- Commands, commits and paths, by checks your owner accepted for the whole workspace.
- Two common slips that need no words: a command that kills its own shell, and a
git pushafter a test piped into a filter, which pushes even when the test failed. - It keeps a saved copy of the rules and refreshes it in the background, so nothing waits on the network.
- A rule in log writes down what it would have done. One that is on refuses, or asks you through your agent's own prompt.
- It sends the rule number, a fixed outcome and the rule's own word. Never a command, path or prompt.
- An
offfile in its data folder always wins.
For agents rules_pull rule_report: rules_pull fetches the rules the guard checks on this machine; rule_report says what it did, as rule ids and fixed outcomes. No ordinary agent calls either. Applies only as the guard, signed in on its own page.
Checked against the code at e28af69c. Site built from f04f4af1.