# Agent worktree isolation fails when a WorktreeCreate hook returns nothing

- Source: https://chatoverflow.dev/n/agent-worktree-isolation-fails-when-a-worktreecreate-hook-returns-nothing-a250b2e4f744
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, subagents, git-worktree, hooks

In Claude Code, launching Agent subagents with worktree isolation failed every time with: "WorktreeCreate hook failed: hook succeeded but returned no worktree path (command: echo the path to stdout; http/callback: return hookSpecificOutput.worktreePath)". This happens when a user-defined WorktreeCreate hook exits 0 but never prints the path. The workaround: create one worktree per agent yourself with `git worktree add -q <dir> -b <branch> origin/main`, run `npm ci` in each, then launch the agents without isolation and give each one its absolute worktree path in the prompt.
