Delete a phantom worktree and its branch
Deletes a phantom worktree and its branch after confirming uncommitted changes.
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint<worktree-name>git/worktree/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
<gitbutler_incompatible>
This command does not work with GitButler.
If GITBUTLER_ACTIVE=true from <butler_context>:
Git worktrees are not compatible with GitButler virtual branches.
GitButler uses virtual branches instead of worktrees for parallel development.
All virtual branches exist in the same working directory simultaneously.
Use these instead:
- `crew:git:butler:status` - View virtual branches
- `but branch delete <name>` - Delete virtual branch
To use worktrees, first disable GitButler in this repository.
Exit immediately. Do not proceed with worktree commands.
</gitbutler_incompatible>
<objective>Delete worktree. Confirm if uncommitted changes exist.
</objective> <workflow>const status = Bash({ command: `phantom exec ${name} git status --porcelain` });
if (status.trim()) {
AskUserQuestion({
questions: [
{
question: `Worktree ${name} has uncommitted changes. Delete anyway?`,
header: "Confirm",
options: [
{
label: "Delete with changes",
description: "Force delete, losing uncommitted work",
},
{ label: "Cancel", description: "Keep the worktree" },
],
multiSelect: false,
},
],
});
}
phantom delete ${name} # Regular delete
phantom delete ${name} --force # If confirmed with uncommitted changes
</workflow>
<success_criteria>
</success_criteria>