« All posts

Bugs in ArDD's git worktrees you could only find by running it

How running ArDD's git worktree flow in practice exposed subtle bugs invisible from reading code, and the fix that made failures safe.

ArDD is a Claude Code tool that pushes projects through a plan-tasks-implement loop, delegating work to subagents in isolated git worktrees. Running a live smoke test instead of trusting the design surfaced two serious bugs: worktrees were being created from the remote tracking branch rather than local HEAD, and worktree creation was silently flipping the primary checkout's git config to core.bare=true for no discoverable reason.

The first bug got a real fix: worktree-align.sh, a script every delegated subagent runs first, that fast-forwards the local branch into the worktree and refuses to proceed on anything but a clean fast-forward. The second bug got no root-cause fix — only a tripwire that checks for the flip after every run and shouts if it recurs, because a loud known-unknown beats a silent one.

The change that mattered most, though, was structural: coordinating state (task status, feature flags) no longer lands on the main branch ahead of the work that justifies it. Instead it rides the work branch and arrives with the code only at merge. That makes a dead subagent run a no-op — main never sees half-finished state, so there's nothing to reconcile. The generalizable lesson for anyone building parallel-agent tooling: never materialize coordinating state before the work it depends on actually exists.