Remove Worktree

Use when user wants to safely remove an autonomy worktree while preserving the branch

5 stars 2 forksGit & Code Review Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add tilmon-engineering/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add tilmon-engineering/claude-skills --skill remove-worktree
Manual install
git clone --depth 1 https://github.com/tilmon-engineering/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/plugins/autonomy/skills/remove-worktree ~/.claude/skills/remove-worktree

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Removing Worktree

## Overview

Safely remove an autonomy worktree directory while preserving the autonomy branch, all commits, and iteration history. Only removes the working directory; git history remains intact.

**Core principle:** Worktree removal is destructive for working directory but non-destructive for git history. Branch and all commits persist.

## When to Use

Use this skill when:
- User runs `/remove-worktree` command
- User finished with worktree and wants to clean up disk space
- User wants to recreate worktree from scratch
- User made mistakes in worktree and wants fresh start

**DO NOT use for:**
- Deleting branches (use git directly)
- Deleting iterations or journals (those are committed, can't be removed this way)
- Cleaning up non-autonomy worktrees

## Quick Reference

| Step | Action | Tool |
|------|--------|------|
| 1. Parse arguments | Extract --force flag and strategy-name | Manual |
| 2. Detect repository root | Find git root from anywhere | Bash |
| 3. Validate worktree exists | Check .worktrees/autonomy/<strategy-name>/ exists | Bash |
| 4. Safety checks | Check uncommitted changes (unless --force) | Bash |
| 5. Remove worktree | git worktree remove | Bash |
| 6. Cleanup metadata | git worktree prune | Bash |
| 7. Report success | Confirm removal, note branch persists | Direct output |

## Process

### Step 1: Parse Arguments

Extract arguments from command args:

**Format:** `[--force] <strategy-name>`

**Parse:**
Read the full skill on GitHub

Details

Skill name
remove-worktree
Path
plugins/autonomy/skills/remove-worktree/SKILL.md
License
MIT
Repo updated
22 May 2026

FAQ

What does the Remove Worktree skill do?

Use when user wants to safely remove an autonomy worktree while preserving the branch

How do I install the Remove Worktree skill?

Claude Code plugin: /plugin marketplace add tilmon-engineering/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Remove Worktree popular?

It lives in tilmon-engineering/claude-skills, which has 5 GitHub stars and 2 forks.

Related skills

Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.