coralogix

Clean After Merged — Git skill for Claude Code

Git community

Switch to the repo's main branch, pull, and delete the just-merged local branch.

How to install Clean After Merged

Installs to ~/.claude/commands/coralogix-cx-ios-sdk-clean-after-merged.md

Terminal
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/coralogix/cx-ios-sdk/HEAD/.claude/commands/Clean-After-Merged.md -o ~/.claude/commands/coralogix-cx-ios-sdk-clean-after-merged.md

Restart Claude Code, or start a new session, for it to be picked up.

What Clean After Merged does


description: Switch to the repo's main branch, pull, and delete the just-merged local branch.

You're cleaning up after a PR was merged on the remote. The local branch the user is on was the head of that PR and is no longer needed locally.

Do exactly this, in order, in the current working directory:

  1. **Capture the current branch name** with `git rev-parse --abbrev-ref HEAD`. Store it as `MERGED_BRANCH`.

  2. **Refuse to run** if `MERGED_BRANCH` is `master`, `main`, or `develop`. Print

Alternatives in Git

  • Ws Reset — Reset the current branch to main, fetch upstream, and update submodules 38.1k ★
  • Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
  • OSS PR — Commit + PR workflow for open source contributions: auto-creates a user-prefixed branch when on main/master, t 19.7k ★

Full documentation available on GitHub

View Source Repository