Refuses git push --force before it runs

A minimal Claude Code mod. It registers one tool.call hook, limited to Bash, that refuses any git push with --force or -f before the command runs.
Validated 2026-10-02 on Claude Code 2.1.287 (mods shipped in that release):
$ claude plugin validate ./force-push-guard
❯ ./register.js hooks: tool.call{tool=Bash}
❯ ./register.js calls: nothing on $
✔ Validation passed
Try it for one session without installing:
claude --plugin-dir ./force-push-guard
hooks/register.js 11 lines1export function register(on) {
2 // The matcher limits this hook to Bash, so e.command is the shell command
3 on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
4 if (/git push .*(--force|-f)\b/.test(e.command)) {
5 // Returning without next() answers the event; the command never runs
6 return { deny: 'No force pushes here. Push to a new branch instead.' }
7 }
8 return next(e)
9 })
10}
11