Issue 453
process: Close the gaps the Bash hook still lets through
Back to our planOpen
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: skipgh's global flags beforepr merge, asgitArgsdoes forgit -C. Agents pass-Roften, so fix this first.git push origin HEAD(or-u origin HEAD) while onmainisn't caught: treatHEADas the current branch, like a bare push.- Commands wrapped in
bash -c "…",( … )orVAR=1 git …aren't parsed. git -C ../wt commitandcd x && git pushare judged in the hook'scwd, 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.mjsas known gaps.
Generated by Claude Code, opens in a new tab