commands/merge-dependabot.md:196-197 rules out worktrees:
Do NOT use wt switch — shallow clones do not support worktrees reliably. Use git checkout directly when evaluating each PR.
Then :199-206 launches up to five subagents in parallel, all handed the same {repo_path}, each instructed at STEP 1 to run:
cd {repo_path}
git fetch origin pull/{number}/head:pr-{number}
git checkout pr-{number}
Five agents checking out five branches in one working tree clobber each other non-deterministically. Each agent's build and test run evaluates whatever tree the most recent checkout left behind, so the PASS/FAIL verdicts don't reliably correspond to the PRs they're attributed to.
That matters because Phase 4 acts on those verdicts: :494-502 approves and merges. A verdict produced against the wrong tree is worse than no verdict.
This also contradicts the guidance in claude-md-template.md, which notes that subagents inherit the parent's working directory and that parallel agents writing files need real isolation.
The stated premise is also wrong
Shallow clones support git worktree fine. git worktree add works in a --depth clone; the limitation people usually hit is that a branch not present in the shallow history needs fetching first, which this command already does on the line above.
Suggested fix
Any of:
- Give each subagent
isolation: "worktree" (the Agent tool parameter), which handles placement and cleanup
- Give each subagent its own clone directory
- Keep the single tree and evaluate sequentially
If a single shared tree is kept for any reason, the parallel launch has to go — the two are mutually exclusive.
Found while reviewing the repo against Anthropic's current docs and the installed CLI (2.1.238). One of five separate findings from the same pass.
commands/merge-dependabot.md:196-197rules out worktrees:Then
:199-206launches up to five subagents in parallel, all handed the same{repo_path}, each instructed at STEP 1 to run:cd {repo_path} git fetch origin pull/{number}/head:pr-{number} git checkout pr-{number}Five agents checking out five branches in one working tree clobber each other non-deterministically. Each agent's build and test run evaluates whatever tree the most recent
checkoutleft behind, so the PASS/FAIL verdicts don't reliably correspond to the PRs they're attributed to.That matters because Phase 4 acts on those verdicts:
:494-502approves and merges. A verdict produced against the wrong tree is worse than no verdict.This also contradicts the guidance in
claude-md-template.md, which notes that subagents inherit the parent's working directory and that parallel agents writing files need real isolation.The stated premise is also wrong
Shallow clones support
git worktreefine.git worktree addworks in a--depthclone; the limitation people usually hit is that a branch not present in the shallow history needs fetching first, which this command already does on the line above.Suggested fix
Any of:
isolation: "worktree"(the Agent tool parameter), which handles placement and cleanupIf a single shared tree is kept for any reason, the parallel launch has to go — the two are mutually exclusive.
Found while reviewing the repo against Anthropic's current docs and the installed CLI (2.1.238). One of five separate findings from the same pass.