/git:split-branchfrom git
Splits a branch with N commits into N single-commit branches with semantic names. Handles conflicts and existing branches.
Ships in git. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Split the current branch into one branch per commit. Never delete, modify, or force-push the original branch or any existing branch.
Use the code:cli skill.
Use the base branch the user named. Otherwise, in order: the upstream tracking branch, then main or master, whichever exists. If none exists, ask.
git log --oneline --reverse <base-branch>..HEAD
With 0 commits there is nothing to split; with 1, splitting isn't useful. Say so and stop.
For each commit, derive a short kebab-case name (3-5 words) from its subject, using prefixes like add-, fix-, update-, remove-, refactor- where they fit. For example, "Fix null pointer in checkout" becomes fix-checkout-null-pointer.
Show the proposal:
Splitting branch `<current-branch>` into <N> branches:
- <short-sha> <commit-subject> → <semantic-branch-name>
- <short-sha> <commit-subject> → <semantic-branch-name>
...
Ask via AskUserQuestion:
<current-branch>-1, -2, etc.)Work from oldest commit to newest. For each commit, check whether the target branch exists:
git rev-parse --verify <semantic-branch-name> 2>/dev/null
If it exists and its tip equals <commit-sha>, skip it. If it exists with a different tip, append a numeric suffix (e.g., add-user-model-2). Then:
git branch <semantic-branch-name> <base-branch>
git switch <semantic-branch-name>
git cherry-pick <commit-sha>
If a cherry-pick conflicts, tell the user which commit and branch, leave the branch conflicted, and continue with the rest. When done, return to the original branch with git switch <original-branch>.
List the preserved original branch, each new branch with its commit, skipped branches, and branches that need manual conflict resolution:
Successfully split `feature-auth` into 3 branches:
Original branch (preserved):
feature-auth (3 commits)
New single-commit branches:
✓ add-user-model: abc1234 Add user model
✓ add-login-endpoint: def5678 Add login endpoint
⊘ add-session-handling: ghi9012 Add session handling (already exists, skipped)
2 branches created, 1 skipped.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub motlin/claude-code-plugins --plugin git12 skills in this plugin
/clean-worktreesRemove git worktrees safely without force. Use when the user asks to remove, clean up, or delete git worktrees./commitCommit local changes with careful staging and single-line messages. Use for all git commit operations./commit-chunksSplit local changes into multiple logical commits. Use when the user asks to commit changes in chunks or as several commits./conflictsResolve git merge or rebase conflicts and continue the operation. Use when a rebase, merge, or cherry-pick stops on conflicted files.Other plugins' skills for the same job