- Run
git gtr listto list all worktrees. - For each worktree branch that is NOT the default branch (e.g. main), run
git gtr rm --force {branch}to remove it. - Run
git pull --pruneto fetch latest changes and prune deleted remote branches.
Clean Worktrees
Clean git worktrees created by git-worktree-runner
Clean Worktrees by dyoshikawa · 84e81bf
npx skillmds@latest add dyoshikawa/clean-worktrees File contents
---name: clean-worktreesdescription: Clean git worktrees created by git-worktree-runner---1. Run `git gtr list` to list all worktrees.2. For each worktree branch that is NOT the default branch (e.g. main), run `git gtr rm --force {branch}` to remove it.3. Run `git pull --prune` to fetch latest changes and prune deleted remote branches.
dyoshikawa/websearch/tree/main/.claude/skills/clean-worktrees commit 84e81bf982
Frequently asked questions
Run npx skillmds@latest add dyoshikawa/clean-worktrees in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Clean git worktrees created by git-worktree-runner It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
dyoshikawa (@dyoshikawa) published this skill. Their other Agent Skills are listed on their SkillMD profile.