/essentials:branch-rescuefrom essentials
Diagnose, explain and fix stuck git situations: diverged local/remote, merge/rebase conflicts, PRs with conflicts, wrong-branch commits, detached HEAD, lost commits, rejected pushes, dirty tree blocking pull. Gives the cause, explained fix commands within the repo's own rules, prevention, and an HTML local-vs-remote diagram; takes over execution on request. Use on "diverged", "conflict", "out of sync", "rejected", "behind/ahead", "wrong branch", "lost my commit", or any git-mess question, even unnamed.
Ships in essentials. 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.
Read when SKILL.md points to them; scripts run unread.
git-commit), pruning merged branches (git-cleanup).Situation recipes: references/playbooks.md; read only the matching section.
python3 <skill-dir>/scripts/branch_rescue.py --fetch (<skill-dir> = this skill's base directory; stdlib only; --repo <path> for another repo or worktree). --fetch refreshes remote refs; a failed fetch warns and continues stale.state: diverged | behind | ahead | in-sync | conflicted | in-progress | detached | no-upstreamahead/behind, base (shared ancestor), local_only/remote_only (commit lanes)both_touched (files edited on both sides), predicted_merge (clean, conflicts; null = not computed, e.g. git < 2.38: treat both_touched as the hint)operation, status.conflicted, config, worktrees, upstream_gone--against origin/<default>; default compares with the branch's upstream.git reflog -20 and git log --graph --oneline --decorate --all -20: commits on the wrong branch, merges/resets/rebases, force-updated remotes.status, log, reflog, diff, show, merge-base, config --get, branch -r --contains, worktree list. No script: git status -sb plus the log above.Read before planning; the fix follows these, not git folklore.
CLAUDE.md/AGENTS.md, ~/.claude/CLAUDE.md, ~/.claude/rules/*.md, memory, then snapshot.config, hooks, Makefile/CI. Project overrides global; state the clash in one line.file:line under "Policy applied".Build the plan once (steps + policy + prevention); the chat brief and the diagram both render it.
Brief, bullets in this order:
git status -sb, tests/lint if policy requires).references/playbooks.md).Define git terms (reflog, fast-forward, merge base) in half a sentence on first use.
Visual, unless declined:
$CLAUDE_JOB_DIR/tmp): {"title", "policy": [..], "steps": [{"cmd", "does", "status": "pending|done|failed"}], "prevent": [..]}python3 <skill-dir>/scripts/branch_rescue.py --html --plan <plan.json> --open (plus --repo/--against as in Diagnose). Writes <git-dir>/branch-rescue/situation.html, or the OS temp dir if that is not writable; prints the path. Headless: drop --open.Triggers: "take over", "do it", "you run it", or equivalent, at any point.
done. Unexpected state: revise the plan, state the delta in one line, continue. Confirm first only if the revision is destructive or changes policy compliance.reset, rebase, checkout -B, branch -D, push --force*): save a ref, named per repo policy.reset --hard, restore, switch --discard-changes, checkout -- <path>, clean -f, branch -D/-f, update-ref -d, stash drop, push --force*, or rewrite/rebase of pushed history without (a) a saved ref to the work and (b) the user's explicit OK, unless policy already authorises it.git stash push -u -m <unique-tag>, restore by SHA; the stash stack is shared across worktrees.git worktree list first: a branch checked out in another worktree cannot be switched to or deleted from here.pull.ff, rerere.enabled, hooks) are proposals under Prevent; apply only when asked.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
11 skills in this plugin
/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
/git-cleanupSafely analyzes and cleans up local git branches and worktrees by categorizing them as merged, squash-merged, superseded, or active work./git-commitExecute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping/grillingGrill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases./grill-meA relentless interview to sharpen a plan or design./handoffCompact the current conversation into a handoff document for another agent to pick up.npx claudepluginhub takfes/indie-marketplace --plugin essentials