rebase

rebase is a command for Claude Code from tony/claude-code-riper-5. It costs 17 tokens per session (1,067 once invoked), scanned A, original, MIT.

A command for rebasing the current Git branch onto the repository's remote trunk branch, usually called main or master. Rebasing reapplies your branch's commits on top of the latest trunk commits.

In plain words
What is it for?
Use it before merging or opening a pull request when your branch may be behind the remote main or master branch.
Why use it?
It brings the branch up to date and exposes conflicts before merging. The instructions also help identify the trunk branch, compare changes, and resolve conflicts carefully.

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/tony/claude-code-riper-5/rebase
Clone the repo
git clone --depth 1 https://github.com/tony/claude-code-riper-5

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/tony/claude-code-riper-5/rebase.svg)](https://agentmods.dev/commands/tony/claude-code-riper-5/rebase)
Your own site
<a href="https://agentmods.dev/commands/tony/claude-code-riper-5/rebase"><img src="https://agentmods.dev/badge/commands/tony/claude-code-riper-5/rebase.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,067 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.00017 $0.01067
Opus 5 $0.00009 $0.00534
Sonnet 5 $0.00003 $0.00213
Haiku 4.5 $0.00002 $0.00107

Measured 4d ago against content hash 5aed7ffe2af0, 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 4d 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 · 75 lines

How it starts

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

Context

  • Current branch: !git branch --show-current
  • Trunk branch: !git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo "master"
  • Remote refs available: !git remote -v 2>/dev/null | head -2
  • Commits on current branch not on trunk: !TRUNK=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo "master"); git log --oneline "origin/${TRUNK}..HEAD" 2>/dev/null || echo "(could not determine commits ahead)"
  • Diff from trunk (summary): !TRUNK=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo "master"); git diff --stat "origin/${TRUNK}" 2>/dev/null || echo "(could not diff against trunk)"

Your Task

Rebase the current branch onto the remote trunk branch. Follow these steps carefully, handling each phase before moving to the next.

Phase 1: Detect trunk branch

Determine the trunk branch name from the context above (the "Trunk branch" value). Store it mentally as TRUNK. It will typically be master or main. If detection failed, try both origin/master and origin/main to see which exists.

Phase 2: Fetch latest and analyze

  1. Run git fetch origin to get the latest remote state.
  2. Run git diff origin/${TRUNK}...HEAD --stat to see what files the current branch modifies.
  3. Run git diff origin/${TRUNK}...HEAD to see the full diff of changes on this branch.
  4. Run git log --oneline origin/${TRUNK}..HEAD to see commits that will be rebased.
  5. Run git diff origin/${TRUNK} -- $(git diff --name-only origin/${TRUNK}...HEAD) to check if trunk has also modified any of the same files — these are potential conflict zones.

Report a brief summary of:

  • How many commits will be rebased
  • Which files were changed on this branch
  • Which of those files were ALSO changed on trunk (potential conflicts)
  • An assessment of conflict likelihood (none expected / minor / significant)

Phase 3: Execute the rebase

Run:

git pull --rebase origin ${TRUNK} --autostash

Read the full file on GitHub · 75 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. 4d ago First seen · 75 lines · 17 tokens per session scan A 5aed7ffe2af0

Subscribe to this mod's changes

rebase is a command published in the GitHub repository tony/claude-code-riper-5 (93 stars, last pushed 18d ago), licensed MIT. It adds 17 tokens to every session and 1,067 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.