← ClaudeAtlas

squashlisted

Squash git commits by pattern, hash list, or the last N, without opening an editor. Use when the user asks to squash, fold, or combine commits, or to collapse fixup and WIP commits.
bengous/claude-code-plugins · ★ 4 · Code & Development · score 73
Install: claude install-skill bengous/claude-code-plugins
# Squash Fold a run of commits into one. The rebase backend of this plugin does the rewrite: it builds the todo, sets the editors inside its own process, creates a timestamped backup branch, re-checks the plan against the branch, and leaves a conflict resumable. This skill only chooses which commits fold. ## Arguments `$ARGUMENTS` | Mode | Selection | |---|---| | `--range N` | the last N commits, folded into the oldest | | `--hashes h1,h2,...` | the listed commits, folded into the oldest of them | | `--pattern <regex>` | every commit whose subject matches, case-insensitive, folded into the oldest match | | `--dry-run` | validate and print the plan, rewrite nothing | ## Protocol 1. **Range.** `--range N`: the range is `N`. Otherwise the range is the branch: `origin/dev` when it exists, else the remote default branch (`git rev-parse --abbrev-ref origin/HEAD`). No remote at all, or on that branch itself: ask how far back to look, and use `N`. ``` run `"${CLAUDE_PLUGIN_ROOT}/scripts/rebase.ts" plan {range}` ``` On `ok: false`, report `error` and `detail` and stop: `dirty-worktree` lists the files to commit or stash first, `rebase-already-in-progress` points at `/git:rebase continue|skip|abort`. 2. **Targets.** From `plan.commits`, oldest first: the commits whose hash starts with a listed hash, or whose subject matches the pattern. Fewer than two targets: say so and stop. A listed hash outside the range: name it and stop. The target