Git Rebase Helper skill for Claude and Codex
A safe, step-by-step rebase plan for your branch: the exact commands in order, what the interactive editor should look like, how to resolve each conflict, and…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a branch needs rebasing onto main, commits need squashing or reordering, or a rebase is stuck in conflicts and the user wants the exact commands. Do not use for choosing between merge and rebase as a team policy, or recovering commits that have already been garbage collected. Related topics: coding, workflow, git.
What it will ask you for
- Branch being rebased (free text, e.g. "feature/login-form")
- Target branch to rebase onto (free text, e.g. "main")
- Number of commits on my branch (number from 1 to 50)
- Interactive rebase to squash or reorder (choose one: Yes, No)
- Is the branch already pushed and shared (choose one: Not pushed, Pushed but only I use it, Pushed and others have it)
- Current problem (if any) (longer free text)
How it works
- Create a safety net first: a backup branch or tag at the current tip and a fetch of the target, so the rebase can be undone.
- Lay out the rebase commands in execution order with the expected output after each, starting from the user's current state when they are mid-rebase.
- Show the interactive todo list with each line marked pick, squash, fixup, or reword and the reason, when interactive is on.
- Explain conflict resolution per file: read the markers, resolve, git add, continue, and the point at which aborting and merging is the better choice.
- End with the correct push command for the branch's sharing state and the coordination note when others already have the old history.
What you get
A numbered command walkthrough with the expected state after each step, an interactive todo list where relevant, a conflict-resolution routine, and the final push command with its safety caveat.
What it watches out for
- Rebasing a branch that teammates have already pulled without warning them, which leaves everyone with duplicate commits.
- Suggesting git push --force instead of --force-with-lease, which silently overwrites work pushed by someone else.
- Skipping the backup ref, so a bad squash cannot be undone without digging through reflog.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.