{"version":"2.1.324","anchor":"worktree-creation-guards-against-a-planted-commondir-file","canonical_anchor":"worktree-creation-guards-against-a-planted-commondir-file","heading":"Creating a worktree now checks for a planted commondir file","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/worktree-creation-guards-against-a-planted-commondir-file","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### Creating a worktree now checks for a planted commondir file\n\nAfter creating a git worktree, Claude Code looks for an unexpected commondir file and removes it or warns you not to run git there\n\n**Unclear.** Whether this check runs by default depends on a remote switch whose default is not known.\n\n**What**\n\nA git worktree is a second working copy of the same repository, kept in its own folder. After Claude Code creates one with `git worktree add`, it now checks for an unexpected file named `commondir` that a command run inside the sandbox might have planted. The sandbox is the restricted environment Claude Code can run commands in.\n\nIf Claude Code finds such a file, it does one of two things:\n\n- Deletes the file and stops with an error\n\n- Tells you not to run git in that folder\n\nThe check is tied to a remote switch.\n\n**Why**\n\nThis is a security hardening. A command running in the sandbox should not be able to leave behind a file that changes how git behaves in the new worktree.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}