maybe a system prompt to tell it to do checkpoints. Stash is one way, another is jujutsu with git backend. If this was Claude Code then hooks would be the perfect place to put that logic.