remove-worktree

Removes a git worktree and its associated branch with uncommitted-change safety checks.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gabrielnsmnto/kord-aios --skill remove-worktree-gabrielnsmnto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: remove-worktree
Source: https://github.com/gabrielnsmnto/kord-aios/tree/main/src/features/builtin-skills/kord-aios/worktrees/remove-worktree
Command: npx skills add https://github.com/gabrielnsmnto/kord-aios --skill remove-worktree-gabrielnsmnto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cleaning up finished or abandoned git worktrees manually is error-prone: you can lose uncommitted work, delete the wrong branch, or fail because you are standing inside the worktree. This Skill automates safe removal of Kord AIOS-managed worktrees and their branches. ## Core Features & Use Cases - Safe removal workflow: Validates the git repository, confirms the worktree exists, and displays its details before deletion. - Uncommitted-change protection: Warns about uncommitted files and requires a force flag or explicit confirmation before destroying work. - Interactive and YOLO modes: Defaults to a confirming interactive mode, with an autonomous mode for fast cleanup after merges. - Use Case: After merging story branch auto-claude/PROJ-123, run the removal command to delete both the worktree directory and its branch, with an audit log of the operation. ## Quick Start Ask the agent to remove the worktree for story PROJ-123 and confirm the deletion when prompted.

Frequently Asked Questions about remove-worktree

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

FAQPage Schema
How do I remove a git worktree and its branch?▼

Run the remove-worktree command with the story ID, for example remove-worktree PROJ-123. It deletes the worktree directory via git worktree remove and deletes the branch with git branch -d, confirming with you first in interactive mode.

How do I force remove a worktree with uncommitted changes?▼

Pass the force flag, for example remove-worktree PROJ-123 --force. This bypasses the uncommitted-changes warning and permanently deletes the changes, so commit or merge your work first if you need to keep it.

Why can't I remove a worktree while inside it?▼

Git cannot remove a worktree that is your current working directory. Navigate back to the project root with cd, then run the removal command again.

What git version is required for worktree commands?▼

Git worktree support requires git version 2.5 or later. The skill has been tested on Windows, Linux, and macOS with compatible git versions.

What should I do if automatic worktree removal fails?▼

Perform manual cleanup: run git worktree remove with the force flag on the worktree path, delete the branch with git branch -D, then run git worktree prune to clear stale references.