squash

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

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/dsswift/ion/squash
Clone the repo
git clone --depth 1 https://github.com/dsswift/ion
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,362 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.00017 $0.04362
Opus 5 $0.00009 $0.02181
Sonnet 5 $0.00003 $0.00872
Haiku 4.5 $0.00002 $0.00436

Measured yesterday against content hash 3b2bd65cbcb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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 · 455 lines

How it starts

The opening of the file, as written. The whole thing — 455 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 (§8). 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. Release-please versions each component by the paths a commit touches (release-please-config.json), 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 · 455 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. yesterday 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,362 once invoked, about $0.0001 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.