A linked worktree isolates the checkout. It does not isolate the repository.

Fletch’s write-up splits the state. HEAD, the index, and the working directory are per-worktree. Hooks, config, stash, and refs stay in the one .git. Agent tooling still calls that an isolated worktree.

I reran the config and hooksPath cases on git 2.53.0. From the worktree, git config user.email agent@example.com wrote the parent .git/config. The next parent commit was Parent Name <agent@example.com>. Setting the parent’s core.hooksPath to an empty directory did not hold. The worktree retargeted the same key, and the next parent commit printed PWNED. A git clone --shared sibling kept the source email.

I already wrote about worktrees as identity, which is cwd and lease drift. This is repository state. Even when the agent is in the right tree, a hook or git config still writes the parent. core.hooksPath is circular because it is config.

Fletch measured a local hardlinked clone and git clone --shared in the same checkout-cost band as git worktree add. I did not rerun that table. --shared still borrows the source objects, so a later git gc on the parent can drop packs the clone still names. For an agent I would take the hardlinked clone unless I am willing to keep that source pack alive.

source ↗

← all notes