squash

squash is a command for Claude Code from dsswift/ion. It costs 17 tokens per session (4,837 once invoked), scanned A, original, MIT.

A command for rebuilding a feature branch's Git history into clean conventional commits while keeping the final tracked files exactly unchanged. A feature branch is a separate line of work in Git.

In plain words
What is it for?
Rewriting branch commits, assigning each result to one declared scope, applying conventional commit type-and-scope labels, and stopping automatically if its safety checks detect a mismatch or content loss.
Why use it?
It organizes messy commit history without changing the code or other tracked content that the branch currently produces.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: model in frontmatter; names the AskUserQuestion tool.

Good fit Rewriting branch commits, assigning each result to one declared scope, applying conventional commit type-and-scope labels, and stopping automatically if its safety checks detect a mismatch or content loss.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/dsswift/ion/squash
View source ↗ dsswift/ion
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.

Clone the repo
git clone --depth 1 https://github.com/dsswift/ion

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 squash

README.md
[![agentmods](https://agentmods.dev/badge/commands/dsswift/ion/squash/github.svg)](https://agentmods.dev/commands/dsswift/ion/squash)
Your own site
<a href="https://agentmods.dev/commands/dsswift/ion/squash"><img src="https://agentmods.dev/badge/commands/dsswift/ion/squash/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 squash

Your own site · 80×15
<a href="https://agentmods.dev/commands/dsswift/ion/squash"><img src="https://agentmods.dev/badge/commands/dsswift/ion/squash.svg" alt="Reviewed on agentmods" width="80" 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 4,837 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.00017 $0.04837
Opus 5.5 $0.00007 $0.01935
Sonnet 5.5 $0.00003 $0.00967
Haiku 4.5 $0.00002 $0.00484

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

Security

Grade A, and why

squash 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 17d 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.

.ion/commands/squash.md · 492 lines

How it starts

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

/squash

Rebuild current feature branch into clean conventional commits without changing tracked content. This command is history-only and fully autonomous.

No human interaction

Never call AskUserQuestion. Never pause for approval, confirmation, or disambiguation at any point. Emit the plan, then execute it in the same turn without waiting. Every decision has a deterministic rule below; when a rule fires, apply it, log it as a plan revision, and continue.

The only stop conditions are the Phase A guards (§2), a pre-reset target mismatch (§6), and verified content loss (§8b). Once the rebuild starts it always runs to completion (§7b) — a plan that proves unimplementable is revised, never abandoned. Any stop is automatic and reported; it never asks.

Absolute invariants

Two, both mandatory. Neither is ever traded for the other.

I1 — Content. Final HEAD^{tree} must equal starting HEAD^{tree} byte-for-byte.

I2 — Scope. Every result commit must resolve to exactly one scope under .commit.json, and its type(scope): tag must be that scope.

I2 is not cosmetic. The release tool (release-damnit, configured by release-please-config.json) versions each component by the paths a commit touches, and takes the commit's type and subject as that component's changelog entry. So a commit spanning two release units bumps both and files the same subject under both changelogs — one of them a lie. A commit whose tag disagrees with its paths ships a correct version under a misleading entry. Both are defects equal in severity to losing content.

.commit.json keeps the tag and the paths in agreement, which is why scope is always resolved from paths and never taken from the plan's subject line. There is no "report the mismatch and move on" path: a scope violation is prevented before commit (§7c) and repaired after commit (§8a).

Commit count, subjects, and grouping are all negotiable to satisfy I1 and I2. Splitting a feature into more commits, or merging features into fewer, is always permitted and preferred over shipping a wrong scope.

Read the full file on GitHub · 492 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. 17d ago Changed · +3 lines ae9abce6b75a
  2. 1mo ago Changed · +33 lines 9e9318db8ece
  3. 1mo ago Changed · +1 lines f108c9348d40
  4. 1mo ago First seen · 455 lines · 17 tokens per session scan A 3b2bd65cbcb7

Subscribe to this mod's changes

squash is a command published in the GitHub repository dsswift/ion (4 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 4,837 once invoked, about $0.0001 per session on Opus 5.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.