squash

Squash a range of git commits into one with a new message.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/cychen2021/claude-skills --skill squash
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squash
Source: https://github.com/cychen2021/claude-skills/tree/main/squash
Command: npx skills add https://github.com/cychen2021/claude-skills --skill squash

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Squash a range of commits into a single, cohesive commit with a freshly drafted message to clean up history.

Core Features & Use Cases

  • Consolidates multiple commits into one to simplify history and improve readability.
  • Safeguards against rewriting shared history by default, requiring explicit confirmation for remote updates.
  • Accepts natural-language range descriptions (e.g., "last 5 commits" or "since feature X") and resolves them to concrete git references.

Quick Start

Squash the selected commit range into a single, descriptive commit message.

Frequently Asked Questions about squash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I squash multiple git commits into one clean commit message?

Yes, you can squash commits using natural-language range descriptions like "last 5 commits" or "all commits since feature X". The tool resolves these descriptions into concrete git references and shows the exact commits for confirmation.

Is it safe to squash commits that have already been pushed to a remote repository?

Squashing pushed commits is safeguarded against rewriting shared history by default. The tool checks remote status and requires explicit confirmation before proceeding with any remote updates to prevent overwriting collaborators' work.

Can I squash commits by describing the range in plain English instead of using commit hashes?

Yes, you can squash commits using natural-language range descriptions like "last 5 commits" or "all commits since feature X". The tool resolves these phrases into concrete git references and presents the exact commits for your confirmation before proceeding.

What is the best way to clean up a messy commit history before merging a feature branch?

Squashing a range of commits into a single, cohesive commit is an effective way to clean up history and improve readability. This tool drafts a fresh message and consolidates multiple intermediate commits into one descriptive entry.

When should I avoid squashing commits in version control?

You should avoid squashing commits when the target range has already been pushed and shared with collaborators. Rewriting shared history is blocked by default unless you provide explicit confirmation to override the safety check.