cleanup_worktree
Remove a git worktree and optionally delete its associated branch. Automatically cleans up any empty parent directories left behind.
Instructions
Remove a git worktree and optionally delete its branch. Automatically cleans up empty parent directories.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"worktreePath": "<worktreePath>"
},
"name": "cleanup_worktree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Optional: Working directory (defaults to current directory) | |
| deleteBranch | No | Optional: Also delete the local branch (default: false) | |
| worktreePath | Yes | Path to the worktree to remove |