squash-commits

squash-commits is a command for coding agents from metaschema-framework/claude-plugins. It costs 0 tokens per session (899 once invoked), scanned A, original, CC0-1.0.

A command that combines all commits on the current branch into one commit with a consolidated message. A commit is a saved change in a Git repository.

In plain words
What is it for?
Use it to inspect the branch, identify commits since the base branch, combine them safely, and create one comprehensive commit.
Why use it?
It produces a cleaner branch history before sharing or merging work, while first checking for uncommitted changes and the correct base branch.

Command

Part of the dev-metaschema plugin — 7 skills, 3 commands shipped together

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/metaschema-framework/claude-plugins/squash-commits
Clone the repo
git clone --depth 1 https://github.com/metaschema-framework/claude-plugins

Or install dev-metaschema, the plugin that ships this one along with the rest of its 7 skills, 3 commands.

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 squash-commits

README.md
[![agentmods](https://agentmods.dev/badge/commands/metaschema-framework/claude-plugins/squash-commits.svg)](https://agentmods.dev/commands/metaschema-framework/claude-plugins/squash-commits)
Your own site
<a href="https://agentmods.dev/commands/metaschema-framework/claude-plugins/squash-commits"><img src="https://agentmods.dev/badge/commands/metaschema-framework/claude-plugins/squash-commits.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 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.00000 $0.00899
Opus 5 $0.00000 $0.00449
Sonnet 5 $0.00000 $0.00180
Haiku 4.5 $0.00000 $0.00090

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

Security

Grade A, and why

squash-commits 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.

plugins/dev-metaschema/commands/squash-commits.md · 145 lines

How it starts

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

Squash Commits Command

Squash all commits in the current branch into a single commit with a comprehensive message.

Instructions

Execute the following steps to squash commits safely:

Step 1: Validate State

First, verify the repository state is clean and identify the base branch:

# Check for uncommitted changes
git status --porcelain

# Identify the base branch (develop or main)
git branch -r | grep -E 'origin/(develop|main)$' | head -1

If there are uncommitted changes, STOP and inform the user they must commit or stash changes first.

Step 2: Identify Commits to Squash

Determine the merge base and list all commits:

# Find the merge base with the target branch (adjust branch name as needed)
git merge-base HEAD origin/develop

# Count commits since merge base
git rev-list --count $(git merge-base HEAD origin/develop)..HEAD

# List all commits with full messages
git log $(git merge-base HEAD origin/develop)..HEAD --format="=== COMMIT %h ===%n%B"

If there is only 1 commit, inform the user there is nothing to squash.

Step 3: Analyze Commit Messages

Read and analyze all commit messages from Step 2. Create a comprehensive combined message that:

  1. Summarizes the overall change in a clear subject line (50 chars max if possible)
  2. Preserves important details from each original commit
  3. Groups related changes logically
  4. Maintains any issue/PR references (e.g., #123, fixes #456)
  5. Removes redundant information (e.g., repeated "fix typo" commits can be consolidated)

Format the message as:

<type>: <concise summary of all changes>

<Detailed description organized by logical groupings>

- <Key change 1>
- <Key change 2>
- ...

<Any preserved references or metadata>

Step 4: Perform the Squash

Use soft reset to squash (preserves all changes in staging):

# Store the merge base commit
MERGE_BASE=$(git merge-base HEAD origin/develop)

# Soft reset to merge base (keeps changes staged)
git reset --soft $MERGE_BASE

# Verify staged changes match expected
git diff --cached --stat

Read the full file on GitHub · 145 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 · 145 lines · 0 tokens per session scan A 114f5bdadd98

Subscribe to this mod's changes

squash-commits is a command published in the GitHub repository metaschema-framework/claude-plugins (10 stars, last pushed 6mo ago), licensed CC0-1.0. It costs nothing until one of its globs matches a file; then it loads 899 tokens. 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.