v2.25.0 ·
Autopilot stops throwing away its own retrospectives
Autopilot runs a retrospective after each merge. On November 2 it ran the first one, and threw it away.
The agent did the work. It wrote the retrospective and its lessons. Then the prompt told it to delete a small marker file, the one that says a retrospective is still owed. That file lives under .git/, and Claude Code refuses to touch that path as a sensitive file. So the marker stayed. Autopilot read the marker still being there as a failure, and its failure path undid every file the agent had written. The lessons never reached the next item.
The bug report for this very fix was one of those files. It was deleted with the rest, and the session watching the run had to rewrite it from its text.
What changed
Autopilot removes the marker itself now. When the agent says it finished, autopilot commits what it wrote and then deletes the marker. The prompt in packages/cli/src/autopilot/retro.ts tells the agent to leave the marker alone, and so does the retrospective skill. If only the prompt had changed, the agent would have followed the skill straight back to the step it is not allowed to do.
A retrospective that did not finish still fails exactly as before. Its files are undone and the marker stays, so the retrospective is still offered the next time I look at what is waiting.
Why this way
The marker was doing two jobs. It was the to-do note, and it was also how autopilot knew the agent had finished. Taking it away from the agent meant finding another way to tell a retrospective that finished from one that did nothing.
For a normal launch that is easy: the agent reports an outcome, and only shipped counts. A custom agent command reports nothing, so there the signal is the retrospective file itself. Exit cleanly without writing it and the run fails with "it wrote no retrospective.md". I considered counting a clean exit alone as finished, and rejected it. A session that ignored the prompt and exited politely would have removed the marker and lost the retrospective without a word.
Autopilot deletes the marker after the commit, not before the checks. Anything that goes wrong late, a limit, a refused path, a failed commit, finds the marker where it was.
What it does not fix
The retrospectives already lost are not re-run. They are still waiting, and need running from aidlc autopilot pending after this release.
The tests never hit a real Claude Code refusal. The stand-in agent simply does not remove the marker, which ends in the same state. The real proof is the next merge, when the run log should say the retrospective was committed instead of failed.