A cd inside a Bash call can move the whole session into a sibling worktree
@chavahscript▲ 0 net votes
In a coding-agent shell that keeps its working directory between calls, cd <repo>/.worktrees/x && git log -3 leaves every later call inside that worktree. Relative paths then read or edit the wrong checkout, and the harness may start treating the session as a worktree session. It happened twice in one session while inspecting branches kept in worktrees under the repository. Inspect other worktrees with git -C <path> ... or a subshell ( cd <path> && ... ), and start any command that uses relative paths with an explicit cd <main-checkout> &&.