rebase-stack

rebase-stack is a skill for Claude Code from ryanb/dotfiles. It costs 0 tokens per session (5,932 once invoked), scanned A, original, MIT.

A Git workflow for rearranging a chain of dependent branches and rebasing each one onto the branch before it. It can also update the related GitHub pull requests after the order changes.

In plain words
What is it for?
Use it to reorder a stack of pull requests, replay branches onto a new base, resolve rebase conflicts, and force-push updated branches safely.
Why use it?
It keeps stacked branches based on the right commits and removes duplicate changes. It also handles remote updates and pauses for help when conflicts occur.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; names the AskUserQuestion tool.

Part of the rebase-stack plugin — 1 skill shipped together

Good fit Use it to reorder a stack of pull requests, replay branches onto a new base, resolve rebase conflicts, and force-push updated branches safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ryanb/dotfiles/rebase-stack
About the project

ryanb/dotfiles is a collection of command-line configuration files for macOS, centered on Zsh and related tools such as Git, Ruby, Rails, and IRB. It is for developers who want to customize their terminal with commands, completions, prompts, and fuzzy-finding workflows. Its catalogue skills and plugin provide coding-agent workflows built into the same setup.

ryanb/dotfiles · 2,399 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ryanb/dotfiles --skill rebase-stack
Clone the repo
git clone --depth 1 https://github.com/ryanb/dotfiles

Made for: Claude Code.

Or install rebase-stack, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rebase-stack

README.md
[![agentmods](https://agentmods.dev/badge/skills/ryanb/dotfiles/rebase-stack/github.svg)](https://agentmods.dev/skills/ryanb/dotfiles/rebase-stack)
Your own site
<a href="https://agentmods.dev/skills/ryanb/dotfiles/rebase-stack"><img src="https://agentmods.dev/badge/skills/ryanb/dotfiles/rebase-stack/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rebase-stack

Your own site · 80×15
<a href="https://agentmods.dev/skills/ryanb/dotfiles/rebase-stack"><img src="https://agentmods.dev/badge/skills/ryanb/dotfiles/rebase-stack.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,932 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.05932
Opus 5.5 $0.00000 $0.02373
Sonnet 5.5 $0.00000 $0.01186
Haiku 4.5 $0.00000 $0.00593

Measured yesterday against content hash 37796e67b5c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rebase-stack scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (rebase-stack.sh, relink-stack.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude/skills/rebase-stack/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rebase Stack

Rebase a chain of dependent branches in order. The first branch is rebased onto the base branch; each subsequent branch is rebased onto the previous (now-rebased) branch, keeping only that branch's own commits so nothing is duplicated.

The list you pass defines the target order and does not have to match the current chain — reordering is supported. Each branch's exclusion boundary is derived from where it actually forked, so moving a branch up or down the stack replays only its own commits. See Reordering for the extra steps a reorder needs.

Two shell scripts shipped with this skill do the mechanical work: rebase-stack.sh rewrites the local branches, and relink-stack.sh reconciles the GitHub stack and PR bases afterwards when the order changed. This skill calls them and, when the rebase pauses on a conflict, delegates the resolution to a sub-agent so the main context stays small.

Step 1: Determine the stack

Get the ordered branch list from $ARGUMENTS. The first branch is the bottom of the stack (closest to the base branch); each subsequent branch builds on the previous one. This is the target order — if it differs from the current chain, that's a reorder and the run will rewrite the stack's shape.

If no branches are supplied in $ARGUMENTS, infer the stack from the current branch.

Base branch

Determine the base branch in this order:

  1. Use --base <branch> if the user specifies one (it goes before the branch list)
  2. Use the bottom branch's tracked parent from git config branch.<bottom>.parent, if set, still resolving to a commit, and not itself one of the stack branches
  3. Use bin/base-branch if the script exists and is executable
  4. Ask the user which branch the stack sits on

Pass the result to both scripts as --base <branch> so they don't have to re-derive it.

Preferred: ask gh stack

The repo may already track the chain as a GitHub stack (the gh stack extension). Ask it first:

Read the full file on GitHub · 277 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +6 lines 37796e67b5c2
  2. 24d ago First seen · 271 lines · 0 tokens per session scan A ee6f7a4f9d20

Subscribe to this mod's changes

rebase-stack is a skill published in the GitHub repository ryanb/dotfiles (2,399 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,932 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-22.