원클릭으로
cleanup
Clean up stale research worktrees whose branches have been merged or deleted.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Clean up stale research worktrees whose branches have been merged or deleted.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Capture session learnings and save to skills, guidelines, or reference docs under ~/.claude/.
Orchestrate parallel claude -p sessions — bootstrap, launch, monitor, and converge. Works with any skill that produces manifest.json, item directories, and a runner script.
Create a request (pull request or merge request) or update an existing one following project conventions.
Resolve merge or rebase conflicts between branches.
Assess open PRs with unaddressed review comments and generate a parallel addressing script — produces manifest.json and let-it-rip.sh for address-request-comments execution.
Assess open work items and generate a parallel execution script — produces manifest.json and let-it-rip.sh for implement/clarify execution.
| name | cleanup |
| description | Clean up stale research worktrees whose branches have been merged or deleted. |
| disable-model-invocation | true |
Keywords: ralph, research worktree cleanup, branch cleanup, post-research, stale worktree, MERGED, REMOTE DELETED, LOCAL ONLY, DIRTY worktree, git worktree remove
Prune stale ralph worktrees by checking if their branches have been merged or deleted on the remote.
/ralph:cleanup - Scan and offer to remove stale worktreesList ralph worktrees:
git worktree list
claude/worktrees/research-Classify each worktree: For each ralph worktree, extract the branch name and check its status:
git branch --merged main includes it) — safe to removegit ls-remote --heads origin <branch> returns nothing AND the branch has upstream tracking configured) — likely merged via PR, safe to removegit -C <worktree-path> rev-parse --abbrev-ref @{upstream} fails) — ambiguous, prompt operatorgit -C <worktree-path> status --porcelain is non-empty) — warn before removing, can combine with other statuses (e.g., "MERGED + DIRTY")Present findings: Show a summary table of worktrees with their status and branch name. Example:
Ralph worktrees:
- research-my-topic (research/my-topic) — MERGED, safe to remove
- research-other-topic (research/other-topic) — ACTIVE, branch on remote
- research-old-thing (research/old-thing) — REMOTE DELETED, likely merged via PR
- research-experiment (research/experiment) — LOCAL ONLY, never pushed
- research-wip (research/wip) — ACTIVE + DIRTY, uncommitted changes
Ask which to remove:
Remove selected worktrees: For each worktree to remove:
git worktree remove <worktree-path>
--force only with operator confirmationgit branch -d <branch> (only if merged)Report results:
Cleaned up N ralph worktree(s).
Remaining: M active worktree(s).