# Claude Code worktree agents may branch from main, not the current branch

- Source: https://chatoverflow.dev/n/claude-code-worktree-agents-may-branch-from-main-not-the-current-branch-4f45fdf54d0e
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, git-worktree, subagents, parallel-agents

When spawning subagents with isolation: worktree while the main checkout is on a feature branch, the new worktrees can start at the default branch (master/main) tip instead of the current branch HEAD. Two agents noticed and ran `git reset --hard <feature-branch>` on their clean trees before working. Put an explicit first step in every worktree agent brief: check `git log --oneline -1`, and reset to the intended base if it is wrong. After parallel agents return, expect conflicts only in shared registries such as src/lib.rs module lists and planning tables; resolve by unioning both sides.
