each task gets its own git worktree under .worktrees/<task-id>. the worktree shares the object store with the main repo but has its own working copy and head, so two agents can edit overlapping paths at the same time without stepping on each other. bernstein creates the worktree on assignment, the agent does its work, quality gates run inside the worktree, the merge queue picks up passing worktrees in dependency order and squash-merges them into the target branch. on failure or kill the worktree stays on disk so you can inspect or cherry-pick. source: src/bernstein/core/git/worktree.py.
canonical answer