Skip to content

CLAUDE.md: post-merge feature-branch cleanup rule#10

Merged
avanelsas merged 1 commit intomainfrom
feature/post-merge-cleanup-rule
Apr 29, 2026
Merged

CLAUDE.md: post-merge feature-branch cleanup rule#10
avanelsas merged 1 commit intomainfrom
feature/post-merge-cleanup-rule

Conversation

@avanelsas
Copy link
Copy Markdown
Owner

Summary

Adds a short rule to CLAUDE.md documenting how to clean up
after a PR is squash-merged — and crucially, the order:

  1. Verify the squash commit is on `origin/main`.
  2. Delete the feature branch locally (`git branch -D` —
    `-d` refuses because the squash creates a new commit
    that doesn't share history with the feature branch).
  3. Delete the feature branch on the remote.

The "main has been pulled / squash verified" precondition is
deliberate — pre-emptive branch deletion risks losing
in-flight work if the merge was never completed or got
reverted.

Slots in immediately after the existing PR readiness gate
section so the lifecycle reads top-to-bottom: gates → ask
before opening → cleanup after merge.

Test plan

  • `clj-kondo --lint src test scripts` — 0 errors / 0 warnings.
  • `cljfmt check src test scripts` — all files formatted.
  • `npx shadow-cljs compile test` — 486 tests / 1436
    assertions / 0 failures / 0 errors.
  • `npx shadow-cljs release app` — 0 build warnings.
  • Doc-only change; no runtime behaviour to verify.

🤖 Generated with Claude Code

Document the order: verify the squash commit is on
origin/main first, then -D the local branch (squash-merges
don't share commit history with the feature branch, so -d
refuses), then delete the remote branch.

The "main has been pulled / squash verified" precondition is
deliberate — pre-emptive branch deletion risks losing
in-flight work if the merge was never completed or got
reverted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avanelsas avanelsas merged commit 095935f into main Apr 29, 2026
1 check passed
@avanelsas avanelsas deleted the feature/post-merge-cleanup-rule branch April 29, 2026 10:31
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