Skip to content
Back to skills

Remove Worktree

ASecurity

Inspect and safely remove stalled or finished SDD worktrees, refusing any worktree with a live sdd-worker inside

  • 34 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 10, 2026
ai-agentsgoshell

Security analysis

A100/100

Scanned November 10, 2026

npx -y skills add phenobarbital/ai-parrot --skill remove-worktree --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Remove Worktree?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Remove Worktree
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/phenobarbital-remove-worktree/badge)](https://www.skillsdirectory.com/skills/phenobarbital-remove-worktree)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: remove-worktree
description: Inspect and safely remove stalled or finished SDD worktrees, refusing any worktree with a live sdd-worker inside
---

# Remove Worktree

## Full procedure and host adaptations

Before executing, read the [full remove-worktree procedure](../../../.claude/commands/remove-worktree.md)
and your host's adaptation contract: the [Codex adaptation contract](../../../docs/sdd/CODEX.md#codex-adaptation-contract)
on Codex, or the [Antigravity adaptation contract](../../../docs/sdd/AGY.md#antigravity-adaptation-contract) on Google Antigravity (`agy`).
Follow the full procedure for details omitted from this summary. The adaptation
contract and the Codex-specific instructions below override Claude runtime syntax
and legacy shell examples; retain all workflow gates and evidence requirements.

Invocation: `remove-worktree [<branch|FEAT-id|dir>] [--stale] [--delete-branch] [--force] [--dry-run]`.

## Workflow

1. Run `parrot sdd worktree list` and show the user every worktree and orphan directory with its state.
2. Dry-run first: `parrot sdd worktree remove <target> --dry-run`.
3. Remove only after the user agrees: `parrot sdd worktree remove <target>` (`--stale` for orphan directories).
   `--stale` refuses an orphan directory that still holds registered worktrees
   (a coder `--pool` dir is the usual case) and one that is itself a checkout
   with uncommitted or unpushed work. Remove those individually first, then
   sweep the empty parent. Never reach for `--force` to get past the refusal
   without reading what it names.

## Safety gates (all enforced by the tool)

| Gate | Overridable |
|---|---|
| Primary repository checkout | never |
| `main` / `dev` / `staging` / `master` branch | never |
| Live process with cwd inside | **never** — stop the process |
| Uncommitted changes | `--force` |
| Commits not on origin | `--force` |

An exact match on a protected branch name is refused up front, so
`remove-worktree dev` cannot silently resolve to
`feat-FEAT-378-devloop-enhancement` by substring.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.