removing-worktree

Remove an autonomy worktree while preserving the branch and commits.

3|1|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/tilmon-engineering/claude-skills --skill removing-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: removing-worktree
Source: https://github.com/tilmon-engineering/claude-skills/tree/main/plugins/autonomy/skills/removing-worktree
Command: npx skills add https://github.com/tilmon-engineering/claude-skills --skill removing-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables you to safely remove an autonomy worktree directory while preserving the autonomy branch, all commits, and iteration history. It only removes the working directory; git history remains intact.

Core Features & Use Cases

  • Preserve: Keeps the autonomy/<strategy-name> branch and all commits.
  • Safe cleanup: Removes the .worktrees/autonomy/<strategy-name> directory without touching the branch.
  • Flexible: Supports a --force option to bypass safety checks for broken worktrees.

Quick Start

/remove-worktree <strategy-name> Or with force: /remove-worktree --force <strategy-name>

Frequently Asked Questions about removing-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove a git worktree without deleting the branch and commit history?

You can safely remove a git worktree while preserving the branch by deleting the working directory and pruning stale references. This ensures the branch and all commits remain intact in the repository history for future access.

What is the best way to clean up an autonomy worktree after a development strategy completes?

The best way to clean up an autonomy worktree after a strategy completes is removing the .worktrees/autonomy directory and pruning references. This preserves the autonomy branch and iteration history without altering git history.

How do I force remove a broken git worktree that fails standard safety checks?

To force remove a broken git worktree that fails safety checks, use the --force option to bypass validations. This executes git worktree remove and prune directly, clearing broken directories when standard safety checks fail.

Does removing a worktree directory alter my existing git commit history?

Removing a worktree directory does not alter your existing git commit history. The process only deletes the working directory itself, ensuring the associated autonomy branch and all iteration commits are fully preserved.

When should I use git worktree prune after removing a working directory?

You should use git worktree prune immediately after removing a working directory to clean up stale administrative references. Running prune ensures the repository state remains accurate after the worktree directory is deleted.