squash

A Git command workflow that combines several recent commits into one commit. Git is a tool for tracking code changes, and a commit is a saved checkpoint.

In plain words
What is it for?
Use it to combine recent development commits, create one clear commit message, and prepare a branch for review.
Why use it?
It removes a messy series of small checkpoints before sharing work, while keeping the combined changes staged for review. It also checks whether the commits may already be shared.

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/owainlewis/youtube-tutorials/squash
Clone the repo
git clone --depth 1 https://github.com/owainlewis/youtube-tutorials
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 266 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.00266
Opus 5 $0.00000 $0.00133
Sonnet 5 $0.00000 $0.00053
Haiku 4.5 $0.00000 $0.00027

Measured 2d ago against content hash 969da243232b, 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 2d 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.

tutorials/ai-git-workflow/resources/commands/squash.md · 40 lines

What it actually says

Squash

Squash recent commits into a single clean commit.

Input

$ARGUMENTS — number of commits to squash (e.g. "4") or a description of which commits

Instructions

  1. Run git log --oneline -10 to show recent commits
  2. Identify which commits to squash
  3. Use git reset --soft HEAD~N to uncommit while keeping changes staged
  4. Write a single coherent commit message that summarizes the combined work
  5. Do NOT just concatenate the old messages — write a new one that captures the intent

Rules

  • Never squash commits that have already been pushed to a shared branch
  • If commits are already pushed to a feature branch, warn before proceeding
  • The new message should describe the overall change, not list individual steps
  • Follow the same commit message format (type(scope): subject + body)

Example

Before:

a1b2c3d fix typo in auth handler
d4e5f6g add error handling to login
g7h8i9j add login endpoint

After squash:

feat(auth): add login endpoint with error handling

Adds POST /api/auth/login with credential verification,
JWT token generation, and structured error responses.
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. 2d ago First seen · 40 lines · 0 tokens per session scan A 969da243232b

Subscribe to this mod's changes

squash is a command published in the GitHub repository owainlewis/youtube-tutorials (375 stars, last pushed 11d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 266 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-30.