What
Claude Code now refuses a linked git worktree (an extra checkout of the same repository in another folder) when something is mounted over its administrative entry in .git/worktrees/<name>, with the reason foreign_mount. A mount here means another disk or, on Linux, another mounted filesystem placed over that folder.
- The check compares devices and, on Linux, mount ids read from
/proc/self/fdinfo, resolving bind mounts through/proc/self/mountinfo. If mount ids cannot be read, it logs that it is comparing by device alone. - The message tells you to unmount it, or start from the repository's main checkout.
- Uploading from such a worktree is refused the same way.
- If the git directory changes while it is being read, the check stops with "the git directory changed while it was read".
- The check also records when the git directory was created.
Why
Whatever is mounted there is not the repository's own record, so trusting it could mean acting on someone else's metadata. Worktrees set up under a bind mount, as in some container setups, may now be refused where they were accepted before.
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is unclear which feature runs this check first, cloud file capture or starting work in a worktree.