Skip to content

chore(claude): release guard lets branch pushes through and asks in every mode - #95

Merged
PAMulligan merged 1 commit into
mainfrom
chore/release-guard-branch-pushes
Oct 27, 2026
Merged

PAMulligan merged 1 commit into
mainfrom
chore/release-guard-branch-pushes

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Why

The release guard turned ask into deny in bypassPermissions sessions, so every push from the sessions Paul actually runs was refused (2026-10-26). His other repos never special-cased the mode.

What changes

  • A plain branch push (git push -u origin <branch>, --force-with-lease included) passes silently: it is the first half of a pull request, not a deploy.
  • A push that names main, a tag, HEAD or no branch at all, or uses --force, --delete, --mirror, --all, --tags or a +refspec, still asks, and the reason says what it saw.
  • No permission-mode special case. In bypassPermissions Claude Code auto-approves a hook's ask (verified from this session with a dry-run push naming main), so there the guard is a reminder; inside a subagent it still denies, and --deny still forces a denial.
  • gh pr merge, gh release writes, gh workflow run and gh run rerun are unchanged: ask, deny in subagents.
  • CLAUDE.md, .claude/rules/release.md, the session-context line, the release-manager agent's rules and the hook tests say the same thing.

Verification

node --test scripts/__tests__/*.test.js                 77 passed, 0 failed
node scripts/claude-code-conformance.js --root . --strict   0 errors, 0 warnings
bash -n on every hook                                     ok

Worth knowing

In a bypass session nothing mechanical now stands between a gh pr merge or a push to main and the repo, except CLAUDE.md's rule that those happen only when you ask. If you want a hard stop there, say so: the hook can deny merges and releases in bypass mode while leaving pushes alone.

🤖 Generated with Claude Code

…very mode

A plain branch push (git push -u origin <branch>) is the first half of a pull request, not
a deploy, and now passes silently; a push that names main, a tag, HEAD or no branch, or
uses --force, --delete, --tags, --mirror or --all, still asks. The bypassPermissions and
dontAsk downgrade to deny is gone: Claude Code auto-approves a hook's ask there (verified
with a dry-run push), as in Paul's other repos, so the guard is a reminder in bypass
sessions and the subagent denial stays the hard stop. Docs, session hook and tests updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@PAMulligan
PAMulligan merged commit e7eeed2 into main Oct 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant