squash-pr

Squash branch commits into one clean commit and open a PR.

Command for Claude Code

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/squirrelsoft-dev/dev/squash-pr
Clone the repo
git clone --depth 1 https://github.com/squirrelsoft-dev/dev

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 722 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00012 $0.00722
Opus 5 $0.00006 $0.00361
Sonnet 5 $0.00002 $0.00144
Haiku 4.5 $0.00001 $0.00072

Measured today against content hash 1a3609d2031d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

squash-pr 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 today.

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.

.claude/commands/squash-pr.md · 68 lines

How it starts

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

Squash & PR

Squash all commits on the current branch into a single conventional commit and open a pull request.

Arguments: $ARGUMENTS — optional issue number/identifier (e.g. 42, ORG-123)

Steps

  1. Detect base branch — run git branch -a and determine whether the repo uses main or master as the default branch. Store as <base>.

  2. Detect git platform — run git remote get-url origin and classify:

    • Contains github.comGitHub (use gh CLI)
    • Contains gitlab.com or a self-hosted GitLab pattern → GitLab (use glab CLI)
    • Contains bitbucket.orgBitbucket (limited CLI — provide manual URL)
  3. Resolve issue number — if $ARGUMENTS is provided, use it as the issue identifier. Otherwise, extract from the current branch name using common patterns:

    • fix/123-description123
    • feature/ORG-123-descriptionORG-123
    • issue-4242
    • If no issue number can be extracted, proceed without one.
  4. Fetch issue context (if an issue number was resolved):

    • GitHub: gh issue view <number>
    • GitLab: glab issue view <number>
    • Bitbucket: skip (use branch name and commit context instead)

    Use the issue title and description to inform the commit message.

  5. Analyze branch commits — run git log --oneline <base>..HEAD to understand the full scope of work done on this branch.

  6. Analyze the diff — run git diff <base>...HEAD to understand exactly what changed.

  7. Generate conventional commit message using all context gathered:

    type(scope): description (#issue)
    
    body — what changed and why, summarizing the full branch work
    
    Closes #issue
    

    Follow the same rules as /commit: imperative, lowercase description, no period. Scope is the primary module/feature affected.

  8. Squash commits — run:

    git reset --soft $(git merge-base <base> HEAD)
    

    Then commit all staged changes with the generated message using git commit -m "<message>".

Read the full file on GitHub · 68 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. today First seen · 68 lines · 12 tokens per session scan A 1a3609d2031d

Subscribe to this mod's changes

squash-pr is a command published in the GitHub repository squirrelsoft-dev/dev (14 stars, last pushed 17d ago), licensed MIT. It adds 12 tokens to every session and 722 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-09-01.