Back to skills
SKILL.md
Clean Worktrees
ASecurityghq 配下の古い追加 Git worktree を整理・削除する依頼で使う。
- 10 stars
- 0 votes
- 0 copies
- 1 view
- Added November 9, 2026
Security analysis
100/100npx -y skills add sasamuku/dotfiles --skill clean-worktrees --agent claude-codeAre you the author of Clean Worktrees?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sasamuku-clean-worktrees)---
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
Related skills
View all in tools →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.