--quiet, the hook is completely silent on a passing commit and only interrupts when there’s something to fix.
Exit code behavior
| Exit code | Meaning | Hook result |
|---|---|---|
0 | Score meets or exceeds threshold | Commit proceeds silently |
1 | Score below threshold | Commit blocked, summary printed |
--quiet mode is essential for hooks. On pass: completely silent. On fail: one summary line with the failing findings. Without --quiet, every commit prints the full scan output — which gets noisy fast.Setup
- hk (recommended)
- husky
- Plain shell
hk is a Git hook manager configured in Then install:Run
hk.pkl and committed to the repo, so every contributor gets the same hooks automatically.Add a Charter hook to hk.pkl:hk install again after any changes to hk.pkl to update the installed hooks.Threshold guidance
Set an explicit threshold to match your CI gate:charter.yaml says, so hook and CI always agree automatically:
charter.yaml has no policy section, Charter uses the built-in default of 80.