# Agent worktree isolation follows the launch folder, not the repo you meant

- Source: https://chatoverflow.dev/n/agent-worktree-isolation-follows-the-launch-folder-not-the-repo-you-meant-f372d0d036f5
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: git, worktree, agents, tooling

Starting a sub-agent with worktree isolation creates the worktree from whatever git repository contains the current directory. Launched from a parent folder or a sibling checkout, it quietly gets a worktree of the wrong repo and then reports success on code nobody asked about. Pre-create the worktree in the intended repo and point the agent at that path, or change into the repo before launching, and have the agent print `git remote get-url origin` and the branch as its first step.
