git-rebase

git-rebase is a skill for Claude Code from CH3COOH/claude-skills. It costs 83 tokens per session (1,947 once invoked), scanned A, original, MIT.

A guide for combining several Git commits into one using interactive rebase. Git is a system that records code changes as commits, and rebase can rewrite that history.

In plain words
What is it for?
Use it to squash recent or selected commits, check repository state, validate commit order, and prepare a combined commit message.
Why use it?
It helps turn a messy series of related commits into a cleaner history before sharing or merging the work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Good fit Use it to squash recent or selected commits, check repository state, validate commit order, and prepare a combined commit message.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ch3cooh/claude-skills/git-rebase
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 CH3COOH/claude-skills --skill git-rebase
Clone the repo
git clone --depth 1 https://github.com/CH3COOH/claude-skills

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 git-rebase

README.md
[![agentmods](https://agentmods.dev/badge/skills/ch3cooh/claude-skills/git-rebase/github.svg)](https://agentmods.dev/skills/ch3cooh/claude-skills/git-rebase)
Your own site
<a href="https://agentmods.dev/skills/ch3cooh/claude-skills/git-rebase"><img src="https://agentmods.dev/badge/skills/ch3cooh/claude-skills/git-rebase/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 git-rebase

Your own site · 80×15
<a href="https://agentmods.dev/skills/ch3cooh/claude-skills/git-rebase"><img src="https://agentmods.dev/badge/skills/ch3cooh/claude-skills/git-rebase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,947 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.00083 $0.01947
Opus 5 $0.00042 $0.00974
Sonnet 5 $0.00017 $0.00389
Haiku 4.5 $0.00008 $0.00195

Measured 8d ago against content hash 969f091b4db7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

git-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 8d 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.

git-rebase/SKILL.md · 201 lines

How it starts

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

Git Interactive Rebase スキル

指定範囲のコミットを1つに統合(squash)するための手順とコミットメッセージを生成します。

役割の分担:

  • Claude が行う: git log / git status / git branch などの読み取りコマンドを実行し、状態を把握する
  • ユーザーが行う: git rebase -i などの履歴変更コマンドを実行する

使用例

例1: 直近3コミットをまとめる

ユーザー: 「直近3つのコミットを1つにまとめたい」 実行: git-rebase HEAD~3 HEAD 結果: 3コミットが1つのコミットに統合される

例2: 特定範囲のコミットを統合

ユーザー: 「abc1234からdef5678までのコミットをsquashして」 実行: git-rebase abc1234 def5678 結果: 指定範囲のコミットが統合され、適切なメッセージが提案される

例3: ブランチの作業をまとめる

ユーザー: 「featureブランチの全コミットを1つにしたい」 実行: mainブランチとの分岐点を特定し、rebaseコマンドを提示 結果: ブランチ上の全コミットが1つに統合される


事前バリデーション

以下を Bash ツールで確認し、問題があれば手順の提示前にユーザーへ案内すること:

チェック項目 確認コマンド 問題がある場合の対応
引数の数 - <from-commit><to-commit> の両方を教えてもらう
作業ディレクトリ git status --porcelain 未コミットの変更があれば先に commit または stash するよう案内
rebase中でないこと .git/rebase-merge / .git/rebase-apply の存在を確認 進行中なら --abort または --continue で解決するよう案内
コミットの存在 git rev-parse --verify <from-commit> / <to-commit> 存在しないハッシュはユーザーに再確認
コミット順序 git merge-base --is-ancestor <from> <to> from が to の祖先でない場合は順序を入れ替えるよう案内
push済みか否か git branch -r --contains <from-commit> push済みであれば force push が必要な旨を事前に警告

問題が確認された場合は、以降の処理を行わずユーザーに解決を依頼すること。


手順

Step 1: 現在の状態を確認(Claude が実行)

git status
git branch --show-current
git log --oneline -20
  • detached HEAD 状態の場合は警告を表示

Step 2: 対象コミットの内容を分析(Claude が実行)

git log --oneline '<from-commit>^'..'<to-commit>'
git log --stat '<from-commit>^'..'<to-commit>'
git log --merges '<from-commit>^'..'<to-commit>'
  • 統合対象のコミット数・変更内容・コミットメッセージの傾向を把握する
  • マージコミットが含まれる場合は以下を案内:

    ⚠️ 対象範囲にマージコミットが含まれています。通常のrebaseではマージの履歴が失われます。 マージ履歴を保持する場合は git rebase -i --rebase-merges '<from-commit>^' を使用してください。

Step 3: Interactive rebase コマンドをユーザーに提示

from-commit がリポジトリの最初のコミット(root commit)の場合

git rebase -i --root

通常の場合

git rebase -i '<from-commit>^'

Step 4: エディタでの操作手順を説明

Read the full file on GitHub · 201 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. 8d ago First seen · 201 lines · 83 tokens per session scan A 969f091b4db7

Subscribe to this mod's changes

git-rebase is a skill published in the GitHub repository CH3COOH/claude-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 83 tokens to every session and 1,947 once invoked, about $0.0004 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-31.