Skip to content
Development
Command

/worktree-gc

Remove git worktrees (and local branches) whose work is already merged into the default branch, including squash merges. Dry run by default.

From plugin
scaffolding
1621 skills13 agents21 commands25 hooks
> /plugin marketplace add komluk/scaffolding
> /plugin install scaffolding@komluk-scaffolding

Command definition

worktree-gc.md
name: worktree-gc
description: Remove git worktrees (and local branches) whose work is already merged into the default branch, including squash merges. Dry run by default.

/worktree-gc Command

Garbage-collect stale git worktrees of the current repo. Detects fast-forward, cherry-picked and squash merges (remote ref gone + commit subjects in `origin/<default>`).

Usage

/worktree-gc                      # dry run: table of REMOVE/KEEP + reason + path
/worktree-gc --apply              # remove the REMOVE ones (+ local branches, prune)
/worktree-gc --all-repos ~/repos  # scan every git repo directly under the dir

Run

Pass `$ARGUMENTS` through. Show the table to the user. Run with `--apply` only when the user asked for it (or confirms after the dry run).

bash "${CLAUDE_PLUGIN_ROOT}/scripts/worktree-gc.sh" $ARGUMENTS

Rules

  • REMOVE only if there are no uncommitted tracked changes AND the work is in `origin/<default>`.
  • Unsure -> KEEP. The main checkout is never touched. Remote branches are never deleted.
  • Runs `git fetch --prune` first (warns and continues on failure).
@komluk
Ships withscaffolding

Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 39 skills, 21 commands, 20 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.

1639 skills13 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
16
Star history of komluk/scaffolding on GitHub, a chart by star-history.com

Other commands on scaffolding.

context

context

Command

Analyze and optimize Claude Code's context configuration (analyze, optimize, or reset).

@komluk@komlukInstall Command
create-skill

create-skill

Command

Scaffold a new scaffolding-compatible skill: an interactive flow that creates `skills/<name>/SKILL.md` from the canonical…

@komluk@komlukInstall Command
doctor

doctor

Command

Health-check the scaffolding install and report install problems plus exact fixes (diagnose-only, never mutates).

@komluk@komlukInstall Command
init-rules

init-rules

Command

Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions while keeping routing…

@komluk@komlukInstall Command
init-scaffolding

init-scaffolding

Command

Bootstrap a new project with the scaffolding CLAUDE.md, settings.json, and `.scaffolding/` directory structure.

@komluk@komlukInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command