dev: Command for Claude Code

.claude/commands/squash-pr.md

squash-pr is a command for Claude Code from squirrelsoft-dev/dev. It costs 12 tokens per session (722 once invoked), scanned A, original, MIT.

A command that combines the commits on your current branch into one commit and opens a pull request on supported code-hosting services.

In plain words
What is it for?
Use it to detect the project platform, find the base branch, optionally load issue details, squash commits, and create a pull request.
Why use it?
It turns a messy sequence of work-in-progress commits into a cleaner review history. A pull request is a request for teammates to review and merge code changes.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is squirrelsoft-dev/dev's own configuration. It tells Claude Code how to work on dev itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dev configures →

Reuse

Borrowing it

Nothing to install: this file belongs to squirrelsoft-dev/dev. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/squirrelsoft-dev/dev/main/.claude/commands/squash-pr.md
Clone the repo
git clone --depth 1 https://github.com/squirrelsoft-dev/dev

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-pr

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/squirrelsoft-dev/dev/squash-pr"><img src="https://agentmods.dev/badge/commands/squirrelsoft-dev/dev/squash-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00012 $0.00722
Opus 5.5 $0.00005 $0.00289
Sonnet 5.5 $0.00002 $0.00144
Haiku 4.5 $0.00001 $0.00072

Measured 1mo ago against content hash 1a3609d2031d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

.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.com → GitHub (use gh CLI)
    • Contains gitlab.com or a self-hosted GitLab pattern → GitLab (use glab CLI)
    • Contains bitbucket.org → Bitbucket (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-description → 123
    • feature/ORG-123-description → ORG-123
    • issue-42 → 42
    • 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. 1mo ago 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 (17 stars, last pushed 4d ago), licensed MIT. It adds 12 tokens to every session and 722 once invoked, about $0.0000 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-09-01.