prm: stop attempting remote branch deletion where the proxy blocks it - #277
Merged
Conversation
Close-out step 5 assumed every environment could delete a remote ref, so a proxied web session (Claude Code on the web) burned turns on pushes that can never land: the egress proxy returns HTTP 403 on the git-receive-pack POST carrying a ref deletion, and the GitHub MCP surface exposes no delete verb. Add a one-shot environment probe before the close-out, skip the remote half of step 5 outright when it answers, and defer those branches to /repo_cleanup (its Bucket B enumerates origin branches, so a local sweep picks them up). Also correct the remote-environment note, which claimed step 5 ran "as usual" over gh, and record deferred branches in the ledger alongside deleted ones. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHmxnBNwDGedeUoRJk9iFz
The previous commit stopped the wasted push attempts but still reported the branches as deferred to /repo_cleanup. Behind the proxy that line would appear on every close-out saying the same thing, which is noise rather than a finding. Treat step 5 as out of scope in that environment: attempt nothing, report nothing, and omit branches from the ledger entirely. Nothing is lost, because /repo_cleanup Bucket B enumerates origin branches directly and rediscovers them on the next local sweep without being told. The ledger's "a skipped step must read as skipped" rule gains one stated exception for a step the environment makes impossible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHmxnBNwDGedeUoRJk9iFz
github-actions
Bot
deleted the
claude/branch-deletion-permissions-zcwkdc
branch
August 25, 2026 14:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/prm's close-out step 5 assumed every environment could delete a remote ref. Ina proxied web session (Claude Code on the web) it cannot: the egress proxy returns
HTTP 403on thegit-receive-packPOST that carries a ref deletion, and theGitHub MCP surface exposes no delete verb at all (
create_branchexists; nothingdeletes a ref).
The result was every web close-out burning turns on pushes that can never land,
then reporting the failure as if it were a finding.
Confirmed in-session: an ordinary push (branch create) through the same proxy
succeeds, so it is ref deletions specifically that are refused — not git writes
in general. The 403 carries no
X-Github-Request-Idwhile the ref advertisementto the same host seconds earlier returns 200 with one, so it is generated in
front of GitHub — credentials,
ghscopes and branch protection are not thecause.
Changes
skills/prm/prm.md(mobile/codex), with a one-shot probe (
curl -sf "$HTTPS_PROXY/__agentproxy/status")run once before the close-out and remembered for the whole run.
nothing reported, branches absent from the ledger.
over
gh— the line that licensed the wasted attempts.skills/prm/reference.mdrecognises it immediately, and states why it is not credentials/scopes/branch
protection — heading off the "try a different token" reflex.
"deferred", not "blocked", not "see /repo_cleanup". The step would say the same
thing on every close-out, so it is noise rather than a finding.
do not repeat the push per repo, do not narrate the failure.
Why silence loses nothing
/repo_cleanupBucket B enumerates origin branches directly(
gh api repos/<owner>/<repo>/branches), so it rediscovers these branches on thenext local sweep without being handed a list. Checked before pointing at it — the
handoff does not depend on
prmreporting anything.The ledger's "a skipped step must read as skipped" rule keeps its force and gains
one stated exception: a sub-step the environment makes impossible is omitted
outright. Skipping something that could have been done still gets a line.
Repo-side, enabling "Automatically delete head branches" (Settings → General →
Pull Requests) removes the need for the sub-step altogether.
Docs-only; no executable code paths touched.
Generated by Claude Code