discard_worktree
Safely discard an isolated git worktree and its branch when a subgoal is rejected or abandoned, archiving its status as 'discarded'.
Instructions
v1.0.0: Discard an isolated git worktree safely. Removes the worktree (git worktree remove --force), deletes its branch, and archives status as 'discarded'. Use when a subgoal is rejected or abandoned. All paths pass guardWorkspacePath + sensitiveGuard.
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": {
"worktree_id": "<worktree_id>",
"repo_path": "<repo_path>"
},
"name": "discard_worktree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | Main workspace repository path inside workspaceRoot. | |
| worktree_id | Yes | Worktree ID (wt_...) to discard. |