Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(plugin): anchor WorktreeRemove at the project dir (#3489)

Jude Wang5ebdcb15008d
diff --git a/plugins/worktrunk/hooks/hooks.json b/plugins/worktrunk/hooks/hooks.json
index 51ec98160..f3ba04e27 100644
--- a/plugins/worktrunk/hooks/hooks.json
+++ b/plugins/worktrunk/hooks/hooks.json
@@ -79,7 +79,7 @@
"hooks": [
{
"type": "command",
- "command": "bash -c 'p=$(jq -er .worktree_path) || exit 1; bash \"$CLAUDE_PLUGIN_ROOT/hooks/wt.sh\" remove --foreground \"$p\"'"
+ "command": "bash -c 'p=$(jq -er .worktree_path) || exit 1; cd \"${CLAUDE_PROJECT_DIR:-.}\" || exit 1; bash \"$CLAUDE_PLUGIN_ROOT/hooks/wt.sh\" remove --foreground \"$p\"'"
}
]
}