Git Worktrees Are a Trap for AI Agents β Here’s the Real Danger
Git worktrees share a single .git directory, making them a dangerous choice for AI coding agents. What feels like cheap isolation is actually a vector for cross-contamination. Agents can access hooks, config, and stashes across worktrees. The real solution: clone the repository for true sandboxing. Don’t let your next agent ruin your entire local Git environment.