rebase

A command for replaying the commits on your current Git branch on top of the latest default branch, usually main. This process is called rebasing and helps create a more up-to-date branch history.

In plain words
What is it for?
Run it when preparing a branch for merging or a pull request. It checks that you are on a non-default branch with no uncommitted changes, fetches updates, and rebases the branch.
Why use it?
It keeps your branch aligned with the latest shared code and can resolve straightforward merge conflicts. It pauses when a conflict needs your decision.

Command for Claude Code

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.

agentmods
npx agentmods add commands/fotoetienne/gru/rebase
Clone the repo
git clone --depth 1 https://github.com/fotoetienne/gru

Made for: Claude Code.

Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 513 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00011 $0.00513
Opus 5 $0.00005 $0.00257
Sonnet 5 $0.00002 $0.00103
Haiku 4.5 $0.00001 $0.00051

Measured 3d ago against content hash cd31b8fa9311, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rebase 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 3d ago.

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/commands/rebase.md · 81 lines

How it starts

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

Rebase the current working branch onto the default branch (usually main) with intelligent conflict resolution.

This command uses the git-rebase skill to:

  1. Fetch the latest default branch from origin
  2. Rebase your current branch onto it
  3. Intelligently resolve merge conflicts by examining PR and issue context
  4. Report any conflicts that require your input with detailed analysis

Prerequisites

  • You must be on a branch (not the default branch)
  • Your working directory should be clean (commit or stash changes first)
  • You're in a git repository

Workflow

Invoke the git-rebase skill to handle the entire rebase process:

skill: git-rebase

The skill will:

  • ✅ Verify your git state
  • ✅ Fetch the latest default branch
  • ✅ Start the rebase process
  • ✅ Resolve straightforward conflicts automatically
  • ✅ Pause and ask for input on ambiguous conflicts
  • ✅ Provide detailed context from your PR and issue
  • ✅ Complete the rebase or report what needs your decision

What Happens During Rebase

Automatically Resolved Conflicts

The skill handles these confidently:

  • Independent changes in different code sections
  • Import additions (merges and sorts them)
  • Refactoring on default branch (adapts your code)
  • Both branches adding tests/config (merges both)

Conflicts Requiring Your Input

The skill will pause for:

  • Logic conflicts with different approaches
  • Security or permission changes
  • Architectural decisions
  • Configuration value conflicts
  • Anything ambiguous or uncertain

When paused, you'll receive:

  • Clear explanation of each conflict
  • Context from your PR/issue
  • Why the skill is uncertain
  • Resolution options
  • How to relaunch with your decision

After Rebase Completes

  1. Review the changes: git diff origin/main
  2. Run tests: Ensure nothing broke
  3. Force push (if needed): git push --force-with-lease

If Something Goes Wrong

You can always abort the rebase:

git rebase --abort

This returns you to the state before the rebase started.

Read the full file on GitHub · 81 lines

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. 3d ago First seen · 81 lines · 11 tokens per session scan A cd31b8fa9311

Subscribe to this mod's changes

rebase is a command published in the GitHub repository fotoetienne/gru (11 stars, last pushed 26d ago), licensed Apache-2.0. It adds 11 tokens to every session and 513 once invoked, about $0.0001 per session on Opus 5. 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-08-30.