/git:branchingfrom git
Use when creating a new git branch or starting work on a feature or fix, when naming a branch, or when bringing an existing branch up to date with main.
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.
A branch takes its name from the feature or change it adds:
csv-export, fix-empty-input-crashproj-218-csv-exportIn cloud sessions, a hook enforces this. It blocks git switch -c, git checkout -b, git branch <name>, gh stack init, gh stack add, and git push when the branch they create or push breaks the convention, including the claude/... branch the session assigns. Rename an unpushed branch with git branch -m <new-name> before the first push.
Don't commit to, rewrite, push, or edit files on main, master, or the repository's default branch. Create a feature branch before the first change, even a small one, and open a pull request from it.
In every session, a hook enforces this. It blocks git commit, merge (except --ff-only), rebase, cherry-pick, revert, am, and git push when they would write to a protected branch, and blocks file edits in a repository while one is checked out. Pulling, switching branches, and editing gitignored files stay allowed, as does the first commit of a new repository. If commits already landed on local main, create the feature branch from them and ask the user before resetting main. Only the user can lift the block, by starting Claude Code with GIT_ALLOW_MAIN=1.
Always branch from an up-to-date main:
git status # make sure the working tree is clean
git switch main
git pull --ff-only origin main # update main from the remote
git switch -c <branch-name>
git pull --ff-only fails, local main has diverged from the remote. Report this to the user rather than merging or resetting.main (check git symbolic-ref refs/remotes/origin/HEAD), use that branch instead and mention it.Branches should be short-lived. To pick up new changes from main, rebase:
git fetch origin
git rebase origin/main
origin/main instead.git push --force-with-lease, never plain --force.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hiroshisuda/agent-skills --plugin git3 skills in this plugin
/commit-messagesUse when writing or reviewing a git commit message, when committing or amending changes, or when titling or merging a pull request (including PRs in a stack). Applies the user's Conventional Commits style with concise messages and references to tickets or design docs./history-cleanupUse when the user wants to tidy git history before merging - squashing, fixing up, rewording, reordering or dropping commits - or to undo a mistake and recover lost commits with the reflog.Other plugins' skills for the same job