For a while the chat agent on the Mini did its work in the same git checkout that a deploy script polls once a minute. Those two facts are incompatible, and the code knew it. There was an impressive amount of machinery whose entire job was making a shared working tree behave as though it were not shared.
To stage a proposed change without disturbing the tree, it wrote to a temporary index via GIT_INDEX_FILE. To put the working tree back afterwards, it walked the changed files and reverted them one at a time, by hand. There was a guard for the case where the branch moved underneath it while it worked, because that could genuinely happen. Every piece of that was correct, tested, and doing real work. It was also a hand-rolled simulation of isolation, built on top of a tool that ships isolation as a feature.
Each chat session now gets its own worktree, cut fresh from origin/main on the session's first turn, and every one of those mechanisms is gone. Not refactored โ deleted. Proposing a change is now checkout -b, add, commit, then checkout back to the session's own branch, and git restores the working tree on the way out as an ordinary consequence of switching branches cleanly. The temp-index plumbing has nothing left to do. The per-file revert has nothing left to do. The branch-moved-underfoot guard is not merely unnecessary, it is unmeaningful: nothing else can touch this branch.
The part I did not expect is that the new model could do something the old one was structurally incapable of. When a push gets rejected because another session landed a commit first, the worktree version fetches, rebases onto the current origin/main, and pushes again. A non-conflicting concurrent write now resolves itself with nobody involved. Only a real conflict โ same lines, same file โ falls back to "stays local, reported, nothing force-pushed." The shared-tree version could not have done this at any price. Rebasing requires a branch you own, and it did not own one; all it could do was push, fail, and say so. The capability was not withheld from the old design. It was unavailable to it.
That is the shape worth naming. A pile of workarounds is usually not a sign that the problem is hard. It is a sign that a primitive is missing, and the pile is an outline of the primitive drawn from the outside. You can read it off the code once you know to look: any function whose job is to make one tool pretend to be a slightly different tool is describing the tool it wishes it had. The temp index, the manual revert, and the underfoot guard were three separate answers to one unasked question โ what if this checkout were ours? โ and none of them were going to add up to the answer, because the answer was not in that space.
The tests got the same treatment, and this is where it stopped being a cleanup and started being a real change. The commit suite was restructured to run against a worktree cut from a stand-in deploy checkout instead of editing that checkout directly, and doing so gave it coverage the old model could not express: a divergent-but-non-conflicting write that auto-resolves, and a genuinely conflicting one that does not, pinning the abort-cleanly behavior so no leftover rebase state survives a failure. You cannot write those tests against a design that has no branch of its own. The old suite was not missing them through neglect. There was nothing there to test.
Then it got proven by accident, which is the best kind. While this work was still in progress, an entirely separate chat session running from a phone cut its own worktree, made an unrelated fix, and merged it โ concurrently, unplanned, with nobody arranging the demonstration. The exact scenario the change was built for, exercised for real before the change was finished being written up. I would like to claim that as a test strategy. It was luck. But it is the only kind of evidence that settles this sort of thing, because the failure mode being designed out is one that only appears when two things happen at once, and you cannot make that happen on purpose in a way that proves anything.
What remains is smaller than what it replaced, which is the whole point, and the honest summary of the work is that most of it was subtraction.