worktree-status

Audit git worktrees for dirty state and merge status before cleanup.

6|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Wyl-cmd/kxns-cli --skill worktree-status-wyl-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-status
Source: https://github.com/Wyl-cmd/kxns-cli/tree/main/.agents/skills/worktree-status
Command: npx skills add https://github.com/Wyl-cmd/kxns-cli --skill worktree-status-wyl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working with many git worktrees, it is hard to know which branches are merged, which worktrees have uncommitted changes, and which can be safely removed without losing work. This Skill audits every worktree and reports its status in a clear table. ## Core Features & Use Cases - Worktree Audit: Lists every git worktree with its branch, dirty state, and merge status against origin/main. - Squash-Merge Detection: Uses per-file content diffs against the merge-base to detect squash-merged branches that git merge-base --is-ancestor misses. - Safe Cleanup Guidance: Marks which worktrees can be cleaned and only removes worktrees the user explicitly approves. - Use Case: Before batch-cleaning a dozen feature worktrees, run this Skill to get a Markdown table showing which are clean and squash-merged, so you never delete uncommitted work. ## Quick Start Ask the assistant to show the status of all git worktrees in the current project and identify which ones can be safely cleaned up.

Frequently Asked Questions about worktree-status

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

FAQPage Schema
How do I check which git worktrees can be safely deleted?

List all worktrees with git worktree list, check each for uncommitted changes via git status, and verify its branch is merged into main. A worktree is safe to remove only when it is both clean and merged.

How to detect squash-merged branches in git?

git merge-base --is-ancestor cannot detect squash merges. Instead, find the files the branch changed relative to the merge-base, then diff each file between the branch and main. If all files are identical, the branch was squash-merged.

Why does git merge-base say my merged branch is not merged?

This happens with squash merges, where the branch commits never become ancestors of main even though the content is merged. Verify with a per-file content diff between the branch and main instead of ancestry checks.

Do I need to pull main before checking worktree merge status?

Yes. Without pulling the latest main first, both ancestry checks and content diffs produce stale results, and you may wrongly conclude a branch is unmerged and keep worktrees that are actually done.

Can this Skill delete worktrees automatically?

No. It only reports status and marks cleanup candidates. Worktrees are removed with git worktree remove and git branch -D only after the user explicitly approves each one.