Chock.sh Build your plugin
Blocksv0.5.4 preset: Git hygiene

Block Skipping Git Hooks

Refuses a matched shell command before it runs.

Acts on

Shell command

When

Before the command runs

Tested

116 of 116 pass

In a git repo

In agent

What it does

Friction, not a security boundary: refuses agent commands that skip git hooks. --no-verify on commit/push/merge/am/rebase/pull/cherry-pick/revert, -n on commit/am; core.hooksPath set by -c, git config or GIT_CONFIG_*; HUSKY=0, SKIP=, LEFTHOOK=0 and kin; hook manager uninstall; aliases and rebase --exec defined in the command. Asks on plumbing, unset hooksPath, another GIT_DIR and config files. Refuses person-only CHOCK_*/marker changes. Mandatory. Misses: older aliases, scripts, $VARs.

Chock adds friction. It is not a security boundary.

Its label on each agent

The catalog grades each policy on each agent. Pick an agent to build with this policy:

  • Claude Code TestedBlocks Refuses a matched shell command before it runsBuild →
  • Cursor TestedBlocks Refuses a matched shell command before it runs. Where its description says it asks, it asksBuild →
  • Codex TestedBlocks Refuses a matched shell command before it runs. Where its description says it asks, it refuses, because this client cannot prompt before a shell command. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)Build →
  • GitHub Copilot TestedBlocks Refuses a matched shell command before it runs. Where its description says it asks, it asks in VS Code and refuses in Copilot CLI, because it cannot prompt there. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)Build →
  • Devin TestedBlocks Refuses a matched shell command before it runs. Where its description says it asks, it refuses, because this client cannot prompt before a shell command. If the hook errors, the action goes through (vendor docs only, not witnessed)Build →
  • Grok Tested Not graded yet for GrokBuild →
  • goose Tested Not graded yet for gooseBuild →
  • Antigravity Tested Not graded yet for AntigravityBuild →
  • OpenHands Untested Not graded yet for OpenHandsBuild →
  • Kimi Code Untested Not graded yet for Kimi CodeBuild →
  • Factory Droid Untested Not graded yet for Factory DroidBuild →

See it in action

Refused

A request asks the agent to run git commit --no-verify.

git commit --no-verify -m wip

Allowed

A request asks the agent to run git commit after all checks pass.

git commit -m done

Both examples are this policy's own test cases.

What it misses

Older aliases, scripts, $VARs.

Latest change

0.5.4 · · Fix for Windows (IR-F45; tests in test_block_no_verify_launcher.py). A direct write to the repository config with --file .git/config was allowed there because the path check compared a backslash-separated path with .git/config; it now compares with / separators, so the write is refused on Windows as elsewhere. The comparison also ignores case, since Windows and default macOS file systems fold it: .GIT/CONFIG is the same file.