Skip to content
SprecherEast
Issue 453

process: Close the gaps the Bash hook still lets through

Back to our plan
Open
processtoolingpriority: low

Summary

The Bash guard from #449 lets a few forms of the forbidden commands through. Each fails open (the command runs; AGENTS.md and the ruleset still apply), but the first two are common enough to close.

Details

From the re-review of #449:

  • gh -R o/r pr merge 1 --admin (or --repo) isn't refused: skip gh's global flags before pr merge, as gitArgs does for git -C. Agents pass -R often, so fix this first.
  • git push origin HEAD (or -u origin HEAD) while on main isn't caught: treat HEAD as the current branch, like a bare push.
  • Commands wrapped in bash -c "…", ( … ) or VAR=1 git … aren't parsed.
  • git -C ../wt commit and cd x && git push are judged in the hook's cwd, not where they move to.

Acceptance criteria

  • Not done: The first two cases are refused, with tests in .claude/hooks/rules.test.mjs.
  • Not done: The others are handled, or listed in rules.mjs as known gaps.

Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab