rebase-safely

rebase-safely is a skill for Claude Code from latestaiagents/agent-skills. It costs 66 tokens per session (1,592 once invoked), scanned A, original, MIT.

A guide to safely rewriting Git history, such as combining, reordering, or editing commits. Git branches are separate lines of work, and rebasing moves their commits onto a newer starting point.

In plain words
What is it for?
Use it to update a feature branch from main, clean up commits before a pull request, fix commit messages, or handle rebase conflicts.
Why use it?
It explains which branches are safe to rebase and helps avoid disrupting work that other people already use.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the developer-toolkit plugin — 19 skills shipped together

Good fit Use it to update a feature branch from main, clean up commits before a pull request, fix commit messages, or handle rebase conflicts.

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

Made for: Claude Code.

Or install developer-toolkit, the plugin that ships this one along with the rest of its 19 skills.

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-safely

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/rebase-safely"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/rebase-safely.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,592 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.00066 $0.01592
Opus 5 $0.00033 $0.00796
Sonnet 5 $0.00013 $0.00318
Haiku 4.5 $0.00007 $0.00159

Measured 10d ago against content hash 2230140c88dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rebase-safely 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 10d 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.

plugins/developer-toolkit/skills/git/rebase-safely/SKILL.md · 306 lines

How it starts

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

Rebase Safely

Master Git rebase without losing work or causing team chaos.

When to Use

  • Updating feature branch with latest main
  • Cleaning up commit history before PR
  • Squashing multiple commits into one
  • Reordering or editing commits
  • Fixing commit messages

The Golden Rule

NEVER rebase commits that have been pushed to a shared branch.

Rebasing rewrites history. If others have based work on those commits, you'll cause merge conflicts and confusion.

Safe to rebase:
✓ Local commits not yet pushed
✓ Your own feature branch (not yet merged)
✓ Commits only you have seen

NOT safe to rebase:
✗ main/develop branch
✗ Shared feature branches
✗ Already merged commits

Basic Rebase Operations

Update Feature Branch with Main

# Fetch latest
git fetch origin

# Rebase onto main
git checkout feature-branch
git rebase origin/main

# If conflicts, resolve then:
git add <resolved-files>
git rebase --continue

# Force push YOUR branch only
git push --force-with-lease

Interactive Rebase - Clean Up History

# Rebase last 3 commits
git rebase -i HEAD~3

# Rebase from where branch diverged
git rebase -i main

Interactive rebase commands:

pick   = use commit as-is
reword = use commit, but edit message
edit   = use commit, but stop to amend
squash = meld into previous commit (keep message)
fixup  = meld into previous commit (discard message)
drop   = remove commit entirely

Common Scenarios

1. Squash Multiple Commits

Before:

abc123 fix: typo in login
def456 fix: another typo
ghi789 feat: add login page
git rebase -i HEAD~3

Change to:

pick ghi789 feat: add login page
squash def456 fix: another typo
squash abc123 fix: typo in login

Result: One clean commit with combined message.

2. Reorder Commits

git rebase -i HEAD~3

Just change the order of pick lines:

pick ghi789 third commit
pick abc123 first commit  # moved down
pick def456 second commit # moved down

Read the full file on GitHub · 306 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. 10d ago First seen · 306 lines · 66 tokens per session scan A 2230140c88dc

Subscribe to this mod's changes

rebase-safely is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 66 tokens to every session and 1,592 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

git-flow-master

End-to-end Git operator for any branching strategy. Auto-detects the project's strategy (solo-main, main+integration, enterprise multi-branch, trunk-based, GitFlow, GitHub Flow, GitLab Flow, SDET integration-trunk for chained test-automation suites) from .git config, branches, and the gitstrategy: block in…

upex-galaxy/agentic-qa-boilerplate · 502 tokens

version-bump

Version the Team plugin at land time (DEV-internal, not distributed): decide the SemVer level, compute the next free version against current main, update all six version strings, cut the [Unreleased] changelog body into a dated [X.Y.Z] section, run the land-time consistency assertion, and commit chore(version): X.Y.Z.…

bostonaholic/team · 207 tokens

vigilante-issue-implementation-on-monorepo

Implement a GitHub issue end-to-end when Vigilante dispatches work for a watched monorepo. Use the provided worktree, respect repository instructions, comment on the issue as work progresses, and report failures back to GitHub.

aliengiraffe/vigilante · 59 tokens

vigilante-issue-implementation-on-ruby

Implement a GitHub issue end-to-end when Vigilante dispatches work for a Ruby repository with Bundler, test, lint, and security guidance.

aliengiraffe/vigilante · 41 tokens

vigilante-issue-implementation-on-rust

Implement a GitHub issue end-to-end when Vigilante dispatches work for a Rust repository with Cargo, Clippy, fmt, and security guidance.

aliengiraffe/vigilante · 41 tokens

tracking-tickets

Defines tracker status transitions and closing rules. Load when a pipeline run is linked to a ticket.

bostonaholic/team · 23 tokens