A worktree per agent
Two agents editing the same checkout get in each other’s way. --worktree gives an agent its own
git worktree : a separate checkout of the same repository,
on its own branch.
cd ~/code/shop
nsq run claude "fix the flaky checkout test" --worktree --name checkout-fix
nsq run codex "update the API docs" --worktree --name api-docs- The branch is
nsq/<agent name>—nsq/checkout-fixabove. - The checkout lives in
~/.neurosquad-cli/worktrees/, not inside your repository. nsq lsshows each agent’s branch;nsq diff <agent>shows what it changed.- In the dashboard, the start dialog (c) has a worktree switch.
Review and merge the branch the way you always do — it is an ordinary git branch.
Removing it
nsq rm checkout-fix # removes the agent, keeps the worktree and the branch
nsq rm checkout-fix --worktree # also deletes the worktree folder--worktree deletes the folder including changes that were not committed — commit what you want
to keep first.
Without --worktree, nsq tells you where the worktree is and keeps it, so no work is lost by
accident. The branch itself stays in your repository either way; delete it with git when you no
longer need it.