Skip to content
Back to skills

Clean Worktrees

ASecurity

ghq 配下の古い追加 Git worktree を整理・削除する依頼で使う。

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 9, 2026
toolsgit

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add sasamuku/dotfiles --skill clean-worktrees --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Worktrees?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Worktrees
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sasamuku-clean-worktrees/badge)](https://www.skillsdirectory.com/skills/sasamuku-clean-worktrees)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-worktrees
description: ghq 配下の古い追加 Git worktree を整理・削除する依頼で使う。
disable-model-invocation: false
---

# Clean Worktrees

- ghq 配下の追加 worktree のうち、ディレクトリ作成から7日 (604800秒) 以上を削除する。
- 未コミット変更・未追跡ファイル・未マージのコミット・壊れたサブモジュールも対象。ブランチは保持する。
- 元のリポジトリ、main/master ブランチの worktree、開始時の作業ディレクトリを含む実行中の worktree、locked、ghq 外は削除しない。
- 作成日時が不明なら保持する。mtime・ctime・コミット日時で代用しない。
- 整理の実行依頼でのみ削除する。この条件の削除は承認済みとして追加確認しない。調査・一覧・スキル編集だけでは削除しない。
- 削除には `wt -C <元のリポジトリ> remove --no-delete-branch --force --foreground <worktreeの絶対パス>` を使う。`--force-delete` は使わず、ブランチを保持する。
- 削除前に候補のパス・作成日時・経過日数を示し、削除後にパスと登録の消失を確認する。削除・保持・失敗と理由を報告する。
- 定期実行は設定しない。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.