Yesterday running aidd’s own start script during verification rewound an in-flight commit of mine. I recovered it. Worktrees would not have prevented that start-script failure, but I also wanted to get routine agent edits out of my working tree.
aidd now has an option to give each coding run its own working copy.
Until now, when an agent worked on one of my projects, it was editing the real files, live. With worktree mode enabled, each run gets a complete, disposable copy of the project to work in - a git worktree on its own branch, which is cheap to create because it shares the object database with the real repository. If the work goes well, it merges back cleanly. If it fails, the copy is discarded. If the merge would conflict with something else that changed in the meantime, the work parks and waits for my review instead of forcing its way in. A side benefit I hadn’t really designed for: two runs can work on the same project without editing the same working files. Their changes can still conflict when they merge.
Three smaller guardrails came along for the ride: a sanity check that compares an agent’s plan against the feature’s actual requirements before it starts building, a fast lane that skips the heavyweight planning committee for simple tasks, and spending trackers that warn when a run blows past a cost or token budget (just watching for now - enforcement can come once I trust the numbers).